Repository navigation
ci: ask signatures only for the Key Policy Gate's own three files - #440
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
5d525e8 to
3fb4bd4
Compare
…Policy Gate to main (#423, #372, #440) ## Summary This brings two changes that landed on `1.x.x` to `main`, unchanged, and one that is open against `1.x.x`: - **#423:** Full Validation and Core Checks skip their expensive jobs for a pull request whose tree already passed. - **#372:** the signed-commit and `signed-landing` ruleset templates, the `signed-landing` workflow, first-parent release checks, and secret scans that cover merges. - **#440 (open against `1.x.x`, rebased onto it on 17 November):** the Key Policy Gate asks signed approvals only for its own three files, and the mainnet posture test pins the Core Checks gate as whole blocks. Its two commits are here as they are on #440's branch. GitHub runs `signed-landing` (`pull_request_target`) only from `main`'s copy of the workflow. Until `main` holds it, the check reports nothing on any qbit pull request, and `required-checks.json` cannot be applied to `1.x.x`, `1.0.0` and `0.1.x`. This is the step #372 named: bringing the workflow to `main` before the next release. #423 comes first because #372's posture test and documents rely on it. After this, everything under `.github/`, `ci/`, `contrib/` and `doc/` equals `1.x.x` with #440 on top; before #440's two commits, each of the 33 files #423 and #372 touch equals `1.x.x`'s copy. Nothing is left out, and nothing else from `1.x.x` comes over: the three other changes `main` lacks (#431, #432, #434: two test fixes and one in `src/script/sign.cpp`) stay off it. Every pick applied without a conflict. Merging changes no ruleset: an admin applies the templates afterwards, by `doc/development/public-branch-and-rulesets.md`. ## Testing - [ ] Built locally. - [x] Ran focused unit or functional tests for the changed area. - [x] Ran lint or formatting checks relevant to this change. - [ ] Not run. Reason: - Every Python test file under `ci/` (`ci/checks`, `ci/release`, `ci/scanners`), each run as `python3 <file>`: 20 files and 602 tests pass on `main` before; 21 files and 774 tests pass with #423 and #372; with #440's commits on top, 21 files pass again (781 tests). No test that passed before fails. - `.github/workflows/signed-landing.yml` is byte for byte the file the other Qbit-Org repositories run, apart from its two configuration lines (`AS_IS_HEADS: "sync-* subtree-*"`, `AS_IS_LINES: ""`). - The documentation, metadata and lint checks that could run without building the node pass. Not run: the subtree lint, which could not fetch its sources from the machine these checks ran on. One more actionlint finding of a class `main` already has (a YAML alias). - The node was not built and no functional test was run here: neither commit changes anything under `src/` or `test/`. CI runs them. ## Target Branch - [x] This PR targets `main` or a maintainer-requested release branch such as `0.1.x`. ## Risk / Review Notes - [x] Consensus, script, crypto, wallet, P2P, release, CI, or security-sensitive behavior changed. - [ ] No consensus, script, crypto, wallet, P2P, release, CI, or security-sensitive behavior changed. Notes: - **CI and release behaviour change on `main`**, as they did on `1.x.x` with #423 and #372: the same-tree skip in Full Validation and Core Checks; a release needs protected, first-parent trusted refs; staging refuses a tag on a pull request's head; the secret scans cover merges. - **The Key Policy Gate's own code changes** (#440): gate code becomes three files, and two of its checks run without approvals. See #440 for the review notes; it should land on `1.x.x` too, so the two branches do not drift. - **Key Policy Gate:** the check is red on this pull request, and that is expected. The gate refuses a change to workflows and files under `ci/` without approvals signed by three mainnet signers. No ruleset requires the gate yet, and the operator decided on 13 November to land the signed-landing workflow before one does, without collecting signatures. - **`signed-landing` starts reporting** on qbit pull requests once this lands. Nothing requires it until `required-checks.json` is applied. - **One sentence goes stale:** `doc/development/public-branch-and-rulesets.md` says the check reports nothing until `main` holds the workflow, "which is after the next release moves `main`". This pull request makes that happen earlier. The sentence is left as it is so that the file stays equal to `1.x.x`'s; it can be reworded on `1.x.x`. ## Docs / Process Impact Choose exactly one: - [x] I updated public docs because this PR changes user-visible behavior, integration guidance, release/process guidance, or expected validation. - [ ] No public docs update needed. Reason: The documents come over with the two changes: `CONTRIBUTING.md`, `doc/development/public-branch-and-rulesets.md`, `doc/development/ci-same-tree-skip.md`, `doc/development/developer-notes.md`, the release process documents and `doc/subtrees/libbitcoinpqc.md`. ## libbitcoinpqc Subtree Checklist (if `src/libbitcoinpqc` changed) Not applicable: `src/libbitcoinpqc` is not changed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Squashed commits: 1422396 ci: bring the same-tree CI skip and signed landing to main (#423, #372) 2bee83d ci: ask signatures only for the Key Policy Gate's own three files c130f87 test: pin the Core Checks gate's posture check as whole blocks Co-authored-by: Claude Opus 5.5 <[email protected]> Squashed-from: c130f87
## Summary Narrows what the Key Policy Gate counts as its own code, so that signed approvals from the release key quorum are needed only for the files the gate runs. Before this change, gate code was everything under `ci/release/`, `ci/checks/`, `.github/workflows/` and `.github/actions/`, every `CODEOWNERS` file, `contrib/keys/README.md` and every `.gitattributes`. 18 of the pull requests on `1.x.x` since v1.0.0 touched those paths; 3 touched a file the gate then ran. ## What changes - **Gate code is three files:** `.github/workflows/key-policy-gate.yml`, `ci/release/key_policy_gate.py` and `ci/release/validate_key_metadata.py`, plus an entry in place of one of the directories that hold them. The gate no longer loads `ci/checks/classify_merge_profile.py`; it has its own copy of the two path rules, and a contract test holds the copies to one answer. - **Two checks run by themselves, with no approvals:** - the workflow scan (no job named like the gate's check, no token that can post checks or statuses, declared permissions on a changed workflow, regular files only), whenever a pull request changes a workflow; - the refusal of content-changing attributes on the gate's three files, whenever a pull request changes any `.gitattributes`. - **Spelling:** a pull request may not add or change a path that spells `ci/release/`, `ci/checks/`, `.github/workflows/` or `.github/actions/` with other letters. The old rule counted such a path as gate code; `CODEOWNERS` does not match it. - **Submodule entries:** `git diff` now runs with `--ignore-submodules=none`. A `.gitmodules` entry with `ignore = all` could hide a submodule entry added under `contrib/keys`. This was already so before this change. - **Arming order:** the README, the runbook and the release checklist now give the code-owner team write access before the rulesets require the gate, since code-owner review is what covers the paths that no longer need signatures. ## Second commit: the posture test pins the gate as whole blocks `test_core_checks_runs_real_gate_on_release_candidate_tag` in `ci/release/test_verify_mainnet_release_posture.py` pinned lines of `core-checks.yml` that #423 changed. #372 has since brought those assertions up to date on `1.x.x`. This pull request was rebased onto that (17 November): where the two changed the same assertions, #372's are kept. What the second commit still adds: it pins the gate's side as whole blocks of the gate's own step instead of lines found anywhere in the workflow: the posture job in the gate's own `needs`; the posture check under its condition, followed by the early exit with the gate's failure status; and `check_result` and `check_job` each defined once. Before, a gate whose early exit returned 0 passed every test; with that exit weakened to `exit 0`, the test now fails. Please keep both subjects in the squash message. ## What does not change Every pull request must still contain its base branch's tip. Approvals are named and verified as before. The ruleset templates and `required-merge-gate.yml` are untouched. ## Notes for review - `Key Policy Gate (1.x.x)` will fail on this pull request: the gate on `1.x.x` today still counts `ci/checks/` and `CODEOWNERS` as its own code and asks for approvals. The check is not required by the live ruleset. - `main` keeps the earlier gate until a release brings this one there. The README says to require the gate on `main` only after that. - A pull request that changes `ci-nightly-heavy.yml` or `lint-image-prewarm.yml` is refused until it declares token permissions. The rule is not new; it now applies without approvals. A small follow-up adding permissions to those two workflows would remove the friction. - The job name in `ci-nightly-heavy.yml` on `1.1.0` (`${{ matrix.name }}` over a computed matrix) is one the scan refuses. It needs a fixed prefix before that workflow reaches `1.x.x`. - Not in this pull request: letting a pull request behind its base pass, and dropping the up-to-date requirement from the templates. Local review found wrong accepts in that part, so it was taken out. ## Testing - After the rebase onto `1.x.x` with #372 (17 November): all 21 Python test files under `ci/` pass on the first commit, and the posture test (22 tests) passes on the second, the only file it changes. - `ci/checks/test_key_policy_gate_target.py` (72 tests since the rebase; #372 added five) and `ci/checks/test_key_policy_gate_contract.py` (61 tests) pass, as do `test_classify_merge_profile.py`, `test_classifier_ci_contract.py`, `test_changed_files_contract.py`, `test/lint/lint-files.py` and `test/lint/lint-qbit-public-docs.py`. - Each new rule was weakened in turn on a copy of the gate (22 variants); at least one test fails for each. - The workflow scan passes on the real workflows of `1.x.x` and `main`. - All nine release validator test files Core Checks runs pass with the second commit. Nine weakened copies of `core-checks.yml` (early exit returning 0, `check_job` taking any skipped job, the posture job dropped from the gate's `needs`, and others) each fail the updated test. - Not run locally: the Python linters CI uses (ruff, mypy) and the rest of CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Squashed commits: 9ef5fc6 ci: ask signatures only for the Key Policy Gate's own three files 3fb4bd4 test: pin the Core Checks gate's posture check as whole blocks Co-Authored-By: Claude Fable 5.2 <[email protected]> Squashed-from: 3fb4bd4
3fb4bd4 to
88cfd82
Compare
…Policy Gate to main (#423, #372, #440) (#441) ## Summary This brings two changes that landed on `1.x.x` to `main`, unchanged, and one that is open against `1.x.x`: - **#423:** Full Validation and Core Checks skip their expensive jobs for a pull request whose tree already passed. - **#372:** the signed-commit and `signed-landing` ruleset templates, the `signed-landing` workflow, first-parent release checks, and secret scans that cover merges. - **#440 (open against `1.x.x`, rebased onto it on 17 November):** the Key Policy Gate asks signed approvals only for its own three files, and the mainnet posture test pins the Core Checks gate as whole blocks. Its two commits are here as they are on #440's branch. GitHub runs `signed-landing` (`pull_request_target`) only from `main`'s copy of the workflow. Until `main` holds it, the check reports nothing on any qbit pull request, and `required-checks.json` cannot be applied to `1.x.x`, `1.0.0` and `0.1.x`. This is the step #372 named: bringing the workflow to `main` before the next release. #423 comes first because #372's posture test and documents rely on it. After this, everything under `.github/`, `ci/`, `contrib/` and `doc/` equals `1.x.x` with #440 on top; before #440's two commits, each of the 33 files #423 and #372 touch equals `1.x.x`'s copy. Nothing is left out, and nothing else from `1.x.x` comes over: the three other changes `main` lacks (#431, #432, #434: two test fixes and one in `src/script/sign.cpp`) stay off it. Every pick applied without a conflict. Merging changes no ruleset: an admin applies the templates afterwards, by `doc/development/public-branch-and-rulesets.md`. ## Testing - [ ] Built locally. - [x] Ran focused unit or functional tests for the changed area. - [x] Ran lint or formatting checks relevant to this change. - [ ] Not run. Reason: - Every Python test file under `ci/` (`ci/checks`, `ci/release`, `ci/scanners`), each run as `python3 <file>`: 20 files and 602 tests pass on `main` before; 21 files and 774 tests pass with #423 and #372; with #440's commits on top, 21 files pass again (781 tests). No test that passed before fails. - `.github/workflows/signed-landing.yml` is byte for byte the file the other Qbit-Org repositories run, apart from its two configuration lines (`AS_IS_HEADS: "sync-* subtree-*"`, `AS_IS_LINES: ""`). - The documentation, metadata and lint checks that could run without building the node pass. Not run: the subtree lint, which could not fetch its sources from the machine these checks ran on. One more actionlint finding of a class `main` already has (a YAML alias). - The node was not built and no functional test was run here: neither commit changes anything under `src/` or `test/`. CI runs them. ## Target Branch - [x] This PR targets `main` or a maintainer-requested release branch such as `0.1.x`. ## Risk / Review Notes - [x] Consensus, script, crypto, wallet, P2P, release, CI, or security-sensitive behavior changed. - [ ] No consensus, script, crypto, wallet, P2P, release, CI, or security-sensitive behavior changed. Notes: - **CI and release behaviour change on `main`**, as they did on `1.x.x` with #423 and #372: the same-tree skip in Full Validation and Core Checks; a release needs protected, first-parent trusted refs; staging refuses a tag on a pull request's head; the secret scans cover merges. - **The Key Policy Gate's own code changes** (#440): gate code becomes three files, and two of its checks run without approvals. See #440 for the review notes; it should land on `1.x.x` too, so the two branches do not drift. - **Key Policy Gate:** the check is red on this pull request, and that is expected. The gate refuses a change to workflows and files under `ci/` without approvals signed by three mainnet signers. No ruleset requires the gate yet, and the operator decided on 13 November to land the signed-landing workflow before one does, without collecting signatures. - **`signed-landing` starts reporting** on qbit pull requests once this lands. Nothing requires it until `required-checks.json` is applied. - **One sentence goes stale:** `doc/development/public-branch-and-rulesets.md` says the check reports nothing until `main` holds the workflow, "which is after the next release moves `main`". This pull request makes that happen earlier. The sentence is left as it is so that the file stays equal to `1.x.x`'s; it can be reworded on `1.x.x`. ## Docs / Process Impact Choose exactly one: - [x] I updated public docs because this PR changes user-visible behavior, integration guidance, release/process guidance, or expected validation. - [ ] No public docs update needed. Reason: The documents come over with the two changes: `CONTRIBUTING.md`, `doc/development/public-branch-and-rulesets.md`, `doc/development/ci-same-tree-skip.md`, `doc/development/developer-notes.md`, the release process documents and `doc/subtrees/libbitcoinpqc.md`. ## libbitcoinpqc Subtree Checklist (if `src/libbitcoinpqc` changed) Not applicable: `src/libbitcoinpqc` is not changed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Squashed commits: 1422396 ci: bring the same-tree CI skip and signed landing to main (#423, #372) 2bee83d ci: ask signatures only for the Key Policy Gate's own three files c130f87 test: pin the Core Checks gate's posture check as whole blocks Squashed-from: c130f87 Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
Narrows what the Key Policy Gate counts as its own code, so that signed approvals from the release key quorum are needed only for the files the gate runs.
Before this change, gate code was everything under
ci/release/,ci/checks/,.github/workflows/and.github/actions/, everyCODEOWNERSfile,contrib/keys/README.mdand every.gitattributes. 18 of the pull requests on1.x.xsince v1.0.0 touched those paths; 3 touched a file the gate then ran.What changes
.github/workflows/key-policy-gate.yml,ci/release/key_policy_gate.pyandci/release/validate_key_metadata.py, plus an entry in place of one of the directories that hold them. The gate no longer loadsci/checks/classify_merge_profile.py; it has its own copy of the two path rules, and a contract test holds the copies to one answer..gitattributes.ci/release/,ci/checks/,.github/workflows/or.github/actions/with other letters. The old rule counted such a path as gate code;CODEOWNERSdoes not match it.git diffnow runs with--ignore-submodules=none. A.gitmodulesentry withignore = allcould hide a submodule entry added undercontrib/keys. This was already so before this change.Second commit: the posture test pins the gate as whole blocks
test_core_checks_runs_real_gate_on_release_candidate_taginci/release/test_verify_mainnet_release_posture.pypinned lines ofcore-checks.ymlthat #423 changed. #372 has since brought those assertions up to date on1.x.x. This pull request was rebased onto that (17 November): where the two changed the same assertions, #372's are kept.What the second commit still adds: it pins the gate's side as whole blocks of the gate's own step instead of lines found anywhere in the workflow: the posture job in the gate's own
needs; the posture check under its condition, followed by the early exit with the gate's failure status; andcheck_resultandcheck_jobeach defined once. Before, a gate whose early exit returned 0 passed every test; with that exit weakened toexit 0, the test now fails.Please keep both subjects in the squash message.
What does not change
Every pull request must still contain its base branch's tip. Approvals are named and verified as before. The ruleset templates and
required-merge-gate.ymlare untouched.Notes for review
Key Policy Gate (1.x.x)will fail on this pull request: the gate on1.x.xtoday still countsci/checks/andCODEOWNERSas its own code and asks for approvals. The check is not required by the live ruleset.mainkeeps the earlier gate until a release brings this one there. The README says to require the gate onmainonly after that.ci-nightly-heavy.ymlorlint-image-prewarm.ymlis refused until it declares token permissions. The rule is not new; it now applies without approvals. A small follow-up adding permissions to those two workflows would remove the friction.ci-nightly-heavy.ymlon1.1.0(${{ matrix.name }}over a computed matrix) is one the scan refuses. It needs a fixed prefix before that workflow reaches1.x.x.Testing
1.x.xwith ci: require signed commits and the signed-landing check, with first-parent release checks #372 (17 November): all 21 Python test files underci/pass on the first commit, and the posture test (22 tests) passes on the second, the only file it changes.ci/checks/test_key_policy_gate_target.py(72 tests since the rebase; ci: require signed commits and the signed-landing check, with first-parent release checks #372 added five) andci/checks/test_key_policy_gate_contract.py(61 tests) pass, as dotest_classify_merge_profile.py,test_classifier_ci_contract.py,test_changed_files_contract.py,test/lint/lint-files.pyandtest/lint/lint-qbit-public-docs.py.1.x.xandmain.core-checks.yml(early exit returning 0,check_jobtaking any skipped job, the posture job dropped from the gate'sneeds, and others) each fail the updated test.🤖 Generated with Claude Code