Repository navigation
Post changelog-file PR comments from the same run - #439
Conversation
Remove the github-script comment steps and JS scripts from changelog/submit/apply. The action now records the decision with changelog github-decision and uploads it as changelog-decision, only in the cases where the JS steps commented: committed, commit failed, comment-only, and no-label. A new comment job in release-notes-changelog-file.yml and changelog-submit.yml posts the comment from that artifact through changelog/comment with the new current-run input. The apply job drops to pull-requests: read. The fork-guidance decision uses the same job. Related to elastic/docs-eng-team#1131. Replaces #324. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…vert before merge)
…test (revert before merge)" This reverts commit 8b7b17c.
|
I ran this end to end in docs-playground-release-notes-changelogs, with the caller and this workflow's own What I saw, per case:
One real bug turned up, in docs-builder rather than here: the "entry committed" links repeat the repo name ( Not tested: the fork-guidance path, because it needs a fork PR from a non-member. |
| SKIP_LABELS: ${{ steps.meta.outputs.skip-labels }} | ||
| CONFIG_FILE: ${{ inputs.config }} | ||
| # The comment renderer shows the generated entry in comment-only mode | ||
| GENERATED=$(ls /tmp/changelog-staging/*.yaml 2>/dev/null | head -1) |
There was a problem hiding this comment.
Severity: P2 (Medium)
Allow the YAML lookup to succeed when no entry was generated. For no-label, staging contains metadata but no YAML, so ls exits nonzero. With this step's Bash -e -o pipefail, the assignment terminates the step before github-decision runs. Because the failure is continued and the upload requires a successful decision step, no missing-label comment is posted—the exact failure path this condition is meant to preserve.
Generated by Libra. React with 👍 or 👎 to give feedback on this comment.
This finishes what #324 set out to do. docs-builder#3995 landed today ahead of #324 and silently stopped two changelog comments, and #438 patched the conditions so the JS steps work again. #324 itself can't land: it uploads a
changelog-decisionartifact from the "Changelog file" run, but theworkflow_runcomments callers skip that run (thepull_requestguard from #325), and the newest-run lookup from #422 can't resolve its PR. The full analysis is in elastic/docs-eng-team#1131.Instead of handing the decision to another workflow, this PR posts it from a job in the same run. "Changelog file" already runs from
workflow_runwith a write token, so the fork-token problem behind the cross-run path doesn't apply, and a separate job still takespull-requests: writeoff the commit job.changelog/submit/applyloses the threegithub-scriptsteps, the four JS scripts, and theconfiginput. It runschangelog github-decisionand uploadschangelog-decision, but only where the JS commented: committed, commit failed, comment-only, andno-label. That matters becausegithub-commentdeletes the sticky comment for a success with no body, so recording a decision on every run (as #324 did) would delete comments on early stops and on a second push with nothing new to commit.github-decisionexits 0 when it can't read the metadata, so the step checks that an outcome was written before it uploads. A newdecision-uploadedoutput tells the workflow whether to comment.changelog/commentgets acurrent-runinput that downloads the artifact from the current run instead of resolving the triggering one.release-notes-changelog-file.ymlandchangelog-submit.ymlget acommentjob withpull-requests: writeonly, andapplydrops topull-requests: read. Thefork-guidancedecision from #349 goes through the same job, which should also make that comment appear; I haven't traced a run to confirm it's broken today.changelog-submit.ymlchanges because it callsapply@v1and would otherwise stop commenting at the next release; only docs-eng-playground uses it.No consumer repo needs a change.
Testing
pre-commit passes (actionlint, action-readme). I built docs-builder from
mainand rangithub-decisionon sample metadata forcommitted,failed, andnone; each wrote the expected outcome. The staging metadata fromprepare-artifacthas nogate, so the comment-only and labels-needed bodies render (ChangelogGithubCommentService.cslines 215 and 258).Not tested yet: an end-to-end run.
workflow_runworkflows run from the default branch, so the test needs the docs-playground-release-notes-changelogs caller pointed at this branch, and this workflow's ownuses:refs toapplyandcommentpointed here too, then both reverted before merge. Cases: committed, second push, comment-only, commit failed,no-label, an early stop, and the race with the check run's comment job. It stays a draft until that's done.After merge: publish a release to move
v1, then close #324.Related to elastic/docs-eng-team#1131
🤖 Generated with Claude Code