Repository navigation
ci: validate PR milestones using branch status issue - #7527
Conversation
- Read the next release version from a persistent GitHub issue - Replace VERSION file dependency with branch-specific version tracking - Keep milestone validation aligned with moby Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
Dismissed security findings (review manually)
- .github/workflows/validate-milestone.yml:81 —
baseBranchembedded viaaddRaw()without HTML escaping (verifier mitigation: Git branch names cannot contain<or>, making XSS via this vector not exploitable in practice)
| ? context.payload.pull_request.head.sha | ||
| : context.payload.pull_request.base.ref; | ||
| const lines = (issue.body ?? '').split('\n').map(line => line.trimEnd()); | ||
| const start = lines.indexOf('```json docker-versions') + 1; |
There was a problem hiding this comment.
[low] Opening-fence match requires exact line; leading whitespace causes a false "not found" failure
lines.indexOf('```json docker-versions') performs an exact string comparison. The .trimEnd() applied on the previous line strips only trailing whitespace, not leading spaces. If the opening code-fence in the branch-status issue body has any leading whitespace (e.g., indented inside a list or blockquote), indexOf returns -1, start becomes 0, and the guard on line 42 fires with:
Could not find a 'json docker-versions block' in issue #7526
This is not a silent failure — the error is surfaced — but it can be confusing to debug because the message implies the block is missing, not misindented. Consider using a leading-whitespace-tolerant match:
| const start = lines.indexOf('```json docker-versions') + 1; | |
| const lines = (issue.body ?? '').split('\n').map(line => line.trimEnd()); | |
| const start = lines.findIndex(l => l.trim() === '```json docker-versions') + 1; |
| Confidence | Score |
|---|---|
| 🟢 strong | 100/100 |
There was a problem hiding this comment.
I kept it identical to the workflow in moby/moby. We can probably improve, although it's expected for the ticket to have a somewhat strict format.
There was a problem hiding this comment.
Fair point — keeping the workflows synchronized makes sense, especially since both issues currently use the strict format without leading whitespace. The suggestion would only add value if the format becomes more flexible in the future (e.g., nesting the block in a list), but that's not the case now.
Feel free to close this or keep it as a reference if the format ever needs to evolve across both repos.
| : context.payload.pull_request.base.ref; | ||
| const lines = (issue.body ?? '').split('\n').map(line => line.trimEnd()); | ||
| const start = lines.indexOf('```json docker-versions') + 1; | ||
| const end = lines.indexOf('```', start); |
There was a problem hiding this comment.
[low] Closing-fence search matches any standalone triple-backtick line within the JSON block
lines.indexOf('```', start) finds the first line (after trimEnd()) that is exactly three backticks, starting from the opening fence. If the JSON content between the fences ever contains a line that is only \``— for example if someone edits the issue body and adds a stray markdown fence — the JSON slice will be truncated at that line, causingJSON.parse` to throw with a confusing "Invalid json docker-versions block" error.
In practice valid JSON cannot naturally contain such a line (all strings must be quoted), so this is a theoretical fragility rather than an immediately exploitable bug. It is worth noting as a future robustness concern, especially since the issue body is a human-editable document.
| Confidence | Score |
|---|---|
| 🟡 moderate | 70/100 |
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
Lower-confidence findings (not posted inline)
- [low] .github/workflows/validate-milestone.yml:17 —
github.event.pull_request.state == 'open'condition is always true forpull_requestevents (not verified; low severity)
ci: validate PR milestones using branch status issue - #7527
Summary
Release notes (optional)
A picture of a cute animal (not mandatory but encouraged)