Repository navigation
Conversation
The entry path was interpolated into a contents URL, so the '#' in the PR#<n>- and GITHUB#<n>- naming convention was read as a fragment delimiter and the request truncated to the directory, failing with a 404. Use the contents_url from the files listing, which is URL-encoded and already pinned to the head commit, and refuse anything that is not a contents URL for this repository.
|
Automated PR triage (LLM-generated; may be wrong). Checked once, when the PR was opened or marked ready; not updated on later pushes. No clear mismatches in the answered judgements.
|
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the changelog validation update supporting filenames containing #.
No open issues 🎉
What changed in this PR
Fixes changelog validation for entry filenames containing #, including the repository’s PR#<n>- and GITHUB#<n>- conventions.
Changes:
- Fetches entries using GitHub’s URL-encoded, commit-pinned
contents_urlinstead of constructing URLs from filenames. - Rejects URLs outside this repository’s GitHub contents endpoint and removes the unused
HEAD_SHAvariable.
| File | Description |
|---|---|
.github/workflows/validate-changelog.yml |
Carries contents URLs through entry selection and validates them before fetching changelog files. |
Review effort: Balanced
Description
Check changelog entryfails withgh: Not Found (HTTP 404)whenever an entry filename contains#, which is our ownPR#<n>-/GITHUB#<n>-convention. The path is interpolated straight into a contents URL, so#is read as a fragment delimiter and the request truncates to the directory.Open PRs hitting this:
PR#5049-docs-site-styling.yml, currently redtk:chunksinto adense_vectorfield #4863 —PR#4853-update-org-apache-tika-tika-core.ymlPR#4765-improve-java-version-parsing.ymlThe latter two last ran the check before the raw-fetch step landed in #5099, so they fail on their next push rather than right now.
Solution
Fetch each entry by the
contents_urlalready returned in thepulls/{n}/fileslisting. It is URL-encoded and pinned to the head commit, so nothing PR-authored goes into the URL, every other character needing escaping is covered too, andHEAD_SHAis no longer needed. The loop rejects any URL that is not a contents URL for this repository, sincegh apisends the job's token to whatever host it is given.Tests
Ran both workflow steps verbatim against the three PRs above. Each
#entry 404s on the old URL and fetches on the new one;validate-changelog-yaml.pythen exits 0. Also checked that a PR with no entry still short-circuits, that an ordinarySOLR-…filename is unaffected, and that the URL guard rejects a foreign host.bash -npasses on bothrunblocks.No changelog entry, matching the previous fixes to this workflow (#5099, #4941).
AI Assisted: written with Claude Code, reviewed and tested by me.