Repository navigation
ci: label the bot version PR at creation with its risk level - #17
Merged
Merged
Conversation
A PR that GITHUB_TOKEN opens starts no pull_request_target run, so the PR triage caller never adds the level label or risk:high to the version PR (frostyard/core#233). The create-pull-request step now limits the commit to download/checksums.json with add-paths and sets level:L1 and risk:high, the level of that file in .github/risk-paths.json (core docs/specs/pr-triage.md). tests/check-baseline.sh computes the level of the add-paths from the list and core's org floors and fails when the labels differ; the negative tests in tests/check-baseline-test.sh cover each failure.
Rule D of core docs/specs/risk-paths.md gives a path the strictest level of its matching globs and uses default_level only when no glob matches. The bot labels check started from default_level, so a matching L4 entry under an L3 default read as L3. New cases cover an L4 entry with L4 and L3 labels and an add-path that no glob matches.
Contributor
Author
|
Cross-review record
|
bketelsen
approved these changes
Nov 11, 2026
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.
Summary
The weekly
Check Upstream Versionsworkflow opens its upstream bump PR withpeter-evans/create-pull-requestandGITHUB_TOKEN. GitHub starts nopull_request_targetrun for a PR thatGITHUB_TOKENopens, so the PR triage caller never runs and the PR gets nolevel:L*label and norisk:high, though it changes an L1 path (frostyard/core#233; seen on frostyard/bootc-debian#24).This PR labels the bot PR at creation:
.github/workflows/check-dependencies.yml: thecreate-pull-requeststep getsadd-paths: download/checksums.json(the only file the bot writes, so the PR content does not change) andlabels: level:L1, risk:high.download/**is L1 in.github/risk-paths.json, and L1 takesrisk:high(pr-triage spec).tests/check-baseline.sh, new section "B12 bot labels": reads theadd-pathsandlabelsinputs of the singlecreate-pull-requeststep (plain value or literal|block; block scalars such as the PR body and comments are skipped), computes the level of the add-paths from.github/risk-paths.jsonwith core's matcher port and the org floors (risk-paths spec rules D and G), and fails when thelevel:*/risk:highlabels differ from that level. A missing input, a glob or non-file add-path, an expression, a quoted, folded or flow value, or a secondcreate-pull-requeststep also fails.tests/check-baseline-test.sh: 11 failing and 2 passing cases for the new section.AGENTS.md: 1 rule;.memory/corrections.jsonl: 1 line.This is a per-repository mitigation. A fleet-wide fix (a GitHub App or machine token for bot PRs, or a scheduled triage sweep) is not decided; see frostyard/core#233.
Risk tier
Risk tier: 3 — touches
.github/workflows/**(L1) andtests/**(L2).Matched risk paths and why the change is safe:
.github/workflows/check-dependencies.yml(.github/workflows/**, L1, publication): adds 2 inputs to thecreate-pull-requeststep and a comment. No permission, token, trigger, action pin or other step changes.add-pathslimits the commit todownload/checksums.json, which the bot already writes as its only change (it writestmp.jsonand moves it over that file).labelsonly adds labels; the job already haspull-requests: write, and the labels exist in the repository.tests/check-baseline.sh,tests/check-baseline-test.sh(tests/**, L2, governance): a new check and its negative tests. Every earlier check is unchanged.Verification
make verifygreenmake cigreen: all baseline cases ok,ok - baseline: ... bot labels level:L1,tests/run.shall tests passedgit checkout HEAD~1 -- .github/workflows/check-dependencies.yml && tests/check-baseline.shexits 1 withnot ok - the create-pull-request step has no add-paths input; with only the 3labelslines removed it exits 1 withnot ok - the create-pull-request step has no labels input.# vX.Y.Z,permissions: {}, andpersist-credentials: false(unchanged)Not checked: a real bot run on GitHub. The next scheduled run (Monday 08:00 UTC) or a manual run of the workflow shows the labels on the bot PR.