Repository navigation
ci: call core's pr-triage workflow and move the risk list to levels (v2) - #252
Conversation
The caller now pins frostyard/core/.github/workflows/pr-triage.yml at c996ea3 (core#225): it adds a level label and risk:high for L1 and L2, and removes ready-for-human when the head moves (core ADR-0077, ADR-0078). .github/risk-paths.json moves to schema version 2 by ADR-0078's grading rule (governance entries L2, the others L1, default L3). scripts/lib/risk-paths.mjs is copied again from core c996ea3 with its pin, and the template gate checks rule C through checkRequiredPaths, so a list or caller glob at L3 or L4 fails (core docs/specs/risk-paths.md, C).
The caller now runs core's pr-triage.yml: it adds a level label and risk:high for L1 and L2, and removes ready-for-human when the head moves (core ADR-0077, ADR-0078). docs/org-adrs.md lists core ADR-0076 to ADR-0078.
scripts/check-template.mjs and its test now match the template's change at 712c29a: the list must be schema version 2 and the caller must run core's pr-triage.yml at a full SHA in the job pr-triage, besides rule C.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Cross-review: |
Summary
This pull request moves frostyard/pilothouse to frostyard/core's PR triage workflow, as the owner wave of core ADR-0076, ADR-0077 and ADR-0078 asks (background: core#218).
.github/workflows/risk-paths.yml(workflow name nowPR triage, jobpr-triage) callsfrostyard/core/.github/workflows/pr-triage.ymlatc996ea3fb54bcf1a3c621113522213702a7673e2(core#225). On each pull request it adds 1 labellevel:L1tolevel:L4andrisk:highfor L1 and L2 (ADR-0078), removesready-for-humanwhen the head moves after the label or when the label comes while CI is not green (ADR-0077), and writes a shadow comment on patch and minor Dependabot updates (it never merges). Thelabeledtrigger is new; the file keeps its name..github/risk-paths.jsonmoves to schema version 2:default_levelL3,governance:entries L2, all other entries L1. No glob is removed.scripts/lib/risk-paths.mjsis copied again from core at c996ea3 and pinned inscripts/check-template.mjs.scripts/check-template.mjsandtest/check-template.test.mjstake the change of bketelsen/agentic-template#9 at 712c29a: the list must be version 2, the caller must call core'spr-triage.ymlat a full SHA in the jobpr-triage, and the list and the caller globs must be L1 or L2 (rule C of core's risk-paths spec). The template pull request is still open; if it changes before it merges, a later copy takes the merged version.AGENTS.md(Security and risk paths),docs/design/agent-workflows.md,docs/quality.mdanddocs/org-adrs.mddescribe the levels, thePR triagecaller and head-bound readiness, and list core ADR-0076, ADR-0077 and ADR-0078. The rules stay: never removerisk:high(or a level label) to make a pull request ready, and name each matched path in the body.Lint,Security Scan,Unit Tests,Race Detection,Verifyand bothBuildjobs already run on every pull request with no path filter and no secret.packaging.yml,image-tierandvm-bootstay out of the required checks.whytexts started with words that are not categories of core's risk-paths spec, rule B (which v2 checks for L1 and L2 entries). They now start with spec categories:supply chain:toupdate verification:(mise.toml,mise.lock),release:topublication:(.svu.yml,.goreleaser.yaml,scripts/bump.sh), andinstall:/privileged:/security:toauth:(packaging/**,cmd/pilothoused/**,internal/broker/**,internal/auth/**). The globs do not change, and all 9 stay at L1.The required status check names for this repository go on frostyard/core#222 (ADR-0076) after this pull request's CI is green. Until an admin creates the level labels, the caller adds only
risk:highand writes a warning (ADR-0078).Risk tier
docs/risk-tiers.md.pull_request_targetworkflow that holdspull-requests: write, and the risk-path list that guards the root broker, PAM auth, packaging and release paths; a safeguard takes the tier of what it protects, andrisk:highapplies.permissions: {}, the job keepscontents: readandpull-requests: write, as before). Threat:pull_request_targetruns the base caller and the base list; core's reusable workflow checks out nothing and runs no PR code, so a PR cannot change its own level or labels. It cannot approve or merge. Every Tier 4 path stays in the list at L1, so it still getsrisk:high. Rollback: revert this pull request; the old caller pin in git history works unchanged.Matched risk paths (list at the base) and why each change is safe
.github/risk-paths.json.github/risk-paths.json(governance: the high-risk path list)default_levelL3, eachgovernance:entry L2, every other entry L1. No glob is removed and none is looser than L2, so each path that getsrisk:hightoday still gets it..github/workflows/risk-paths.yml.github/workflows/**(governance: CI, the risk-paths caller and token permissions)pull_request_target, pluslabeled),permissions: {}at the top, the job keepscontents: readandpull-requests: writeonly. It calls core'spr-triage.ymlat the full SHAc996ea3(core#225); the reusable workflow checks out nothing and runs no code from the PR. It is not a required check.scripts/check-template.mjsscripts/check-template.mjs(governance: the template verification gate)risk-paths.mjscopy and adds checks (list at schema version 2, caller pin and job name, rule C levels). It only makes the gate stricter.scripts/lib/risk-paths.mjsscripts/lib/**(governance: the vendored risk-path validator and matcher)scripts/lib/risk-paths.mjsat c996ea3 (sha2566df0af00…cdfa43, pinned inscripts/check-template.mjs). The old exports keep their v1 results.Verification
make verify(umask 022): the template gate (33 Node tests), tidy, vet, format, golangci-lint (0 issues), govulncheck andgo test ./...pass. Thesdjournaltag build fails on this host only: it has nosystemd/sd-journal.h(unchanged by this pull request); CI builds it.scripts/check-template.mjsfrommain(itsrisk-paths.mjspin moved to c996ea3 only), thennode --test test/check-template.test.mjsfails 4 tests on their assertions:caller glob at level L3 exits 1,caller that renames the job exits 1,caller that still pins core's risk-paths workflow exits 1,risk-path list of schema version 1 exits 1.