Skip to content

ci: warm shared Go module cache for SCA - #27128

Merged
XuPeng-SH merged 3 commits into
mainfrom
ci/sca-go-module-cache
Aug 13, 2026
Merged

XuPeng-SH merged 3 commits into
mainfrom
ci/sca-go-module-cache

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

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.

  • 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

@XuPeng-SH
XuPeng-SH requested a review from fengttt as a code owner August 13, 2026 14:43
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH

Copy link
Copy Markdown
Contributor Author

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.

@XuPeng-SH
XuPeng-SH deleted the ci/sca-go-module-cache branch August 13, 2026 15:09
@XuPeng-SH XuPeng-SH mentioned this pull request Aug 13, 2026
2 of 7 tasks
XuPeng-SH added a commit that referenced this pull request Aug 13, 2026
## 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>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## 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
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## 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>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## 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
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## 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>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## 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
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## 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>

This branch had an error being deployed

1 failed deployment
ci — 5a6a52bb Deployed Aug 13, 2026 by XuPeng-SH via Matrixone Utils CI / Coverage #46101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement kind/test-ci size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants