Repository navigation
feat(notification): notification channel commands for outbound webhooks (#159) - #167
Merged
Merged
Conversation
…ks (#159) - notification channel list, get, create, update, delete, events, subscriptions, subscribe, test and logs (devops or admin; a channel name or ID). - The webhook URL can hold a token: every output mode (also -o json and -o yaml) shows only the scheme and the host unless --show-url. --url-env reads the URL from an environment variable. Error texts never contain the URL. - The HMAC secret comes only from --secret-env NAME or --secret-stdin (hidden input on a terminal). update --clear-secret removes it. - update sends only the given flags. A --filter-* flag replaces all filters; --clear-filters removes them. subscribe replaces the event types; --none removes them. - create --event checks the event types before the channel is created; a failed subscription shows the channel and the subscribe command. - test exits 1 when the webhook does not accept the event. logs pages with --limit and --offset. - Contract tests for the request and response types of this and the earlier PRs (ui-config, follow, deploy-preview, actions, upgrade check, template link, channels). Closes #159 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Commands for the outbound webhook channels (
/api/v1/admin/notification-channels, devops or admin). Each command takes a channel name or ID.notification channel listandget(getalso lists the subscribed events).notification channel create --name --url|--url-env [--format generic|teams] [--secret-env NAME|--secret-stdin] [--disabled] [--filter-name glob] [--filter-owner id] [--filter-definition name|id] [--filter-cluster id] [--event type].notification channel update <channel>: only the given flags change. Also--enable,--disable,--clear-secretand--clear-filters.notification channel delete <channel> [--yes].notification channel events,subscriptions <channel>,subscribe <channel> --event ... | --none.notification channel test <channel>: exit code 1 when the webhook does not accept the test event.notification channel logs <channel> [--limit] [--offset].Security
scheme://host[:port]/..., also-o jsonand-o yaml, unless--show-urlis set. This is a deliberate exception to "JSON prints the full API response".--url-env NAMEreads the URL from an environment variable, so it stays out of the shell history and the process list. Error texts never contain the URL. A URL that does not parse is refused before the request.secret). The CLI reads it only from--secret-env NAMEor--secret-stdin(hidden input on a terminal), never from a flag value. The server never returns it.--debuglogs no request bodies.Other behaviour
--filter-*flag onupdatereplaces all filters.--clear-filterssends{}.subscribereplaces all event types.--nonesends[].create --eventchecks the event types againstevent-typesbefore the channel is created. If the subscription still fails, the command prints the channel (the ID with-q) and an error with thesubscribecommand.Contract tests
test/contract/response_contract_test.gonow checks 15 more types against the server schema:UIConfig,FollowState,DeployPreview,ChartDeployPreview,ActionList,ActionJobLog,UpgradeCheck,UpgradeChanges,TemplateLinkRequest, the channel create and update requests,NotificationChannelFiltersandNotificationChannel.Tests
go test ./...passes, alsogo test -shuffle=on ./cmd.staticcheck(latest) has no findings.cli/cmd/notification_channel_test.go(masking in every mode, secret sources, usage errors, partial updates, the subscription-failure path, test and logs) andcli/pkg/client/notification_channels_test.go.Closes #159
🤖 Generated with Claude Code