Skip to content

test: fix typecheck regression from #404/#405 merge race - #408

Merged
nate-double-u merged 2 commits into
mainfrom
quality/fix-typecheck-merge-race
Nov 16, 2026
Merged

nate-double-u merged 2 commits into
mainfrom
quality/fix-typecheck-merge-race

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Fixes lib/docusaurusConfigPreprocessor.test.mts so npm run typecheck
(and therefore npm run test:unit/test:coverage) passes again on main.

#404 and #405 each passed npm run typecheck independently but merged
~2 minutes apart; combined, config.markdown.preprocessor is destructured
from a value typed DeepPartial<MarkdownConfig> | undefined (Docusaurus's
Config type only requires title/url/baseUrl/future), which TS
now rejects with TS2339 once TS5102 (the baseUrl error #405 fixed) no longer
masks it.

Adds two assert.ok runtime narrowing checks (config.markdown, then
preprocessor) before use — no production code touched, no behavior change,
test file only. Verified locally: npx tsc --noEmit exits 0, and
npm run test:coverage reports 52/52 passing with 100%
stmts/branch/func/line across all included files.

Related Issue

Fixes #407


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88

docusaurus.config.ts's markdown field types as DeepPartial<MarkdownConfig>
| undefined on the Config type, so destructuring config.markdown.preprocessor
without narrowing fails tsc with TS5102-adjacent TS2339 once baseUrl is no
longer masking it.

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
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. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@netlify

netlify Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cncf-techdocs ready!

Name Link
🔨 Latest commit e01c625
🔍 Latest deploy log https://app.netlify.com/projects/cncf-techdocs/deploys/6af74c4f93b7c10c175a38de
😎 Deploy Preview https://deploy-preview-408--cncf-techdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Format checks were failing because the assert.ok() lines added for the
typecheck fix exceeded prettier's line-length preference. Reformat with
npx prettier --write; no behavior change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Independently verified this fix; it looks correct to me. (Note: I'm an automated reviewer — a maintainer still needs to approve.)

  • On current main (418adeb), npx tsc --noEmit fails with exactly the claimed error: lib/docusaurusConfigPreprocessor.test.mts(15,9): error TS2339: Property 'preprocessor' does not exist on type 'DeepPartial<MarkdownConfig> | undefined'.
  • On this branch (e01c625), npx tsc --noEmit exits 0 and npm run test:unit passes 52/52.
  • The diff touches only lib/docusaurusConfigPreprocessor.test.mts, adding two assert.ok narrowing checks before the config.markdown.preprocessor destructure (lines 15–26). docusaurus.config.ts does define markdown.preprocessor, so the assertions cannot fire at runtime; they exist purely to narrow Config['markdown']: DeepPartial<MarkdownConfig> | undefined for the compiler. No production code changes.

The merge-race explanation in the body checks out: #405 fixed TS5102, which unmasked the TS2339 that #404's test file introduces against the Docusaurus Config type. This unblocks typecheck/test:unit on main and seems safe to land.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues for the test-only type-narrowing changes.

No open issues 🎉

What changed in this PR

Fixes the test-only typecheck regression caused by the combined changes in #404 and #405, addressing #407 without changing production code.

Changes:

  • Adds runtime assertions to narrow config.markdown and preprocessor before use.
  • Explains why the optional Docusaurus configuration types require these checks.
File Description
lib/​docusaurusConfigPreprocessor.test.mts Adds type-narrowing assertions and explanatory comments to fix the preprocessor test’s typecheck error.

Review effort: Balanced

@nate-double-u
nate-double-u merged commit 87f3d73 into main Nov 16, 2026
10 checks passed
@nate-double-u
nate-double-u deleted the quality/fix-typecheck-merge-race branch November 16, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] npm run typecheck fails on main — merge race between #404 and #405

2 participants