Skip to content

Restore the release actor lookup the failure notice references - #6632

Merged
ChrisJBurns merged 2 commits into
stacklok:mainfrom
ynaamane:fix/release-failure-notice-triggered-by
Nov 25, 2026
Merged

ChrisJBurns merged 2 commits into
stacklok:mainfrom
ynaamane:fix/release-failure-notice-triggered-by

Conversation

@ynaamane

@ynaamane ynaamane commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The release failure Slack notice reads needs.extract-release-actor.outputs.triggered_by, but no job of that name exists in releaser.yml any more: #4982 removed extract-release-actor together with the docs-website dispatch it fed, and left the payload's reference behind. The expression is always undefined, so the notice falls through to github.actor, which on release: published is the release GitHub App rather than the person who started the release. actionlint flags it:

releaser.yml:364:428: property "extract-release-actor" is not defined in object type
{compute-build-flags: ...; image-build-and-push: ...; publish-helm: ...;
 release-binaries: ...; skills-publish: ...} [expression]

The producer side never went away: create-release-tag.yml still reads the Release-Triggered-By trailer from the release commit and writes <!-- Release-Triggered-By: X --> into the release notes "parsed by releaser.yml". This restores the consumer.

  • Re-add an extract-release-actor job that reads github.event.release.body through env: and extracts the username from the HTML comment (same pattern as the job removed in Unify docs-website release pipeline: new assets + retire dispatch chain #4982). permissions: {}, no token, no checkout, no ${{ }} inside run:.
  • Keep only the first match (head -n 1): --generate-notes copies merged PR titles into the body verbatim, so a second Release-Triggered-By comment is reachable, and a two-line value would make the GITHUB_OUTPUT write malformed and fail the job.
  • Add it to notify-release-failure's needs: so the output is addressable again.

When the comment is absent the output is empty, the step logs one line saying so, and the payload's existing || github.actor fallback applies, as before.

Fixes #6265

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

  • Unit tests (task test)
  • E2E tests (task test-e2e)
  • Linting (task lint-fix)
  • Manual testing (describe below)

The release workflow cannot run from a pull request, so the verification is static plus a shell test of the extraction:

  • actionlint .github/workflows/releaser.yml: the extract-release-actor property error is gone; the remaining output is byte-identical to main (two pre-existing shellcheck infos at lines 91 and 258, untouched here).
  • zizmor --persona regular .github/workflows/releaser.yml: same findings as main, zero new (the new job binds the release body through env: and has no expression in run:).
  • The new step's run: body executed locally under bash -e against sample release bodies: the comment present (yields the name), absent (empty value, the fallback log line, exactly one triggered_by= line written), an unrelated HTML comment first plus trailing whitespace (yields the name), and the comment twice with different names on one line and on two lines (yields exactly the first name and exactly one output line). Negative control: without head -n 1 the two-comment bodies write two lines. Also checked under set -o pipefail: a no-match body exits 1 and a two-match body exits 141 from head closing the pipe, which is why || true stays.
  • Removing the new needs: entry brings the actionlint error back; removing the job while keeping the needs: entry produces the unknown-job error. Both restored.

Does this introduce a user-facing change?

No.

@ynaamane
ynaamane requested a review from JAORMX as a code owner September 10, 2026 13:22
stacklok#4982 deleted the extract-release-actor job and the docs dispatch it
fed, but left the Slack failure notice reading its output, so the
notice silently falls back to github.actor (the release GitHub App,
not a person) since the property is always undefined.

Re-add the job, reading github.event.release.body through env: with
no token and no checkout, avoiding the original's gh release view
call that interpolated github.ref_name into run: (the injection
shape already removed elsewhere in this file).

Keep only the first Release-Triggered-By comment: a second one (for
example folded in from a merged PR title by --generate-notes) would
otherwise write a two-line value to GITHUB_OUTPUT, fail this job, and
since it now sits in notify-release-failure's needs, fire a false
alert on a release that actually succeeded. Log when no comment is
found so a missing match is visible instead of silent.

Signed-off-by: Naamane Yanis <[email protected]>
@ynaamane
ynaamane force-pushed the fix/release-failure-notice-triggered-by branch from 518293a to 7c560a4 Compare October 8, 2026 12:43
# Conflicts:
#	.github/workflows/releaser.yml
@ChrisJBurns
ChrisJBurns merged commit 3f8a150 into stacklok:main Nov 25, 2026
14 checks passed
@codecov

codecov Bot commented Nov 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.16%. Comparing base (504241a) to head (c89bc54).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6632      +/-   ##
==========================================
+ Coverage   82.10%   82.16%   +0.05%     
==========================================
  Files         931      931              
  Lines       94306    94366      +60     
==========================================
+ Hits        77434    77536     +102     
+ Misses      16867    16825      -42     
  Partials        5        5              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Release failure Slack notice never shows the release triggerer

3 participants