STAC-25461 Drop SLACK_CI_REPORT_CHANNEL from the Cerberus notify path - #452
Merged
LouisParkin merged 1 commit intoJul 31, 2026
Merged
Conversation
The Cerberus Lambda already knows which channel to post to, so passing one
from the workflow is redundant. `notify.go` resolves the channel as:
Channel: util.GetOrDefault(req.Context, "channel", s.Channel)
and `util.GetOrDefault` (internal/util/context.go:27) treats an empty or
whitespace value as absent, falling back to the Lambda's own SLACK_CHANNEL
environment variable. Since this repo does not hold the secret, the previous
code was sending `channel: ""` on every call and hitting that fallback
anyway -- the field never did anything.
Dropping it halves what pulumi-infra has to provision for this repo
(StackVista/pulumi-infra#258 now asks for CERBERUS_LAMBDA_URL alone), which
matters because org-level secrets default to visibility=private and are
therefore invisible to this PUBLIC repo.
The `channel` key is removed from the payload entirely rather than sent
empty; GetOrDefault makes the two equivalent, and omitting it states the
intent. A comment records how to reintroduce it if agent failures should
ever go somewhere other than the shared CI channel.
Verified: actionlint clean (only the pre-existing self-hosted runner-label
warnings), zizmor clean, and the jq payload still emits valid JSON in the
shape Cerberus expects.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Removes the Slack channel from the Cerberus notification payload. It was never doing anything, and dropping it halves what pulumi-infra has to provision for this repo.
Why
@fzhdanov flagged in Slack that
SLACK_CHANNEL_IDis no longer needed because the Lambda already runs with it. I verified that against the Cerberus source.internal/router/route/notify.goresolves the channel as:and
util.GetOrDefault(internal/util/context.go:27) treats an empty or whitespace value as absent:This repo does not hold
SLACK_CI_REPORT_CHANNEL, so${{ secrets.SLACK_CI_REPORT_CHANNEL }}was expanding to an empty string and every call was already sendingchannel: ""and hitting that fallback. The field was inert.What changed
cerberus-notify.yml:SLACK_CI_REPORT_CHANNELentry fromworkflow_call.secretsSLACK_CHANNELenv var, the--arg channelbinding, and thechannel:payload fieldGetOrDefaultmakes the two equivalent, but omitting it states the intentThe three callers (
lint-and-unit-tests.yml,build-binaries.yml,build-deb.yml) no longer pass the secret.Knock-on effect
StackVista/pulumi-infra#258 now asks for a single value,
CERBERUS_LAMBDA_URL, instead of two. That matters here because org-level secrets default tovisibility: private, which in GitHub means private repos only — andstackstate-agentis public, so it cannot see the org-level copies. Fewer repo-level values is a smaller ask and a smaller surface.Validation
actionlint— clean apart from the pre-existing unknown-runner-label warnings for our self-hosted labels (docker-public,xlarge-public,arm64-xlarge-public)zizmor --collect=workflows,actions,dependabot .—No findings to reportjqinvocation still emits valid JSON in the shape Cerberus expects:{"action":"notify","context":{"platform":"github","project.id":"StackVista/stackstate-agent","project.slug":"StackVista/stackstate-agent","project.name":"StackState Agent","branch":"stackstate-7.78.2","pipeline":"123","commit.sha":"abc","commit.title":"STAC-1 fix","suite":"unit-tests"}}No CI behaviour changes: the notify job still only runs on
pushwhen a needed job failed, and still exits 0 with a warning annotation whileCERBERUS_LAMBDA_URLis absent.Targets
STAC-25142-agent-lint-unit(the #444 integration branch), notmaster.Jira: https://stackstate.atlassian.net/browse/STAC-25461