Repository navigation
feat: sort pull requests by levels L1 to L4 (ADR-0078) - #223
Merged
Merged
Conversation
Risk-paths list schema version 2 gives each glob a level and the list a default level; org floors in scripts/lib/risk-paths.mjs put key, secret and signing paths at L1 and workflows, policies and the list at L2. The levels step of pr-triage.yml adds level:L1 to level:L4 by a ratchet and keeps risk:high as the alias of L1 and L2. Version 1 lists stay valid and read as each glob at L1 with default L3. Core's own list moves to version 2. Amends ADR-0068 in part.
Contributor
Author
|
Cross-review: Ready, blocking: none.
|
bketelsen
previously approved these changes
Nov 9, 2026
|
|
bketelsen
approved these changes
Nov 9, 2026
2 tasks done
bketelsen
pushed a commit
that referenced
this pull request
Nov 9, 2026
…at L1 (#224) * fix: put scripts/apply-triage-settings.sh back in the risk-path list at L1 The squash merge of #223 rewrote .github/risk-paths.json to schema version 2 and dropped the entry that #221 added, so the script that applies the required-checks ruleset and the level labels fell to the default L3. The entry comes back at L1 (rulesets and settings, risk-paths spec rule H). A test now names each settings script at L1, and a corrections line records the lesson. * test: name the settings-script guard for the administrative scripts it covers --------- Co-authored-by: frostyard-machines <[email protected]>
This was referenced Nov 9, 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
risk:highis binary: a PR that matches a risk glob gets it, every other PR gets nothing. The owner merges about 70 PRs a day, and the label does not say how much of the rest to read. This PR gives every PR 1 labellevel:L1(read every line) tolevel:L4(title and CI), so the merge list can be sorted (ADR-0078, new, amends ADR-0068 in part). Idea from Airlock's levels and repository policy. Builds on #220 (thepr-triage.ymlworkflow).docs/specs/risk-paths.md):default_leveland alevelper glob. A version 1 list stays valid and reads as each glob at L1, default L3, so an unmoved repository has at L1 every PR that hasrisk:hightoday.scripts/lib/risk-paths.mjs): new exportsLEVELS,ORG_FLOORS,levelOfFile,levelOfPullRequest,checkRequiredPaths, andlistIssueLabelsin the API client. A file takes the strictest matching glob, else the default, then the org floor when stricter. A PR takes the strictest file (both names of a rename); 0 files: default; 3000 files: L1.secret(s),credential(s),password(s),passwd,signing,keyring(s),keys,gpg,pgpand extensionspem,key,p12,pfx,gpg,asc; L2 for.github/workflows/**,.github/actions/**,.github/risk-paths.json,policies/**,.github/policies/**. Every change to the list is therefore at least L2.validateRiskPaths,matchGlob,parseStrictJson,matchFileskeep names and version 1 results. A test holds 22 version 1 fixtures with the exact{ ok, errors }of the library before this PR. Only lists whoseschema_versionis not 1 get a new message (must be the integer 1 or 2).levelsstep (runLevelsStepinscripts/lib/pr-triage.mjs, replacingrunRiskPathsJob): ratchet (adds the computed level when the PR has none or a looser one, then removes looser level labels; never lowers),risk:highalias at L1 and L2 (never removed), missing level labels: adds onlyrisk:highand writes a warning with the settings command, does not fail and creates no label. A missingrisk:highstill fails. Summary table: 1 row per L1 or L2 path with its glob or floor.scripts/check-risk-paths.mjsthroughcheckRequiredPaths): in version 2, each glob that matches the list or the caller is L1 or L2.docs/org-adrs.md,AGENTS.md, index, and the link-only "Amended in part by" line in ADR-0068.Not in this PR: core's list entry for
scripts/apply-triage-settings.sh(at L1) comes when #221 adds that script; the level labels are created by that script, so until then core's PRs getrisk:highand a warning.Risk tier
Risk tier: 3 — highest. The PR touches these paths of the base
.github/risk-paths.json:.github/risk-paths.json: schema version 2; levels added; 2whytexts updated; no glob removed. Each glob stays L1 or L2, sorisk:highkeeps every PR it had..github/workflows/pr-triage.yml: step renamed, header comments, and the 2 embedded copies re-synced (npm run check:risk-paths: in sync). Noif:, permission, action or trigger change..github/workflows/risk-paths-caller.yml: comment only.scripts/lib/risk-paths.mjs: v2 validation, levels, floors,checkRequiredPaths, 1 read-only API method; the labeling job moves topr-triage.mjs. Vendored callers use only the kept exports.scripts/lib/pr-triage.mjs: the new levels step. It addslevel:*andrisk:highand removes only looserlevel:*labels; it never removesrisk:high, never creates a label, approves or merges.scripts/check-risk-paths.mjs: rule C throughcheckRequiredPaths, same "no glob matches" text for version 1.Under
pull_request_target, core's local caller resolves to the base branch, so this PR's run uses the old step; the new step runs on core PRs after merge.Docs housekeeping
TEMPLATE.mddocs/README.mdVerification
npm run verify: docs, organization, scripts, corrections, risk-paths ("workflow in sync"), 540 tests, 0 failures (3 runs in a row)node scripts/check-docs.mjsgreen (106 docs)actionlintclean; no action, permission or trigger changerisk-paths.mjsvalidates core's v2 list and givesREADME.mdL3,scripts/sync-skills.shL1,.github/workflows/ci.ymlL2,docs/adr/x.mdL3