Skip to content

Fail CI on a rotted doc comment or link (#76) - #77

Merged
sehkone merged 1 commit into
mainfrom
sehkone/issue-76
Aug 28, 2026
Merged

Fail CI on a rotted doc comment or link (#76)#77
sehkone merged 1 commit into
mainfrom
sehkone/issue-76

Conversation

@sehkone

@sehkone sehkone commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a Docs step to ci.yml's check job: cargo doc --no-deps --document-private-items --features test-support under RUSTDOCFLAGS: -D warnings.
  • Nothing in this repository currently fails when a doc comment rots. check runs formatting and clippy twice, test runs the suite twice, and there is no cargo doc anywhere. aicers/bootler's CI has had the equivalent step since it had a CI.

This crate is the one where that costs most, because its rustdoc is its contract. aicers/bootler and aicers/roxyd both link it at a pinned revision, and the decisions they are written against live in doc comments rather than in a specification — which UnparsedContainer accessors stay pub(crate), that parse_unverified_manifest returns a manifest nothing has authenticated, that into_payload takes the manifest rather than parsing it, that validate_footer reports TruncatedTrailer for a block running past the footer, that open_path does not bound its envelope reads. Downstream issues are written by quoting those comments.

They are held together by 1009 intra-doc links across src/, 175 in src/payload.rs alone. A broken link renders as plain text, so the failure is quiet and durable: the next reader sees a name that no longer resolves and cannot tell whether the symbol moved, was renamed, or never existed.

Once, where clippy runs twice, and the comment beside the step says why. Clippy needs both runs because --all-targets covers every target but no feature. Documentation has no such gap: this crate carries no #[cfg(not(feature = ...))], so enabling test-support only adds items and one run documents a superset of the default build. --document-private-items because validate_footer, envelope_present, Footer and the pub(crate) accessors are exactly where the reasoning lives, and a default cargo doc skips them.

No doc comment is edited, no #![deny]/#![warn] attribute is added, and no existing step, job, trigger or toolchain declaration changes. Workflow only.

Closes #76

Test plan

  • actionlint .github/workflows/ci.yml — clean.

  • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --document-private-items --features test-support passes on this branch, with no doc comment changed, so this adds a gate rather than a backlog.

  • Proven to bite rather than assumed to. A scratch edit added /// See [NoSuchSymbolAnywhere] for the rules. above UnparsedContainer::signature, and the command failed:

    error: unresolved link to `NoSuchSymbolAnywhere`
    error: could not document `deploy-core`
    

    The edit was reverted; the diff is the workflow file alone.

  • git diff --stat is .github/workflows/ci.yml | 15 +++++++++++++++ — one file, additions only.

  • This pull request's checks show the new Docs step running and green: the check job reports Check formatting, Clippy, Clippy (test-support) and Docs all successful, and all four checks on the pull request pass.

Nothing here fails when a doc comment rots, and this is the crate where
that costs most: its rustdoc is its contract. Two repositories link
against it at a pinned revision and are written by quoting doc comments
-- which accessors stay crate-private, that a parsed manifest is
unauthenticated, why a footer block running past the footer is a
truncated trailer, that one opener does not bound its envelope reads.

Those comments are held together by 1009 intra-doc links across src.
A rename breaks every link naming the old symbol, and a broken link
renders as plain text, so the next reader sees a name that no longer
resolves and cannot tell whether it moved, was renamed, or never
existed.

Once, where clippy runs twice. Clippy needs both runs because
--all-targets covers every target but no feature. Documentation has no
such gap: the crate carries no cfg(not(feature = ...)), so enabling
test-support only adds items and one run covers a superset.

The step passes on the current tree, so this adds a gate rather than a
backlog, and it was proven to bite before landing: a scratch edit
introducing an unresolved link fails the command.

Closes #76
@sehkone
sehkone merged commit 7cf92f3 into main Aug 28, 2026
4 checks passed
@sehkone
sehkone deleted the sehkone/issue-76 branch August 28, 2026 12:10
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.

Fail CI when a doc comment or intra-doc link rots

1 participant