changelog: Add prs-artifact input for PR-list bundle filtering#235
changelog: Add prs-artifact input for PR-list bundle filtering#235cotti wants to merge 3 commits into
Conversation
The bundle workflows could not consume a PR list generated at release time: the prs input is option-mode only, and file paths must already be committed because bundle-create's internal checkout resets the workspace. Callers can now upload a newline-delimited URL list as a workflow artifact and pass its name via prs-artifact; bundle-create downloads it after checkout and feeds it to docs-builder as the positional filter source in profile mode or via --prs in option mode.
- Detect the URL kind in the artifact and route option mode to --issues
for issue lists; --prs put issue URLs into PrsToMatch where they
silently matched nothing. Mixing kinds now fails fast in the action.
- Require version with profile + prs-artifact: without it the --plan
step substitutes the file path into {version} while the real run uses
"unknown", so the planned output path diverges and the upload fails.
- Make the README discover-prs example actually write prs.txt; the echo
placeholder tripped if-no-files-found: error on the upload step.
|
Pushed fixes for the review feedback in 7127fea:
One pre-existing observation, out of scope here: |
- Classify the URL list exhaustively with anchored patterns: every
non-empty line must be a canonical GitHub PR or issue URL. The
option-mode docs-builder loaders accept any http(s) line, so a
partially valid file previously produced a silently partial bundle,
and unanchored greps also matched URLs merely containing a
github.com PR path.
- Fail explicitly on profile + prs and profile + release-version; the
documented mutual exclusivity was unenforced and both inputs were
silently dropped in profile mode.
- Correct the README claim that date-based versions work like stack
versions: {lifecycle} inference treats 2026-07-07 as a prerelease
("preview"), so date-based profiles should omit {lifecycle}.
|
Pushed fixes for the second review round in 0f60444:
|
|
Can you provide some background into how and when cloud creates these files?
My gut sits uneasy with staging 'arbitrary' files between workflows. I don't like it with in the rare cases we do it for own usages too. Cache poisoning and other concers. The --prs and --issues flags are an artifact of when we needed to render without feature loss. How do those flags relate to this PR? |
From how Dominik mentioned, they are being generated from a release promotion as a list ranging from the start-commit to the end-commit of the intended release. Being commits, I suppose they are linked to their PRs. I'll check the timing.
I suppose a possible alternative would be doing the assessment of PRs ourselves by getting the refs to the beginning and end commits? But I'm not sure if this is further processed by them (or would be by anyone using a similar mechanism).
The objective was to expose the artifact as a possible input, but the flags weren't involved in this PR. |
|
To explain a bit our side of the process:
My guess was that I would use git/github to calculate the list of PRs between previous commit and current, then run the bundler with that information. However my knowledge on the bundler is very limited, so let me know if there is a better way. I have also heard about the github bundler workflow, but I'm unsure how I would integrate that one into the argocd deployment (but we could probably for example add a tag or something like that) |
|
In case it's helpful, this action will also apply to the kibana repo, where they're currently giving us the list of PRs in this format: https://github.com/elastic/kibana/actions/runs/29327282670/job/87066539375 For example:
I'm currently copying and pasting that list of PR URLs into a temporary local |
|
I just want to zoom in on that generate step, and whether that is something we can take ownership of, or at the very least do the same: query the prs between commits. Especially with gitops we need it to be repeatable, atomic on our end too. I rather the handoff be from and to commit hashes. Again gut reaction but I rather not build the process on an external list of PR's/issues. Unless that list is an immutable build artifact as well which is what we initially thought the serverless promotion job reports were. Which would have included more metadata too. On PTO, back Monday so apologies if this is a bit of a drive by comment. |
|
If you can directly allow two commits as input that is fine too. However I think generating PRs from commits is itself also stable and immutable, as you can add/remove PRs between two already merged commits. One thing I forgot to mention: We also have the use-case of manually adding changelogs after the release when someone forgot to add their change. (or sometimes edit existing changelogs when the dev worded their change poorly) But for that we would manually open a PR and manually generate a new bundle for that changelog (and in that case the changelog would also be checked in at the same time). |
Not sure I follow these hashes would both be from an protected integration branch? You can not rewrite the history on those and therefor don't add/remove PR's?
Aye! You can create bundle amend files at any point in time: These will be also synced to S3 and amend any immutable published bundle. This can be used to add/edit/remove entries. |
Yeah I think you can never rewrite history in git. But in any case handing off two commits would be great for us. Actually even better would be one commit and it automatically detects all the PRs that have not been published so far :) |

Summary
Repos like elastic/cloud generate their shipped-PR list at release time (from a start/end commit range) and need to feed it into automated bundling. Today that isn't possible cleanly:
prsinput is option-mode only (mutually exclusive withprofile), so it can't use a profile'soutput/output_productspatterns, and PR-only option-mode bundles can't be fetched bychangelog-bundle-pr.yml.bundle-createstarts with its ownactions/checkout, which resets the workspace, so a file produced by an earlier job or step never survives into the action.This PR adds a
prs-artifactinput tobundle-createand thechangelog-bundle.ymlreusable workflow, following the artifact-handoff pattern already used across this pipeline (bundle-create→bundle-upload,bundle-fetch→bundle-pr,changelog-staging). The caller uploads a newline-delimited file of fully-qualified GitHub PR/issue URLs as a workflow artifact in the same run;bundle-createdownloads it after its checkout and passes it to docs-builder:changelog bundle <profile> <version> <file>), the CLI's supported URL-list form — so{version}/{lifecycle}substitution,output_products, and the CDN entry sourcing all keep working, andchangelog-bundle-pr.ymlcan still locate the bundle (it only needsprofile+version; verifiedPlanBundleAsyncnever resolves the filter source).--prs <file>.Guardrails:
prs-artifactis validated as an identifier and is mutually exclusive withprs,report, andrelease-version; the downloaded artifact must contain exactly one file and no symlinks; content validation (full GitHub URLs only, no PR/issue mixing) is enforced by docs-builder when the file is consumed.Docs: updated the selection table (which previously referenced a
prsmode without any example — spotted by @lcawl), added a copy-pasteablediscover-prs→bundlerecipe, an inline option-modeprsexample, and refreshed thebundle-createREADME.Test plan
pre-commit run(check-yaml, actionlint, action-readme) passes — done locallyprs.txtartifact in a discover job, callchangelog-bundle.ymlwithprofile+version+prs-artifact, confirm the bundle resolves the profile output pattern and uploads to S3prs-artifactwithprs/report/release-version