Skip to content

docs+ci: fix broken intra-doc links and gate rustdoc in CI - #574

Merged
nh13 merged 2 commits into
mainfrom
nh/ci-hardening
Jul 18, 2026
Merged

nh13 merged 2 commits into
mainfrom
nh/ci-hardening

Conversation

@nh13

@nh13 nh13 commented Jul 11, 2026 •

Copy link
Copy Markdown
Member

Problem

RUSTDOCFLAGS="-D warnings" cargo doc fails on ~15 unresolved or private-item intra-doc links spread across four crates. They accumulated silently because nothing in CI builds the docs — the test/coverage jobs run cargo nextest (which doesn't run doctests), and there was no docs job. Same root cause as the doctest gap fixed in #573, one layer up (doc links rather than doctest code).

Changes

1. Fix the broken intra-doc links (docs: commit) — repoint or demote each:

  • fgumi-raw-bam: [RawRecord] → [RawRecord](crate::RawRecord); encode/encode_into → RecordBufEncoder::; query/read_header → Self::; MemoryEstimate (downstream trait), append_int_tag (pub(crate)), BAM_CIGAR_TYPE (private const) → code spans.
  • fgumi-sort: a [SpillCodec::Zstd] occurrence in a doc comment lacking the reference-link definition → inline path.
  • fgumi-consensus: rejected_reads/take_rejected_reads → Self::.
  • fgumi (main): simulate model links → crate::simulate::…; [fetch] → Self::fetch; private SLOT_COUNTER/THREAD_SLOT → code spans.

2. Gate rustdoc in CI (ci: commit) — add a ci-doc alias and a docs job that runs cargo doc --no-deps --workspace with RUSTDOCFLAGS="-D warnings", so any rustdoc warning (broken link, private-item link) fails the build going forward.

Verification

  • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --workspace --features compare,simulate,profile-adjacency → clean.
  • cargo ci-fmt, cargo ci-lint, cargo ci-tag-literals → clean.

Note

This started as a broader CI-hardening pass. The MSRV half (correcting the declared rust-version) is intentionally not here: the declared 1.87.0 is false (deps noodles/wide force ≥1.89), but bumping it to the real floor unlocks ~85 MSRV-gated collapsible_if (let-chain) clippy warnings across the workspace that -D warnings would turn into errors. That needs its own decision (adopt let-chains vs. allow the lint) and PR, so it's decoupled to keep this one focused and green.

Summary by CodeRabbit

  • Documentation

    • Improved API documentation clarity and consistency across the project.
    • Corrected Rustdoc links and intra-doc references for easier navigation.
    • Clarified record encoding, buffer reuse, memory estimates, and simulation-related argument mappings.
    • Refined documentation for readers, sorting, tagging, and threading APIs.
  • Quality Improvements

    • Added a documentation validation job that treats Rustdoc warnings as errors.

@nh13
nh13 temporarily deployed to github-actions July 11, 2026 22:50 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Jul 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 36 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ef6471db-1a12-4a32-8bc9-aec5bc2c7266

📥 Commits

Reviewing files that changed from the base of the PR and between 96eab1f and b1ba5b3.

📒 Files selected for processing (2)
  • .cargo/config.toml
  • .github/workflows/check.yml

Walkthrough

Rustdoc-only changes correct references and clarify raw BAM documentation. CI adds a locked workspace documentation job with RUSTDOCFLAGS="-D warnings" and disables checkout credentials across existing jobs.

Changes

Rustdoc validation

Layer / File(s) Summary
Documentation CI build
.cargo/config.toml, .github/workflows/check.yml
Adds the ci-doc alias, a warning-as-error workspace documentation job, and credential-free checkout configuration across CI jobs.
Rustdoc link corrections
crates/fgumi-consensus/..., crates/fgumi-sort/..., src/lib/commands/simulate/..., src/lib/fastq_parse.rs, src/lib/per_thread_accumulator.rs, src/lib/reference.rs, crates/fgumi-raw-bam/src/indexed_reader.rs
Updates intra-doc references to qualified Self:: or concrete paths and adjusts inline markup.
Raw BAM documentation updates
crates/fgumi-raw-bam/src/{cigar,noodles_compat,raw_bam_record,tags}.rs
Clarifies BAM payload layout, encoder buffer reuse and ownership, capacity terminology, CIGAR references, and tag behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • fulcrumgenomics/fgumi#554: Both PRs update parse_fastq_records documentation; that PR also changes parsing behavior and its API signature.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes: intra-doc link fixes and adding rustdoc checks to CI.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nh/ci-hardening

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.03%. Comparing base (c94348f) to head (b1ba5b3).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #574      +/-   ##
==========================================
+ Coverage   92.96%   93.03%   +0.06%     
==========================================
  Files         167      167              
  Lines      103266   103266              
==========================================
+ Hits        96000    96071      +71     
+ Misses       7266     7195      -71     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nh13
nh13 force-pushed the nh/ci-hardening branch from 09de9c6 to 3d0e7ee Compare July 12, 2026 00:07
@nh13
nh13 temporarily deployed to github-actions July 12, 2026 00:07 — with GitHub Actions Inactive
@nh13
nh13 force-pushed the nh/ci-hardening branch from 3d0e7ee to 31724b1 Compare July 16, 2026 20:26
nh13 added a commit that referenced this pull request Jul 16, 2026
…non-code

The `//!` module-doc walkthroughs in base_builder/caller/codec_caller/duplex_caller
were fenced ```rust,ignore` — rendered as Rust but never compiled — and had rotted:
they imported from the old monolith path `fgumi_lib::consensus::...` (the crate is
now `fgumi_consensus`) and referenced the since-renamed `vanilla_consensus_caller`
module (now `vanilla_caller`). So they showed readers import paths that don't exist,
with nothing to catch it.

These are genuine teaching sketches — undefined context vars (`reads`, `options`,
`output`, ...), elided bodies, trait-shape skeletons — so they can't be compiled
without gutting their clarity. Rather than leave them masquerading as verified Rust:
- correct the crate paths (`fgumi_consensus::...`) and the `vanilla_caller` rename,
  including the prose "See Also" cross-references, so what's shown is accurate; and
- change the fences to ```text`, honestly declaring them as illustrative rather
  than as Rust the doctest/rustdoc gates would be expected to check.

Verified: introduces zero new rustdoc warnings vs main (the crate's remaining
broken intra-doc links are fixed by the sibling PR #574).
@nh13
nh13 temporarily deployed to github-actions July 16, 2026 20:26 — with GitHub Actions Inactive
@nh13

nh13 commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 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/check.yml:
- Around line 165-166: Update the actions/checkout step in the docs job to set
persist-credentials to false, preventing Cargo build scripts and proc macros
from accessing the checkout token through Git configuration.

In `@crates/fgumi-raw-bam/src/noodles_compat.rs`:
- Around line 145-148: Update the documentation for the RawRecord encoding
method to qualify the scratch-buffer allocation claim: state that reusing
self.scratch avoids allocation when its capacity is sufficient, while encoding
larger records may allocate; retain the statement that the returned RawRecord
owns its bytes.
🪄 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: 8f4a5ebf-e9f2-4b50-aa8c-35ac39244fb5

📥 Commits

Reviewing files that changed from the base of the PR and between f55ac4b and 31724b1.

📒 Files selected for processing (12)
  • .cargo/config.toml
  • .github/workflows/check.yml
  • crates/fgumi-consensus/src/codec_caller.rs
  • crates/fgumi-raw-bam/src/cigar.rs
  • crates/fgumi-raw-bam/src/indexed_reader.rs
  • crates/fgumi-raw-bam/src/noodles_compat.rs
  • crates/fgumi-raw-bam/src/raw_bam_record.rs
  • crates/fgumi-raw-bam/src/tags.rs
  • crates/fgumi-sort/src/external.rs
  • src/lib/commands/simulate/common.rs
  • src/lib/per_thread_accumulator.rs
  • src/lib/reference.rs

Comment thread .github/workflows/check.yml
Comment thread crates/fgumi-raw-bam/src/noodles_compat.rs Outdated
nh13 added a commit that referenced this pull request Jul 18, 2026
…non-code

The `//!` module-doc walkthroughs in base_builder/caller/codec_caller/duplex_caller
were fenced ```rust,ignore` — rendered as Rust but never compiled — and had rotted:
they imported from the old monolith path `fgumi_lib::consensus::...` (the crate is
now `fgumi_consensus`) and referenced the since-renamed `vanilla_consensus_caller`
module (now `vanilla_caller`). So they showed readers import paths that don't exist,
with nothing to catch it.

These are genuine teaching sketches — undefined context vars (`reads`, `options`,
`output`, ...), elided bodies, trait-shape skeletons — so they can't be compiled
without gutting their clarity. Rather than leave them masquerading as verified Rust:
- correct the crate paths (`fgumi_consensus::...`) and the `vanilla_caller` rename,
  including the prose "See Also" cross-references, so what's shown is accurate; and
- change the fences to ```text`, honestly declaring them as illustrative rather
  than as Rust the doctest/rustdoc gates would be expected to check.

Verified: introduces zero new rustdoc warnings vs main (the crate's remaining
broken intra-doc links are fixed by the sibling PR #574).
nh13 added a commit that referenced this pull request Jul 18, 2026
…non-code

The `//!` module-doc walkthroughs in base_builder/caller/codec_caller/duplex_caller
were fenced ```rust,ignore` — rendered as Rust but never compiled — and had rotted:
they imported from the old monolith path `fgumi_lib::consensus::...` (the crate is
now `fgumi_consensus`) and referenced the since-renamed `vanilla_consensus_caller`
module (now `vanilla_caller`). So they showed readers import paths that don't exist,
with nothing to catch it.

These are genuine teaching sketches — undefined context vars (`reads`, `options`,
`output`, ...), elided bodies, trait-shape skeletons — so they can't be compiled
without gutting their clarity. Rather than leave them masquerading as verified Rust:
- correct the crate paths (`fgumi_consensus::...`) and the `vanilla_caller` rename,
  including the prose "See Also" cross-references, so what's shown is accurate; and
- change the fences to ```text`, honestly declaring them as illustrative rather
  than as Rust the doctest/rustdoc gates would be expected to check.

Verified: introduces zero new rustdoc warnings vs main (the crate's remaining
broken intra-doc links are fixed by the sibling PR #574).
`cargo doc` with RUSTDOCFLAGS="-D warnings" failed on ~15 unresolved or
private-item intra-doc links that had accumulated because nothing in CI builds
the docs (nextest does not, and there was no docs job). Repoint or demote each:

- fgumi-raw-bam:
  - `[`RawRecord`]` in noodles_compat -> `[`RawRecord`](crate::RawRecord)` (not
    in that module's scope; the module uses `crate::RawRecord`).
  - `[`encode`]` / `[`encode_into`]` -> qualified with `RecordBufEncoder::`.
  - `[`query`]` / `[`read_header`]` -> `Self::` (same impl).
  - `[`MemoryEstimate`]` -> code span (the trait lives in a downstream crate).
  - `[`append_int_tag`]` (pub(crate)) and `[`BAM_CIGAR_TYPE`]` (private const)
    -> code spans; they are not part of the public API rustdoc documents.
- fgumi-sort: a second `[`SpillCodec::Zstd`]` occurrence in a doc comment that
  lacked the reference-link definition the first one has -> inline path.
- fgumi-consensus: `[`rejected_reads`]` / `[`take_rejected_reads`]` -> `Self::`.
- fgumi (main): the `simulate` model links -> `crate::simulate::...`; the
  `[`fetch`]` links in reference.rs -> `Self::fetch`; and the private
  `SLOT_COUNTER` / `THREAD_SLOT` links -> code spans.

`RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --workspace --features
compare,simulate,profile-adjacency` now builds clean.
@nh13
nh13 force-pushed the nh/ci-hardening branch from 31724b1 to 96eab1f Compare July 18, 2026 15:11
@nh13
nh13 temporarily deployed to github-actions July 18, 2026 15:11 — with GitHub Actions Inactive
nh13 added a commit that referenced this pull request Jul 18, 2026
…non-code (#579)

The `//!` module-doc walkthroughs in base_builder/caller/codec_caller/duplex_caller
were fenced ```rust,ignore` — rendered as Rust but never compiled — and had rotted:
they imported from the old monolith path `fgumi_lib::consensus::...` (the crate is
now `fgumi_consensus`) and referenced the since-renamed `vanilla_consensus_caller`
module (now `vanilla_caller`). So they showed readers import paths that don't exist,
with nothing to catch it.

These are genuine teaching sketches — undefined context vars (`reads`, `options`,
`output`, ...), elided bodies, trait-shape skeletons — so they can't be compiled
without gutting their clarity. Rather than leave them masquerading as verified Rust:
- correct the crate paths (`fgumi_consensus::...`) and the `vanilla_caller` rename,
  including the prose "See Also" cross-references, so what's shown is accurate; and
- change the fences to ```text`, honestly declaring them as illustrative rather
  than as Rust the doctest/rustdoc gates would be expected to check.

Verified: introduces zero new rustdoc warnings vs main (the crate's remaining
broken intra-doc links are fixed by the sibling PR #574).
@nh13

nh13 commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/fgumi-consensus/src/codec_caller.rs (1)

2903-2990: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Make the HDD fixture produce a real overlap disagreement.

duplex_disagreement_fixture() uses matching FR sequences, while build_duplex_consensus_from_padded only increments duplex_disagreements for differing bases when both strands have data; lowercase-n single-strand tails do not increment it. Both new tests therefore reach panic!("...should produce an error") instead of the typed HDD path. Inject a deterministic base mismatch inside the overlap (or adjust production accounting to the intended fgbio rule) and assert the fixture has a nonzero disagreement count.

🤖 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 `@crates/fgumi-consensus/src/codec_caller.rs` around lines 2903 - 2990, Update
duplex_disagreement_fixture so its FR sequences contain a deterministic
mismatching base within the overlapping region, ensuring
build_duplex_consensus_from_padded increments duplex_disagreements; verify the
fixture produces a nonzero disagreement count before the tests exercise the HDD
error path.
🤖 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/check.yml:
- Around line 197-209: Add job-level permissions with contents: read to both the
docs job at .github/workflows/check.yml lines 197-209 and the MSRV lockstep job
at .github/workflows/check.yml lines 172-178. Keep the existing
persist-credentials setting and job steps unchanged.

---

Outside diff comments:
In `@crates/fgumi-consensus/src/codec_caller.rs`:
- Around line 2903-2990: Update duplex_disagreement_fixture so its FR sequences
contain a deterministic mismatching base within the overlapping region, ensuring
build_duplex_consensus_from_padded increments duplex_disagreements; verify the
fixture produces a nonzero disagreement count before the tests exercise the HDD
error path.
🪄 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: 812e2435-17fa-4102-8252-8bbf43f2c6f4

📥 Commits

Reviewing files that changed from the base of the PR and between 31724b1 and 96eab1f.

📒 Files selected for processing (13)
  • .cargo/config.toml
  • .github/workflows/check.yml
  • crates/fgumi-consensus/src/codec_caller.rs
  • crates/fgumi-raw-bam/src/cigar.rs
  • crates/fgumi-raw-bam/src/indexed_reader.rs
  • crates/fgumi-raw-bam/src/noodles_compat.rs
  • crates/fgumi-raw-bam/src/raw_bam_record.rs
  • crates/fgumi-raw-bam/src/tags.rs
  • crates/fgumi-sort/src/external.rs
  • src/lib/commands/simulate/common.rs
  • src/lib/fastq_parse.rs
  • src/lib/per_thread_accumulator.rs
  • src/lib/reference.rs

Comment thread .github/workflows/check.yml
Nothing in CI builds the documentation: the test/coverage jobs use nextest
(which does not run doctests), and there was no docs job. That let unresolved
intra-doc links accumulate silently (fixed in the preceding commit).

Add a `ci-doc` alias (`cargo doc --no-deps --workspace` with the standard
feature set) and a `docs` job that runs it with RUSTDOCFLAGS="-D warnings", so
any rustdoc warning -- broken intra-doc link, link to a private item, etc. --
now fails the build at PR time.
@nh13
nh13 force-pushed the nh/ci-hardening branch from 96eab1f to b1ba5b3 Compare July 18, 2026 16:29
@nh13
nh13 temporarily deployed to github-actions July 18, 2026 16:30 — with GitHub Actions Inactive
@nh13

nh13 commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

Addressed CodeRabbit feedback from the latest review:

Token permissions (.github/workflows/check.yml) — resolved. Rather than adding permissions: contents: read to only the two flagged jobs (docs, msrv-lockstep), added a single top-level permissions: contents: read block. Every job in this workflow only checks out the repo and runs read-only cargo build/test/lint steps — the coverage job authenticates its Codecov upload with secrets.CODECOV_TOKEN, not the workflow token — so a workflow-level read-only default covers all jobs uniformly and satisfies the zizmor excessive-permissions warning without per-job duplication.

Outside-diff finding on crates/fgumi-consensus/src/codec_caller.rs (duplex_disagreement_fixture) — not a valid issue; no change made. The claim was that the fixture uses matching FR sequences so the HDD tests reach panic!(...) instead of the typed disagreement path. That is not the case: the fixture reuses the FR pair from test_not_emit_consensus_high_disagreement, where the single-strand overlap positions (10 on each side) count as disagreements, so the fixture produces a non-zero disagreement count and rate. Confirmed by running the tests — all 7 relevant tests (test_high_duplex_disagreement_counted::{by_count,by_rate}, test_high_duplex_disagreement_tracks_rejects, test_consensus_reads_typed_disagreement_{count,rate}) pass, reaching the Err(...) HDD path and asserting the HDD counters, never the panic!. This PR also only touches an intra-doc link in that file, not the fixture.

@nh13
nh13 merged commit f577f55 into main Jul 18, 2026
12 checks passed
@nh13
nh13 deleted the nh/ci-hardening branch July 18, 2026 16:34

This branch was previously deployed

1 inactive deployment
github-actions — b1ba5b31 Deployed Jul 18, 2026 by nh13 via coverage #2704
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.

1 participant