Strip JS comment steps from submit/apply; add github-decision + artifact upload - #324
Open
Mpdreamz wants to merge 1 commit into
Open
Strip JS comment steps from submit/apply; add github-decision + artifact upload#324Mpdreamz wants to merge 1 commit into
Mpdreamz wants to merge 1 commit into
Conversation
…act upload The three actions/github-script comment steps (post-success-comment, post-comment-only, post-failure-comment) and their four JS scripts are removed. In their place, a single shell step copies the staging metadata and YAML into .artifacts/changelog-decision/, calls changelog github-decision to stamp CommitOutcome, then uploads the changelog-decision artifact with if: always() and continue-on-error: true. The downstream release-notes-comments workflow (added in #323) picks up this artifact and posts the sticky comment with pull-requests: write, keeping comment responsibility out of the commit job. The config input is removed from the action; it was only used in the now- deleted post-failure-comment step. Co-Authored-By: Claude <noreply@anthropic.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.
The three
actions/github-scriptcomment steps and their four JS scripts are removed fromchangelog/submit/apply. Commenting now happens in the downstreamrelease-notes-commentsworkflow (added in #323). A new shell step records the commit outcome into the metadata and uploads it aschangelog-decisionso the comment workflow picks it up.Affects: Release notes, Automation
Why
Commenting from inside
submit/applyrequiredpull-requests: writeon the commit job. The JS scripts (post-success-comment.js,post-comment-only.js,post-failure-comment.js) were the only things in the repo that posted PR comments. Moving them to a dedicatedworkflow_runjob with its own token gives the commit job a narrower permission set and lets any future consumer opt into comments by copying one file instead of modifying the submit workflow. The three steps also lackedcontinue-on-error: true, so a transient 403 from the GitHub API could fail a run that otherwise committed the entry successfully.What
JS scripts removed
All four scripts in
changelog/submit/apply/scripts/(comment-helper.js,post-success-comment.js,post-comment-only.js,post-failure-comment.js) are deleted. Theconfiginput — used only bypost-failure-comment.js— is also removed from the composite.Record decision and stage comment artifactstepAfter the commit step, a single shell step runs
if: always()withcontinue-on-error: true. It copies the staging metadata and generated YAML into.artifacts/changelog-decision/, callschangelog github-decision --commit-outcome <committed|failed|none>to stamp the outcome, and sets--committed-filewhen the commit succeeded. The directory layout matches whatchangelog github-commentexpects.Upload decision artifactstepUploads
.artifacts/changelog-decisionaschangelog-decisionwithif: always()andcontinue-on-error: true,if-no-files-found: ignore. The downstreamrelease-notes-commentsworkflow (PR #323) picks this up withpull-requests: writeand posts or updates the sticky comment.Verify
Open a PR in a repo that has
release-notes-comments.ymlwired up. The Changelog submit workflow should complete without posting a comment itself. A few seconds later theChangelog PR commentsworkflow should run and post (or update) the sticky### 📋 Changelogcomment.Stack: 3 of 4, on top of #323. PR 4 drops
should-comment-success/should-comment-failurefromdocs-builderonce this PR is merged and no code reads those outputs.Risk:
elastic/cloudcurrently readsshould-comment-successandshould-comment-failurefromsubmit/apply/evaluate-artifact. Those outputs are onChangelogArtifactEvaluationService, notapply. They are dropped in the coordinateddocs-builderPR 4 — this PR does not touch them.Out of scope:
changelog/submit/evaluateis untouched.changelog-submit.ymlis untouched.elastic/cloud's consumer workflow must haverelease-notes-comments.ymlin place on its default branch before this PR is merged.