test(docs): verify branch-analysis and scoreability examples against real schemas - #3065
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 62b746d | Commit Preview URL Branch Preview URL |
Jul 04 2026, 11:20 AM |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-04 11:47:51 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3065 +/- ##
=======================================
Coverage 96.08% 96.08%
=======================================
Files 264 264
Lines 29036 29036
Branches 10576 10576
=======================================
Hits 27899 27899
Misses 493 493
Partials 644 644
🚀 New features to boost your workflow:
|
…real schemas Export localBranchAnalysisSchema from src/api/routes.ts and add a test that reads the live docs.branch-analysis.tsx and docs.scoreability.tsx source at test time, extracts their embedded JSON examples via brace-depth counting, and validates them against the real backing schema/type. Also corrects both docs examples, which still had the pre-fix drifted shapes (nested repo/refs object, linked_issues snake_case, and a fabricated risk_adjusted_priority field) against the current strict Zod schema and ScorePreviewResult type.
62b746d to
6fc0898
Compare
Summary
docs.branch-analysis.tsxanddocs.scoreability.tsxeach embed a hand-typed JSON example that's supposed to mirror a real backing schema/type (localBranchAnalysisSchemainsrc/api/routes.ts,ScorePreviewResultinsrc/scoring/preview.ts). Both drifted before and were only caught by a manual audit (PR docs(gittensory-ui): fix stale website docs and add a CI docs-drift check #3059), with nothing stopping it happening again.localBranchAnalysisSchemafromsrc/api/routes.ts(one-lineexportaddition, no logic change) and addstest/unit/docs-examples-schema.test.ts, which reads the live docs page source at test time, extracts the embedded JSON example via brace-depth counting, and validates it against the real schema/type. A future hand-edit that drifts either example now fails a test immediately.Notes on scope
This PR originally also fixed both docs pages' examples directly, since when I first branched, they hadn't been fixed yet. Sibling PR #3059 (fixes #3047) independently fixed the same two pages as part of its own broader docs audit and merged first — I rebased this branch on top of it, and the docs-page changes became a clean no-op (main's content already satisfies this test). The diff is now exactly two files: the
exportkeyword and the new test.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.md; nosite//CNAME/VitePress changes.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coverage— full unsharded run, 8471 passed / 7 skipped across 420 files, exit 0 (vianpm run test:ci)npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:check— no diffnpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderate— 0 vulnerabilitiestest/unit/docs-examples-schema.test.ts's two cases are the new coverage — a full schema parse for branch-analysis, and top-level-key/enum-membership checks for the deliberately-trimmed scoreability example.Safety
exportonly changes what's importable, confirmed viaui:openapi:checkproducing no diff.mainvia docs(gittensory-ui): fix stale website docs and add a CI docs-drift check #3059; this PR only adds the regression test.UI Evidence
N/A — test-only change plus a one-line
exportkeyword in a backend file. No visual delta.