Repository navigation
ci: validate maintained source in scheduled heavy workflows - #165
Conversation
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 88c08aa7fc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
Scheduled runs of the nightly CI, IBD perf and RPC perf workflows checked out the retired 0.1.x branch even though the workflow file runs from the default branch, and each job repeated its own ref selection. Each workflow now begins with an inline resolve-source job that resolves the maintained 1.x.x branch to an immutable commit with git ls-remote before any checkout or repository-local action. A manual dispatch keeps its selected ref and event commit. Every source job depends on that job, refuses to check out anything but the resolved commit, verifies the actual HEAD after the checkout, and reports the requested ref, resolved commit, actual HEAD and workflow revision separately in the step summary and benchmark metadata. Concurrency groups and run names follow the same selection. The scanner keeps its HEAD-derived source commit and its independent origin/main comparison base. ci/checks/test_scheduled_validation_contract.py executes the real resolver, guard, verify and metadata step scripts against temporary Git repositories whose default-branch, maintained-branch and manual-selection commits differ, evaluates the checkout wiring under scheduled and manual contexts, and covers resolver input rejection and checked-out HEAD mismatches. The workflow YAML is loaded with YAML 1.2 booleans so the on trigger key stays a string.
… job Only the native fuzz entry of the nightly matrix sets QBIT_FUZZ_MUTATE_MIN_TIME=60; every other matrix entry, the scanner job and the perf workflows leave it empty. The workflow only carries the request: ci/test/03_test_script.sh must read the variable to add the second test/fuzz/test_runner.py invocation with --require_qbit_corpus --mutate_min_time=60 on the six fixed qbit corpus targets, and ci/test/00_setup_env_native_fuzz.sh must export it so the container env file forwards it. Both live in the runner interface change this depends on and must land together with it. The contract test evaluates the nightly job environment for every matrix entry so the value cannot move to or spread beyond the native fuzz entry.
324bb8c to
ac8e8a9
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
The gate's `wait_for_checks` loop turned infrastructure noise into a red required check. Each poll assigned the result of one `gh api` call with no error handling, so a single failed call ended the step under errexit: #165 and #159 both failed two seconds apart on unrelated commits with `unexpected end of JSON input` while the checks they waited for were green. An empty result was indistinguishable from "the check has not appeared yet", and the wait budget (720 attempts x 30s of sleeping) equalled the job's 360-minute timeout, so the loop's own timeout message was unreachable: #162 was cancelled at the six-hour cap thirteen minutes before Full Validation succeeded on the same commit. Split the poll into a query and a verdict. `query_check_run` performs the check-runs query with a per-call timeout and retries it up to GATE_QUERY_MAX_ATTEMPTS times with capped exponential backoff, logging each failure and its reason. A non-zero exit, an empty or truncated body, a page without a `check_runs` array, or a run without a usable status are all query failures, never observations. It reports either "absent" (the query succeeded and no run has that name) or the selected run's status and conclusion, so the caller can tell "check not there yet" from "could not read the check runs at all". `wait_for_checks` keeps a single wall-clock deadline for the whole wait, so time spent inside API calls counts against the budget and not only the sleeps. It fails under three distinct titles: a check concluded something other than success, the check runs could not be read after the bounded retries (fail closed, no verdict), or the deadline passed with checks still pending - and that message now names the checks that were pending. The budget is 19800s against the job's 360-minute cap, which is the maximum a GitHub-hosted job can be given and therefore cannot be raised; the 30 minutes of headroom is what makes the timeout message reachable. The query now paginates. `per_page=100` alone silently hid any required check beyond the first hundred check runs on a commit. Selection is unchanged: the newest run by `started_at`, falling back to `created_at`, so a re-run supersedes its earlier attempt. The polling logic stays in the workflow so it has one definition. ci/checks/test_merge_gate_poller.py lifts the gate step's real `run:` script out of the workflow and executes it against a stubbed `gh` that scripts exit codes, bodies and latency per call, with the loop's waiting tunables overridden so the suite runs in seconds while the production defaults stay the values CI uses. It runs in `classify-changes`, a job the gate depends on, next to the classifier contract. The classifier contract's simulated API now returns a check-runs page instead of a pre-selected tab-separated pair, because the gate applies its own selection filter to the response body. Refs #169 Co-authored-by: Claude Opus 5 <[email protected]>
Resolve .github/workflows/ibd-perf-manual.yml against the scheduled validation work (#165): the ibd-perf job keeps the resolved-source checkout, guard and verification exactly as the base has them, and keeps this branch's path-scoped checkout of workflow support at the workflow revision after the source is verified, so the lane helper never skews from the workflow that sources it. Adapt the two contract tests to the combined layout. The scheduled validation contract counts only the checkout that populates the workspace root as the source checkout; any other checkout must stay inside the workspace, be at the workflow commit and come after the verify step, and three mutations enforce that. Its fixture seeds the lane helper and models the support checkout so the metadata step can source it, and the metadata test requires workflow_support_commit to be the workflow commit. The wiring test now expects the resolved-sha checkout instead of the retired CHECKOUT_REF expression. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The gate's `wait_for_checks` loop turned infrastructure noise into a red required check. Each poll assigned the result of one `gh api` call with no error handling, so a single failed call ended the step under errexit: #165 and #159 both failed two seconds apart on unrelated commits with `unexpected end of JSON input` while the checks they waited for were green. An empty result was indistinguishable from "the check has not appeared yet", and the wait budget (720 attempts x 30s of sleeping) equalled the job's 360-minute timeout, so the loop's own timeout message was unreachable: #162 was cancelled at the six-hour cap thirteen minutes before Full Validation succeeded on the same commit. Split the poll into a query and a verdict. `query_check_run` performs the check-runs query with a per-call timeout and retries it up to GATE_QUERY_MAX_ATTEMPTS times with capped exponential backoff, logging each failure and its reason. A non-zero exit, an empty or truncated body, a page without a `check_runs` array, or a run without a usable status are all query failures, never observations. It reports either "absent" (the query succeeded and no run has that name) or the selected run's status and conclusion, so the caller can tell "check not there yet" from "could not read the check runs at all". `wait_for_checks` keeps a single wall-clock deadline for the whole wait, so time spent inside API calls counts against the budget and not only the sleeps. It fails under three distinct titles: a check concluded something other than success, the check runs could not be read after the bounded retries (fail closed, no verdict), or the deadline passed with checks still pending - and that message now names the checks that were pending. The budget is 19800s against the job's 360-minute cap, which is the maximum a GitHub-hosted job can be given and therefore cannot be raised; the 30 minutes of headroom is what makes the timeout message reachable. The query now paginates. `per_page=100` alone silently hid any required check beyond the first hundred check runs on a commit. Selection is unchanged: the newest run by `started_at`, falling back to `created_at`, so a re-run supersedes its earlier attempt. The polling logic stays in the workflow so it has one definition. ci/checks/test_merge_gate_poller.py lifts the gate step's real `run:` script out of the workflow and executes it against a stubbed `gh` that scripts exit codes, bodies and latency per call, with the loop's waiting tunables overridden so the suite runs in seconds while the production defaults stay the values CI uses. It runs in `classify-changes`, a job the gate depends on, next to the classifier contract. The classifier contract's simulated API now returns a check-runs page instead of a pre-selected tab-separated pair, because the gate applies its own selection filter to the response body. Refs #169 Co-authored-by: Claude Opus 5 <[email protected]>
* ci: resolve the scheduled validation source once per run Scheduled runs of the nightly CI, IBD perf and RPC perf workflows checked out the retired 0.1.x branch even though the workflow file runs from the default branch, and each job repeated its own ref selection. Each workflow now begins with an inline resolve-source job that resolves the maintained 1.x.x branch to an immutable commit with git ls-remote before any checkout or repository-local action. A manual dispatch keeps its selected ref and event commit. Every source job depends on that job, refuses to check out anything but the resolved commit, verifies the actual HEAD after the checkout, and reports the requested ref, resolved commit, actual HEAD and workflow revision separately in the step summary and benchmark metadata. Concurrency groups and run names follow the same selection. The scanner keeps its HEAD-derived source commit and its independent origin/main comparison base. ci/checks/test_scheduled_validation_contract.py executes the real resolver, guard, verify and metadata step scripts against temporary Git repositories whose default-branch, maintained-branch and manual-selection commits differ, evaluates the checkout wiring under scheduled and manual contexts, and covers resolver input rejection and checked-out HEAD mismatches. The workflow YAML is loaded with YAML 1.2 booleans so the on trigger key stays a string. * ci: request the nightly seeded fuzz mutation phase on the native fuzz job Only the native fuzz entry of the nightly matrix sets QBIT_FUZZ_MUTATE_MIN_TIME=60; every other matrix entry, the scanner job and the perf workflows leave it empty. The workflow only carries the request: ci/test/03_test_script.sh must read the variable to add the second test/fuzz/test_runner.py invocation with --require_qbit_corpus --mutate_min_time=60 on the six fixed qbit corpus targets, and ci/test/00_setup_env_native_fuzz.sh must export it so the container env file forwards it. Both live in the runner interface change this depends on and must land together with it. The contract test evaluates the nightly job environment for every matrix entry so the value cannot move to or spread beyond the native fuzz entry. * ci: allow 120 seconds for nightly seeded mutation
## Summary This lands the v1.0.1 release branch on `main` as one commit, the same way `main` received v1.0.0 in #135. The `v1.0.1` tag will then be created on the resulting `main` commit. - **Source:** release branch `1.x.x` at `a7a70660ad6ecadbf77b89bc2fe85ba068a86a71`, this PR's head before the signed squash. `main` (`70fea84f5b`) is an ancestor of that commit, so the squash has exactly its tree: `35a01d570ceef5984ae84e15d4dc74adecb587be`. - **Signing:** the release coordinator squashes the head into one commit and signs it with `squash-sign`. The tree does not change. - **Rebuilt head:** this branch replays the 75 commits of `1.x.x` since `main` (`70fea84f5b..a7a7066`) with their trees, messages and authors unchanged, so their SHAs differ from `1.x.x`'s. The one change: #268 (`e374ba24cf`) is split into its pure libbitcoinpqc v0.3.2 import, which carries the subtree's directory and split (`1965d0da1e`) trailers, and the rest of #268. That way the squash keeps the subtree trailer that `test/lint/libbitcoinpqc-subtree-check.sh` needs on `main`. Without it, the check would find v0.1.1's split `ac72d1ffa0` and fail. The final tree is still `35a01d570ceef5984ae84e15d4dc74adecb587be`. ## Validation of this tree (on `a7a70660ad`) - Full Validation [43271045040](https://github.com/Qbit-Org/qbit/actions/runs/43271045040): passed. - Required Merge Gate [43271044819](https://github.com/Qbit-Org/qbit/actions/runs/43271044819): passed. - Core Checks [43271044808](https://github.com/Qbit-Org/qbit/actions/runs/43271044808), including the `mainnet publication posture` job: passed. - Nightly CI [43273463067](https://github.com/Qbit-Org/qbit/actions/runs/43273463067): dispatched on this commit. Its scanner results are triaged, and one job is being re-run after a runner infrastructure failure. - The release notes are `doc/release-notes-1.0.1.md`, from #181. The freeze and the changes since v1.0.0 are tracked in #174. ## Review Please review the release as a whole against `v1.0.0` (`git diff v1.0.0 a7a7066`), or through the individual `1.x.x` PRs listed in #174 and the release notes. This PR adds nothing beyond `1.x.x` at `a7a70660ad`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Squashed commits: 5aa60b3 fix: resolve finalized mainnet CI failures (#137) b83f87d wallet: avoid deferred keypool unlock deadlock (#143) 0716a7c qt: move PSBT signing off GUI thread (#145) 141a9de Build versioned RPC docs pages (#148) 73c064a test: stabilize REST chaininfo comparison (#149) 508c6ea wallet: default -fallbackfee to the minimum relay fee (#151) 6f703b6 wallet: publish descriptor top-ups after commit (#144) f9172e8 wallet: show fee-only change-only self-transfers (#150) 6de89ab qt: show consumed PQC usage when a generated proof fails verification (#129) (#161) 9084d83 fuzz: seed qbit targets and verify replay and mutation (#164) df533c5 qt: preserve and display consumed PQC usage in transaction signing flows (#167) fc835f4 ci: run classifier tests in Required Merge Gate (#160) 2053d83 release: fail closed when the release asset list cannot be read (#170) 7f11260 ci: harden the Required Merge Gate check-run poller (#171) 5b80d5f ci: validate maintained source in scheduled heavy workflows (#165) 4873900 wallet: batch P2MR counters across mixed descriptors (#163) 19043e0 script: cache successful P2MR PQC signature checks (#162) b262cd0 ci: forward IBD workflow timeout inputs to the harness flags (#159) 4b89e4a doc: correct the v1.0.0 release trust record (#175) 0d2de1e fuzz: repair stale pqc_sign_refused coverage anchor (#176) 0954b74 qt: keep fee-bump PQC usage visible without a notification backend (#177) 3ccf788 qt: keep Encrypt Wallet responsive during existing-wallet encryption (#178) 6d6cc7d wallet: close races around CWallet::EncryptWallet (#183) 54f6737 qt: answer address labels from the table model during wallet encryption (#182) 1339e6b doc: fix pipe rendering and tighten P2MR v1 consensus profile (#252) 422ba0e doc: document bounded30 usage-dependent security margin and raw-key counter limits (#264) 981605a script: cache verified P2MR data-signature checks (v1.0.1) (#265) a5292af policy: bound P2MR runtime stack bytes (#263) d3b02f4 net: bound the size of headers messages we send (#266) 0c60e64 Squashed 'src/libbitcoinpqc/' changes from ac72d1ffa0..1965d0da1e 2f6992b subtree: import libbitcoinpqc v0.3.2 signer stack scrub (#268) cbb1961 crypto: clear stack released by PQC secret-key operations (#270) 260ac73 wallet: take descriptor locks before EncryptWallet's transaction (#277) 243065c mining: reset cached block checks in IPC submitSolution (backport bitcoin/bitcoin#33745) (#289) bc9f1bd wallet: keep the SQLite lock when probing loaded wallet files (#297) 95b8b9f wallet: fail a send whose inputs a concurrent call spent (#298) ad3d708 depends: Update Qt to 6.8.4 and fix macOS accessibility use-after-free (#347) 660034c fuzz: re-anchor PQC coverage checks after #270 and run them in CI (#342) b178391 wallet: deferred P2MR keypool refill at startup and unlock; Lock() waits for key copies (#299) 6700285 test: fix race in p2p_auxpow_headers_size (#358) f6c2013 qt: fix send confirmation re-entrancy and dialog deletion during confirmation (#348) 1fe12ea wallet: fallback-fee follow-ups for #151 (discard rate, GUI warning, default test, help texts) (#346) d21acc4 ci: bind the Required Merge Gate to its own event's runs, fail drafts, keep both sides of renames (#345) a4e1f26 qt: keep PSBT signing results across shutdown, close and unload (#344) e783923 test: keep wallet_p2mr_deferred_keypool_tests within time limits under sanitizers (#361) 1538eed ci: run runner selection on GitHub-hosted Ubuntu (#362) 1b8d10f qt: ignore PSBT Sign while a signing attempt is in progress (#353) 01a9ab3 contrib: import libbitcoinpqc releases as one verified main-line commit (#360) 5b42181 guix: ship macOS debug symbols as dSYM bundles (#343) 6f080f0 wallet: remove deleted plaintext keys from the wallet file after encryption (#300) 98dbe5b wallet: re-encrypt plaintext PQC keys in encrypted wallets on unlock (#301) dff82fb ci: allowlist fuzz-seed format tags in the gitleaks scan (#367) c7c9fbd ci: retry the cargo-audit database fetch and fix the clang analyzer scan (#368) 8ee5231 contrib: add the rulesets for qbit-guix.sigs main (#371) f8ababf contrib: add public tools to stage, sign and combine release checksums (#374) c4d88af contrib: keep the release key policy in one place and tighten key-policy continuity checks (#375) 78405ad wallet: keep the lock state when changing the passphrase (#379) ea99d08 ci: keep the 32-bit ARM nightly unit-test shards within their time limit (#377) cb1f507 ci: run the mainnet publication posture check on every mainnet line (#385) 6582427 qt: wait for open dialogs before shutdown and wallet unload (#354) 7953475 qt: keep the GUI responsive during wallet encryption started outside it (#352) 0d87213 doc: replace the release docs with a runbook, a publisher reference and a release issue form (#376) 3de5e93 net: only use service bits learned from a direct connection when deciding which addresses to avoid (#380) 565eb46 photon: bound inbound relay state per peer and check blocks before submission (#381) 7b7066f ci: parse gpg status output on newline only and reject other line separators (#387) b1b0860 net: budget per-peer time spent validating rejected transactions (#386) 3ae934c photon: announce blocks under the low-order bits of their hash (#410) faaaaa8 wallet: refill P2MR keypools before walletpassphrase returns (#411) 9e74401 wallet: fail descriptor key encryption when the plaintext record is not erased (#418) e8a796d ipc: return false from submitSolution for a missing or undecodable coinbase (#419) 396940d net: request transactions held back by the validation budget later, and limit each connection's share of the pool (#422) 6ca0132 net, validation: attribute received blocks to their sender and check recovered blocks (#414) c65bea2 qt: add a play-money poker lobby based on Satoshi's 2009 design (#378) b3b5096 script: limit standard hashing of large P2MR stack elements (#415) ca5d4b5 release: prepare v1.0.1 (#181) b1c6d4e net: pass held-back transaction announcements on at most once per retry delay (#425) Co-authored-by: Claude Fable 5 <[email protected]> Co-authored-by: Alexander Miller <[email protected]> Co-authored-by: Sjors Provoost <[email protected]> Co-authored-by: Fabian Jahr <[email protected]> Co-authored-by: Dan Hepworth <[email protected]> git-subtree-dir: src/libbitcoinpqc git-subtree-split: 1965d0da1eb4d9e196613b8f3a5d0d866a221c53
Summary
Addresses #152 by selecting maintained
1.x.xsource for scheduled heavy validation and recording the exact commit built. Depends on #164; merge that runner change first.refs/heads/1.x.xto a full commit SHA; manual runs preserve the selected branch/tag and event commit.origin/maincomparison base. Enable the companion seeded mutation phase only on the native-fuzz nightly matrix entry, at 120 seconds per target.This release-branch PR does not complete schedule delivery: GitHub schedules use the default branch. The workflow revisions must also reach
main, then a scheduled run must demonstrate the maintained source and correct provenance before #152 is closed.Stabilize the shared Qt shutdown regression test: enforce the five-second send-worker cancellation deadline, preserve wallet lifetime checks, and report total GUI teardown time separately. Slow teardown after successful cancellation no longer causes a false failure.
Resolve the Qt ordering review: record worker completion before the dialog’s synchronous destruction, so the test no longer infers lifetime order from a mutex read after teardown returns. The shared fix is also in fuzz: seed qbit targets and verify replay and mutation #164.
Testing
Review follow-up: a controlled late-completion record passes the old Qt assertion and fails the revised one. The clean Linux Debug Qt suite passed all 12 test groups; slow teardown still passes, and missed cancellation still fails the five-second watchdog. Full repository Docker lint passed on the updated signed head.
CI follow-up: the shared Qt test passed a Linux Debug build, all 12 QtTest suites through CTest, and three clean repeat runs. A 5.5-second delay after worker cancellation reproduces the old failure and passes with the fix; deliberately disabled cancellation still fails the five-second watchdog, with and without the extra delay. Full repository Docker lint passed on the updated signed commit. Hosted CentOS validation is rerunning; local verification used GCC 13.3 / Qt 6.4.2.
GIT_CONFIG_GLOBAL=/dev/null python3 ci/checks/test_scheduled_validation_contract.py: 10 tests passed again after merging current1.x.x; also passed on Linux during implementation.Deliberate workflow mutations failed the relevant contracts: retired/trigger source selection, wrong metadata, overridden manual selection, removed dependency/verification, unqualified refs, wrong matrix placement, and reverting the mutation budget to 60 seconds.
Docker actionlint 1.7.12 passed for the changed workflows. Full repository Docker lint passed on the publication head.
The companion runner's real Linux integration passed at 120 seconds with positive post-initialization execution counts for all six targets.
Built locally: shared Qt regression-test fix in a Linux Debug build.
Ran focused unit or functional tests for the changed area.
Ran lint or formatting checks relevant to this change.
Not run. Reason: hosted manual/scheduled runs, self-hosted tool availability, and the live authenticated resolver path remain to be exercised after delivery.
Target Branch
mainor a maintainer-requested release branch such as0.1.x. Target:1.x.x; separate default-branch delivery remains required.Risk / Review Notes
Notes: CI source selection and provenance change. Ref values reach shell through environment variables. Resolution fails closed, and checkout refuses empty output to prevent fallback to the triggering commit. The contract requires PyYAML/Git and is not wired into a required gate. Merge #164 first so the nightly mutation setting has its consumer.
Docs / Process Impact
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.