Skip to content

ci: cache SCA preparation artifacts - #423

Merged
XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
XuPeng-SH:xp/cache-sca-prepare-env
Aug 13, 2026
Merged

ci: cache SCA preparation artifacts#423
XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
XuPeng-SH:xp/cache-sca-prepare-env

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

Summary

  • restore trusted exact-key native SCA prerequisites before Prepare ENV
  • restore trusted exact-key golangci-lint, molint, and license-eye binaries
  • move restored tools out of the checkout before the full license scan
  • fall back to the existing native build and retried tool installation on cache miss or incomplete cache
  • keep PR runs restore-only; only MatrixOne main writes these caches

Why

After #422 reduced license-eye dep check from more than 40 minutes to about 2 seconds, the remaining SCA setup still spends 6–8 minutes rebuilding native prerequisites and static-check tools for every PR.

This change removes that repeated work without changing the runner or reducing checks. make static-check still executes the complete go vet, license header check, dependency license check, and golangci-lint suite.

Native caches are exact-keyed by OS, architecture, compiler, and all relevant source inputs. They intentionally have no restore prefix, so native-changing PRs rebuild. Tool caches are exact-keyed by OS, architecture, Go version, and the static-tool recipe hash.

Trusted producer: matrixorigin/matrixone#27132

Merge order: merge matrixorigin/matrixone#27132 first so main can populate the caches, then merge this PR. This PR remains correct on cache miss if merged first, but will not become faster until the producer runs.

Validation

  • workflow YAML parsed successfully
  • actionlint findings are byte-for-byte equivalent to the two unchanged findings on main
  • producer/consumer module, native, and tool cache paths and keys match mechanically
  • cache-hit artifact validation and cache-miss fallbacks were reviewed end to end
  • git diff --check passed

Comment thread .github/workflows/ci.yaml Outdated
@loveRhythm1990
loveRhythm1990 self-requested a review August 13, 2026 17:08
XuPeng-SH added a commit to matrixorigin/matrixone 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>
@XuPeng-SH
XuPeng-SH merged commit 8c8ab2f into matrixorigin:main Aug 13, 2026
1 check passed
fengttt added a commit that referenced this pull request Aug 14, 2026
… compose-based pessimistic BVT

Upstream (#419-#423) landed two things this branch must integrate with:

- The SCA job gained its own trusted actions/cache pipeline (module
  cache from matrixorigin/matrixone's sca-go-module-cache.yaml producer,
  native prerequisites keyed on compiler identity plus full native-input
  hashes, cached static-check tools). That mechanism subsumes this
  branch's SCA seed step — including the toolchain-ABI fingerprint this
  branch deliberately deferred — so the SCA seed is dropped, the
  nightly ci-builder publishes amd64 only (the arm64 leg existed solely
  for SCA), and the multi-arch manifest job goes away.

- The pessimistic standalone BVT was rebuilt on the compose topology
  (its native launch build kept exceeding the job timeout). The old
  native-binary artifact consumer no longer applies; both BVT jobs now
  consume the shared build identically, assembling the runtime image
  from the artifact via Dockerfile.prebuilt with the same guarded
  fallback to the full in-docker build.

The UT job keeps both the upstream Shanghai-proxy canary and this
branch's cache seed; they are independent.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants