Skip to content

ci(docs): add code->docs environment-variable coverage gate#410

Merged
haksungjang merged 1 commit into
mainfrom
ci/doc-env-forward-gate
Jul 16, 2026
Merged

ci(docs): add code->docs environment-variable coverage gate#410
haksungjang merged 1 commit into
mainfrom
ci/doc-env-forward-gate

Conversation

@haksungjang

Copy link
Copy Markdown
Member

Why

The recent doc-sync audit found user-facing features (including several env vars) that shipped in code but were never documented. tests/check-docs-drift.sh only guards the docs→code direction — a doc that references an env var missing from the code. Nothing checked the reverse: an env var added to the tool with no doc mention. This PR closes that structural gap.

Stacked on #409 (the doc fixes). Base will retarget to main once #409 merges.

What

  • scripts/check-doc-env-coverage.sh: reads the Environment: block of scan-sbom.sh --help (the user-facing env contract) and fails if any variable there is documented in neither docs/reference/cli.md nor docs/reference/docker-image.md.
  • Wired into the Doc Coverage CI job.
  • Applying the gate surfaced one real gap: SBOM_AIBOM_IMAGE was advertised in --help but documented nowhere. Added to the cli.md env table (EN + KO).

Verification

  • bash scripts/check-doc-env-coverage.sh — pass (18 vars, all documented)
  • Negative test: injecting an undocumented var makes the gate fail as expected
  • shellcheck --severity=warning — clean
  • check-docs-drift.sh, mkdocs build --strict — pass

Scope note

The gate checks the EN reference pages, which are the canonical env contract; EN/KO mirror parity stays enforced by the existing convention and drift checks. Extending the gate to assert KO parity for env vars is possible follow-up.

@haksungjang haksungjang changed the base branch from docs/sync-recent-features to main July 16, 2026 02:31
check-docs-drift.sh guards the docs->code direction (a doc referencing an
env var that no longer exists), but nothing checked the reverse: a
user-facing env var added to the tool with no documentation. That is the
gap the recent doc-sync audit surfaced.

Add scripts/check-doc-env-coverage.sh: it reads the "Environment:" block
of scan-sbom.sh --help (the user-facing contract) and fails if any name
there is documented in neither docs/reference/cli.md nor
docs/reference/docker-image.md. Wire it into the Doc Coverage CI job.

Applying the gate found one real gap: SBOM_AIBOM_IMAGE was advertised in
--help but documented nowhere. Add it to the cli.md env table (EN + KO).
@haksungjang haksungjang force-pushed the ci/doc-env-forward-gate branch from cf24b44 to ac23dde Compare July 16, 2026 02:32
@haksungjang haksungjang merged commit 1a1192a into main Jul 16, 2026
34 checks passed
@haksungjang haksungjang deleted the ci/doc-env-forward-gate branch July 16, 2026 02:36
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