ci: add default branch checks and codspeed benchmark - #70
Conversation
Walkthrough在 ChangesCI 工作流扩展与基准测试接入
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/juya review |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/codspeed.yml:
- Line 35: Replace the mutable version tags in the Action references with
complete commit SHAs to prevent supply chain drift. On line 35, change the
`actions/checkout@v5` reference to pin it to a full commit SHA in the format
`actions/checkout@<complete-commit-sha>`. Apply the same fix to the other
mutable tag references on lines 38 and 41 (which use `@v5` and `@stable`), replacing
them with their corresponding full commit SHAs. Use the example format shown on
line 60 as a reference for the correct SHA format structure.
- Around line 34-36: The actions/checkout@v5 step in the Checkout repository
task does not explicitly disable credential persistence. Add a with section to
the checkout action and set persist-credentials to false to follow the principle
of least privilege and prevent the GITHUB_TOKEN from being unnecessarily
persisted in the local git configuration.
In @.github/workflows/core_ci.yml:
- Around line 20-21: The checkout action in the "Checkout repository" step is
not explicitly disabling credential persistence, which increases the token
leakage risk since this job does not perform any git push operations. Add a
`with:` section to the actions/checkout@v5 action with `persist-credentials:
false` to explicitly disable credential persistence and reduce the security
attack surface.
- Line 21: Pin third-party GitHub Actions to immutable commit SHAs instead of
mutable version references to reduce supply chain risk. In the core_ci.yml
workflow file, update three Action uses: replace `actions/checkout@v5` with its
corresponding commit SHA, replace `dtolnay/rust-toolchain@stable` with its
commit SHA, and replace `actions/cache@v5` with its commit SHA. Each Action
reference should use the full commit hash format (e.g.,
`owner/action@abc123def456...`) instead of version tags or branch names, and
consider setting up Dependabot to automatically keep these pinned versions
updated.
In @.github/workflows/test_coverage.yml:
- Line 102: The `uses` reference for taiki-e/install-action is pinned to a
mutable tag (cargo-tarpaulin) instead of a specific commit SHA, which poses a
supply chain security risk. Replace the tag-based reference with a full commit
SHA to ensure the Action version is immutable and cannot be tampered with or
compromised if the upstream account is attacked. Find the line using
taiki-e/install-action@cargo-tarpaulin and update it to reference a complete
commit SHA instead of the tag version.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a84bbc15-6884-4264-975e-82b2fb434aec
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (8)
.github/workflows/codspeed.yml.github/workflows/core_ci.yml.github/workflows/frontend_ci.yml.github/workflows/launcher_validation.yml.github/workflows/test_coverage.ymlcrates/tokscale-cli/tests/cli_tests.rscrates/tokscale-core/Cargo.tomlcrates/tokscale-core/benches/normalization.rs
What changed
Core CIworkflow for PRs targetingpersonal/local-clients.personal/local-clientsin existing CI workflow branch filters and replace hardcodedmaincoverage badge conditions with the repository default branch.Why
This prepares the self-maintained fork default branch for ruleset protection and CodSpeed without blocking normal solo-maintainer direct pushes. The core required check can be enabled after this workflow lands on the default branch.
Validation
cargo fmt --all -- --checkcargo clippy --locked --workspace --all-features -- -D warningscargo test --locked --workspace --all-featurescargo bench --locked -p tokscale-core --bench normalization -- --testSummary by cubic
Add Core CI for PRs targeting
personal/local-clients, add CodSpeed benchmarks (simulation) for normalization and JSON/JSONL parsing, and restrict coverage to default-branch, non-PR runs with artifacts only. Actions are pinned to SHAs, pricing CLI tests are stabilized, and core dev-dependencies are centralized.New Features
personal/local-clients.codspeed-criterion-compatbenches for normalization and JSON/JSONL parsing; bench profile optimized for CI; CodSpeed badge in README.personal/local-clientsin branch filters; Actions pinned to SHAs; core dev-dependencies centralized.Bug Fixes
Written for commit 4cedffd. Summary will update on new commits.
Summary by CodeRabbit