ci: gate sort correctness against samtools - #577
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughAdds a Cargo alias for ignored samtools-dependent integration tests and a ChangesSamtools CI validation
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant Samtools
participant CargoAlias
participant Nextest
GitHubActions->>Samtools: Install and verify samtools
GitHubActions->>CargoAlias: Run cargo ci-test-samtools
CargoAlias->>Nextest: Run ignored fgumi::integration tests
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #577 +/- ##
==========================================
+ Coverage 93.39% 93.41% +0.02%
==========================================
Files 174 174
Lines 104122 104122
==========================================
+ Hits 97244 97268 +24
+ Misses 6878 6854 -24 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
679deb4 to
19c4c26
Compare
2360ed8 to
47aa253
Compare
19c4c26 to
8a13fc4
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 @.cargo/config.toml:
- Around line 6-16: Update the ci-test-samtools alias and its associated
documentation to match the actual validation performed: either add a normalized
comparison against samtools sort output to the referenced integration tests, or
rename the alias/job and comments to describe internal sort-correctness checks
rather than samtools output parity. Preserve the existing samtools-gated test
execution.
In @.github/workflows/check.yml:
- Around line 159-160: Update the actions/checkout step in the workflow to set
persist-credentials to false, preventing the GitHub token from being stored in
local git configuration while preserving the existing checkout behavior.
- Around line 179-181: Add a samtools --version validation step immediately
after the apt-get installation and before the “Run samtools-gated
sort-correctness tests” step, so the workflow fails if samtools is unavailable
on PATH while preserving the existing cargo ci-test-samtools invocation.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 14788f2d-623f-48b3-aaed-dd7cd1980e25
📒 Files selected for processing (2)
.cargo/config.toml.github/workflows/check.yml
47aa253 to
829cebd
Compare
8a13fc4 to
37b339d
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/check.yml (1)
158-162: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winConstrain token permissions for both added jobs. Their
GITHUB_TOKENscopes inherit repository defaults; addpermissions: contents: readto each job.
.github/workflows/check.yml#L158-L162: addpermissions: contents: readundermsrv-lockstep..github/workflows/check.yml#L181-L187: addpermissions: contents: readundersort-correctness.🤖 Prompt for 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. In @.github/workflows/check.yml around lines 158 - 162, Restrict GITHUB_TOKEN permissions for both added jobs by adding contents: read under msrv-lockstep in .github/workflows/check.yml lines 158-162 and under sort-correctness in .github/workflows/check.yml lines 181-187.Source: Linters/SAST tools
🤖 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.
Outside diff comments:
In @.github/workflows/check.yml:
- Around line 158-162: Restrict GITHUB_TOKEN permissions for both added jobs by
adding contents: read under msrv-lockstep in .github/workflows/check.yml lines
158-162 and under sort-correctness in .github/workflows/check.yml lines 181-187.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 23e35c21-908c-49ee-9711-632527925a1c
📒 Files selected for processing (2)
.cargo/config.toml.github/workflows/check.yml
|
@coderabbitai review |
✅ Action performedReview finished.
|
37b339d to
22fcd9a
Compare
|
Addressed the outside-diff finding on
Also fixed a defect found in pre-push self-review: |
|
@coderabbitai review |
✅ Action performedReview finished.
|
`fgumi sort`'s headline guarantee is that it matches `samtools sort` (its own docs claim "1.9x faster than samtools"), and there is a suite that checks exactly that: `test_sort_correctness` (coordinate / queryname-lex / queryname-natural / template-coordinate, in-memory and with disk spills), `test_async_reader`, and `test_sort_write_index`. All 18 are `#[ignore]`d because they shell out to `samtools` — which is never installed in CI, so the guarantee was ungated. A sort regression (e.g. the simulate template-coordinate bug) could ship green. Add a `sort-parity` job that installs samtools and runs the ignored suite via a new `ci-test-samtools` alias (`nextest run --run-ignored ignored-only`). Stacked on the simulate-sort branch, whose hermetic rewrite removed samtools from the simulate tests, so `ignored-only` now selects exactly these 18 sort-vs-samtools tests. They pass in ~1s locally with samtools present.
22fcd9a to
0d5c17e
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Why
fgumi sort's core contract is that it matchessamtools sort— and there's a suite that verifies exactly that:test_sort_correctness(coordinate / queryname-lex / queryname-natural / template-coordinate, in-memory and with disk spills),test_async_reader, andtest_sort_write_index. All 18 are#[ignore]d because they shell out tosamtools, which is never installed in CI. So fgumi's headline feature has been running on an ungated contract — a sort regression (like the recent simulate template-coordinate bug) could ship green.This is the "contract with no gate" pattern: reference-parity tests that exist but never run.
What
sort-parityCI job: installs samtools (apt) and runs the ignored suite via a newci-test-samtoolsalias (nextest run --run-ignored ignored-only).ignored-onlynow selects exactly these 18 sort-vs-samtools tests (verified: 18 run, 18 pass, ~1s locally).samtools comes from the runner's apt repo; the tests are tie-insensitive, so they don't depend on a specific samtools patch version (a hard version pin is a possible follow-up if ever needed).
Base
Targets
nh/test-simulate-sort-hermetic(#576) and should merge after it — it relies on #576 having un-ignored the simulate sort tests, soignored-onlyis exactly the samtools set.First of a task-list series closing "contract with no gate" gaps (T1).
Summary by CodeRabbit
samtools, verifies it’s available, and runs the samtools-dependent sort-correctness integration checks for reliable automated test coverage.