test(docs-contract): derive autogenerated sidebar dirs from sidebars.js - #747
Closed
hivecommons-hive[bot] wants to merge 1 commit into
Closed
hivecommons-hive[bot] wants to merge 1 commit into
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
The sidebar-title contract in tests/docs-contract.test.mjs restated the autogenerated sidebar directories by hand as ['architectures', 'community'], but sidebars.js declares a third one, resourcesSidebar, from docs/resources. The three docs under it were never checked for a frontmatter title, so losing one would silently degrade the sidebar label to the filename. Derive the list from sidebars.js, the way tests/site-config.test.mjs already does for its directory-existence assertion, and assert the derived list is non-empty so the contract cannot become a no-op. Signed-off-by: hivecommons-hive[bot] <hivecommons-hive@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
Member
|
Superseded by #750, which consolidates this and 14 other test-only coverage PRs into a single reviewable change (commit cherry-picked unmodified, authorship and DCO preserved). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Improvement
tests/docs-contract.test.mjsrestated the autogenerated sidebar directories byhand:
sidebars.jsdeclares a third,resourcesSidebarfromdocs/resources, so thetest
docs in autogenerated sidebar directories declare a titlenever examineddocs/resources/{index,case-studies,radar-reports}.md. A doc under anautogenerated sidebar with no frontmatter
titlefalls back to its filename forthe sidebar label, so that regression was invisible to the suite.
This PR derives the list from
sidebars.js— the same sourcetests/site-config.test.mjsalready uses for its directory-existence assertion —and asserts the derived list is non-empty so a future refactor cannot reduce the
contract to a no-op. Any sidebar added to
sidebars.jsfrom now on is coveredautomatically.
Verification
Revision
b54cf81(main).title: Resourcesfromdocs/resources/index.mdleavesTZ=UTC node --test tests/docs-contract.test.mjsat 6/6 pass.actual: [ 'docs/resources/index.md' ].TZ=UTC node --test→ 1180 pass / 0 fail / 2 todo.npx prettier --check tests/docs-contract.test.mjs→ clean.Tests only; no production code, no data, no workflow file.
Claimed ground
Files:
tests/docs-contract.test.mjs(only). Cluster: the docs-tree /sidebars.js contract. Disjoint from every open hold-gated PR — none touch
tests/docs-contract.test.mjsorsidebars.js.Related Issue
Closes #746
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88