Repository navigation
ci: prewarm the protected 4.2-dev SCA tool bundle - #33517
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
This pull request is merged. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: daca421d89bf305830feeedca7fad997bf6f06a9
Assessment: request_changes
The release cache producer can package stale tools when a self-hosted runner has a custom GOBIN. The shared-step design otherwise preserves the existing producer's cache-key formula and keeps the main warming job intact.
Model: gpt-6.1-terra / max
Session: 01a22aff-bb68-7e31-ae71-ee4ab48ad9d0 · slot 0 · generation 45
- P2
.github/workflows/sca-go-module-cache.yaml:387: A 4.2-dev cache miss runs on a self-hosted runner whose GOBIN differs from GOPATH/bin.
Impact: The release recipe installs molint and license-eye into GOBIN, but the shared step copies them from GOPATH/bin. The job either fails if they are absent or publishes stale executable copies under the trusted release recipe key, allowing consumers to run the wrong tool versions.
Evidence: The 4.2-dev revision cited in the linked issue sets GOBIN explicitly only for golangci-lint. An offline Go fixture using that recipe structure reproduced stale molint and license-eye binaries in the bundle, while the unset-GOBIN control packaged the expected binaries. The verification step checks only executable bits. Set GOBIN to the packaging directory for the install, or otherwise ensure all three copied tools come from the intended installation.
Validation:
-
Private /tmp and loopback preflight passed.
-
The selected CI scope contract test passed; the other 26 tests in that file were skipped by the selector.
-
Parsed the workflow YAML and checked shared-step aliases and cache-key parity with the prior producer formula for the pinned main and cited 4.2-dev recipes.
-
The offline GOBIN probe reproduced the finding with a passing unset-GOBIN control; receipt 1796033281206100280-3.json records the successful probe.
Limitations:
-
The GOBIN probe used local stand-in Go modules with the release recipe's installation structure; it does not establish the Shanghai runner's actual GOBIN setting.
-
The linked author rehearsals and external reusable CI consumer were not independently inspected. The captured CI snapshot shows the relevant checks still pending.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: d89766858d1a62435b307ca2e0a50896f7b0f807
Assessment: request_changes
The shared-step design preserves cache-key parity and resolves the earlier GOBIN packaging finding. The new release warmer, however, can build a trusted tool bundle from an inherited module cache that was writable by an earlier job.
Model: gpt-6.1-terra / max
Session: 01a22aff-bb68-7e31-ae71-ee4ab48ad9d0 · slot 0 · generation 45
- P2
.github/workflows/sca-go-module-cache.yaml:153: A release-tool cache miss runs on a self-hosted runner whose Go module cache is reused across jobs and contains a modified unpacked module.
Impact: The trusted default-branch warmer can execute and publish altered analyzer binaries under the release recipe’s cache key. Subsequent 4.2-dev PR jobs can then consume those binaries.
Evidence: The shared installer explicitly preservesgo env GOMODCACHE, but the new release job does not perform the main job’s clean-and-trusted module-cache initialization at lines 90–118. In an offline stand-in using the workflow’s actual install and verify scripts, modifying a cached module changed the bundled molint binary, and all startup checks passed;go mod verifydetected the modified directory. Initialize a fresh release-job module cache or restore a trusted one before installation, while retaining the isolated GOBIN.
Validation:
-
Private execution preflight passed: checks/1796040775875386128-3.json.
-
The full static-analysis Node test file passed all 9 tests, including the GOBIN regression: checks/1796040829621838512-3.json and static-analysis-node-recovered.log.
-
The CI scope Node test file passed all 27 tests: checks/1796041021318333493-3.json and change-scope-node.log.
-
YAML alias and cache-key parity checks passed for the main recipe and the release recipe cited in the supplied issue: checks/1796041138923421780-3.json and workflow-contract-probe.log.
-
The modified-module-cache probe and clean control are recorded in checks/1796040974400807669-3.json, checks/1796041072972841571-3.json, checks/1796041108828206495-3.json, and their corresponding modcache logs. Receipt and discussion coverage are audited in review-evidence-audit.json.
Limitations:
-
The cache probe used local stand-in modules with GOSUMDB disabled; it does not establish that a live runner or cache is compromised.
-
The first Node run encountered a local VCS-stamping error caused by the diagnostic directory’s placeholder .git. The rerun passed with VCS stamping disabled.
-
The supplied evidence describes author rehearsals but does not include their raw logs. The scheduled default-branch release warmer was not run during this review.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #28100. Recent release-target SCA job.
What this PR does / why we need it:
One release-target SCA run spent 72m23s preparing tools before it exhausted the 90-minute job budget. The default-branch warmer published only the main recipe. The release consumer needs the Go 1.26.4 bundle and its own Makefile tool versions.
Warm that release bundle once using the protected 4.2-dev source in the default branch's scheduled or manually dispatched workflow. The main and release producers share the existing install, verification and save steps, and use the same cache identity as the PR reader. A release cache hit performs a metadata lookup. The warmer fetches the full source and installs tools only on a miss. Main's native, module and analysis warming still run once. The two jobs are independent.
Shanghai ARM64 rehearsal on the earlier revision. A cold rehearsal installed the real release recipe in 4m53s and published the bundle. On rerun, the lookup took 2s and the release build and save steps were skipped. The unchanged SCA reader restored the release archive in 10s and the main archive in 7s. Both sets contained all three Go tools, and both golangci-lint binaries ran. The release rehearsal wrote the isolated test branch's cache. Cold build · Warm lookup · Consumer verification.
After merge, the next successful “Warm SCA caches” run on main publishes the release key in the scope used by PRs. A change to the tool recipe or Go version gets a new key. PRs with other recipes still use their existing installer. Actionlint and the CI scope contract passed.
Review follow-up
On the original PR revision a runner with a custom GOBIN and older tools in GOPATH/bin produced a successful bundle containing the older molint and license-eye. With an empty GOPATH/bin the same step failed. Both producers now give the selected Make recipe a fresh GOPATH/bin and GOBIN while reusing its configured module cache. They run all three tools before saving the bundle. The release lookup-only hit still skips this work. Review finding
On macOS arm64 the release and main recipes installed their pinned tools with Go 1.26.4 and 1.27.1 respectively. The reusable CI consumer accepted each bundle, and the runner's pre-existing binaries remained intact. The startup check also rejected a real executable with a missing dynamic library. The repository CI contract passed all 88 Node tests and five Python tests. The workflow passed actionlint and the affected shell blocks passed ShellCheck.