Repository navigation
ci: warm shared Go module cache for SCA - #27128
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? |
|
Deep re-review found and fixed one additional producer/consumer compatibility issue in 5a6a52b. actions/cache has a hidden version derived from the path and archives paths relative to GITHUB_WORKSPACE. The producer now uses the same stable relative staging path (.sca-go-module-cache) as CI#422, rather than a runner-specific absolute GOMODCACHE. This keeps both the hidden cache version and tar entry layout portable across runner nodes. The consumer restores that staging directory and immediately moves it outside the source tree before license-eye runs. Stale self-hosted-runner state is cleared first, and the PR side remains restore-only. Validation: actionlint passed, YAML/diff checks passed, producer-consumer path+key+prefix equality passed, and the cleanup/relocation lifecycle was simulated locally. |
## What type of PR is this? - [ ] API-change - [ ] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue #27076 ## What this PR does / why we need it: Extends the trusted main-branch SCA cache producer introduced by #27128. - warms exact-key native prerequisites (`thirdparties/install`, CPU `cgo` objects, `libmo`) for the SCA platform and compiler - warms the three static-check binaries with an exact Go/tool-recipe key - pins `molint` instead of resolving `@latest`, making the tool cache deterministic - verifies every cached artifact before publishing it - retains the existing Go module cache producer The corresponding reusable workflow remains restore-only, so `pull_request_target` runs cannot save or poison shared caches. Native artifacts intentionally have no restore prefix: a PR changing C/native inputs gets a cache miss and rebuilds from source. No static analysis is skipped. The expected saving is in the current 6–8 minute `Prepare ENV` phase. The cached payload is about 170 MB before compression (about 88 MB tools and 80 MB native artifacts). Companion consumer: matrixorigin/CI#423 ## Validation - workflow YAML parsed successfully - actionlint passed for the warm-cache workflow - producer/consumer cache keys and paths match mechanically - `make install-static-check-tools` completed successfully with the pinned `molint` - `make -n install-static-check-tools` shows all three expected fixed tool versions - `git diff --check` passed --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## What type of PR is this? - [ ] API-change - [ ] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#27076 ## What this PR does / why we need it: Adds a trusted MatrixOne-side producer for the SCA Go module cache consumed by matrixorigin/CI#422. - runs on trusted main pushes that change go.mod/go.sum, a daily schedule, and workflow_dispatch - restores an existing compatible main cache before downloading deltas - downloads all modules with the Shanghai proxy when running on a Shanghai SCA runner - saves the exact cache key in the MatrixOne default-branch scope - serializes warm-up runs and skips download/save on an exact hit - uses the same relative staging path as the consumer so the hidden cache version and tar layout remain portable across runner nodes The reusable PR workflow remains restore-only because MatrixOne CI is triggered by pull_request_target. Different PRs can therefore share this trusted main cache without being able to poison or overwrite it. The consumer moves the restored cache out of the source tree before license-eye scans source files. Related: matrixorigin/CI#422 Validation: - YAML syntax parsed successfully - actionlint passed - producer/consumer path, key, and restore prefix match mechanically - cache cleanup and relocation lifecycle simulated successfully - git diff --check passed
## What type of PR is this? - [ ] API-change - [ ] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#27076 ## What this PR does / why we need it: Extends the trusted main-branch SCA cache producer introduced by matrixorigin#27128. - warms exact-key native prerequisites (`thirdparties/install`, CPU `cgo` objects, `libmo`) for the SCA platform and compiler - warms the three static-check binaries with an exact Go/tool-recipe key - pins `molint` instead of resolving `@latest`, making the tool cache deterministic - verifies every cached artifact before publishing it - retains the existing Go module cache producer The corresponding reusable workflow remains restore-only, so `pull_request_target` runs cannot save or poison shared caches. Native artifacts intentionally have no restore prefix: a PR changing C/native inputs gets a cache miss and rebuilds from source. No static analysis is skipped. The expected saving is in the current 6–8 minute `Prepare ENV` phase. The cached payload is about 170 MB before compression (about 88 MB tools and 80 MB native artifacts). Companion consumer: matrixorigin/CI#423 ## Validation - workflow YAML parsed successfully - actionlint passed for the warm-cache workflow - producer/consumer cache keys and paths match mechanically - `make install-static-check-tools` completed successfully with the pinned `molint` - `make -n install-static-check-tools` shows all three expected fixed tool versions - `git diff --check` passed --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## What type of PR is this? - [ ] API-change - [ ] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#27076 ## What this PR does / why we need it: Adds a trusted MatrixOne-side producer for the SCA Go module cache consumed by matrixorigin/CI#422. - runs on trusted main pushes that change go.mod/go.sum, a daily schedule, and workflow_dispatch - restores an existing compatible main cache before downloading deltas - downloads all modules with the Shanghai proxy when running on a Shanghai SCA runner - saves the exact cache key in the MatrixOne default-branch scope - serializes warm-up runs and skips download/save on an exact hit - uses the same relative staging path as the consumer so the hidden cache version and tar layout remain portable across runner nodes The reusable PR workflow remains restore-only because MatrixOne CI is triggered by pull_request_target. Different PRs can therefore share this trusted main cache without being able to poison or overwrite it. The consumer moves the restored cache out of the source tree before license-eye scans source files. Related: matrixorigin/CI#422 Validation: - YAML syntax parsed successfully - actionlint passed - producer/consumer path, key, and restore prefix match mechanically - cache cleanup and relocation lifecycle simulated successfully - git diff --check passed
## What type of PR is this? - [ ] API-change - [ ] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#27076 ## What this PR does / why we need it: Extends the trusted main-branch SCA cache producer introduced by matrixorigin#27128. - warms exact-key native prerequisites (`thirdparties/install`, CPU `cgo` objects, `libmo`) for the SCA platform and compiler - warms the three static-check binaries with an exact Go/tool-recipe key - pins `molint` instead of resolving `@latest`, making the tool cache deterministic - verifies every cached artifact before publishing it - retains the existing Go module cache producer The corresponding reusable workflow remains restore-only, so `pull_request_target` runs cannot save or poison shared caches. Native artifacts intentionally have no restore prefix: a PR changing C/native inputs gets a cache miss and rebuilds from source. No static analysis is skipped. The expected saving is in the current 6–8 minute `Prepare ENV` phase. The cached payload is about 170 MB before compression (about 88 MB tools and 80 MB native artifacts). Companion consumer: matrixorigin/CI#423 ## Validation - workflow YAML parsed successfully - actionlint passed for the warm-cache workflow - producer/consumer cache keys and paths match mechanically - `make install-static-check-tools` completed successfully with the pinned `molint` - `make -n install-static-check-tools` shows all three expected fixed tool versions - `git diff --check` passed --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## What type of PR is this? - [ ] API-change - [ ] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#27076 ## What this PR does / why we need it: Adds a trusted MatrixOne-side producer for the SCA Go module cache consumed by matrixorigin/CI#422. - runs on trusted main pushes that change go.mod/go.sum, a daily schedule, and workflow_dispatch - restores an existing compatible main cache before downloading deltas - downloads all modules with the Shanghai proxy when running on a Shanghai SCA runner - saves the exact cache key in the MatrixOne default-branch scope - serializes warm-up runs and skips download/save on an exact hit - uses the same relative staging path as the consumer so the hidden cache version and tar layout remain portable across runner nodes The reusable PR workflow remains restore-only because MatrixOne CI is triggered by pull_request_target. Different PRs can therefore share this trusted main cache without being able to poison or overwrite it. The consumer moves the restored cache out of the source tree before license-eye scans source files. Related: matrixorigin/CI#422 Validation: - YAML syntax parsed successfully - actionlint passed - producer/consumer path, key, and restore prefix match mechanically - cache cleanup and relocation lifecycle simulated successfully - git diff --check passed
## What type of PR is this? - [ ] API-change - [ ] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#27076 ## What this PR does / why we need it: Extends the trusted main-branch SCA cache producer introduced by matrixorigin#27128. - warms exact-key native prerequisites (`thirdparties/install`, CPU `cgo` objects, `libmo`) for the SCA platform and compiler - warms the three static-check binaries with an exact Go/tool-recipe key - pins `molint` instead of resolving `@latest`, making the tool cache deterministic - verifies every cached artifact before publishing it - retains the existing Go module cache producer The corresponding reusable workflow remains restore-only, so `pull_request_target` runs cannot save or poison shared caches. Native artifacts intentionally have no restore prefix: a PR changing C/native inputs gets a cache miss and rebuilds from source. No static analysis is skipped. The expected saving is in the current 6–8 minute `Prepare ENV` phase. The cached payload is about 170 MB before compression (about 88 MB tools and 80 MB native artifacts). Companion consumer: matrixorigin/CI#423 ## Validation - workflow YAML parsed successfully - actionlint passed for the warm-cache workflow - producer/consumer cache keys and paths match mechanically - `make install-static-check-tools` completed successfully with the pinned `molint` - `make -n install-static-check-tools` shows all three expected fixed tool versions - `git diff --check` passed --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
issue #27076
What this PR does / why we need it:
Adds a trusted MatrixOne-side producer for the SCA Go module cache consumed by matrixorigin/CI#422.
The reusable PR workflow remains restore-only because MatrixOne CI is triggered by pull_request_target. Different PRs can therefore share this trusted main cache without being able to poison or overwrite it. The consumer moves the restored cache out of the source tree before license-eye scans source files.
Related: matrixorigin/CI#422
Validation: