feat(enrichment): add focused-test (.only) analyzer - #3757
Conversation
A `describe.only` / `it.only` / `test.only` committed to a test file silently skips every other test in that file, so CI stays green while most of the suite no longer runs — an easily-missed footgun a reviewer should see. Add a pure, local `focusedTest` analyzer: the test-file counterpart of the debug-leftover analyzer (which scans NON-test source). It flags a `.only` chained onto a known test-block function (`describe`/`context`/`suite`/`it`/ `test`/`specify`) in added lines of changed test files, line-cited via hunk headers. String literals are stripped before matching, so a `.only` inside a string is not flagged, and the function-name restriction keeps an unrelated `stream.only(` from matching. Wired into the registry, response type, and render surface, with regenerated analyzer metadata / UI catalog / env example. Off nothing — additive, defaultEnabled like its siblings.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - reject/close recommendedReview updated: 2026-07-06 07:45:12 UTC
🛑 Suggested Action - Reject/Close
Review summary Blockers
Nits — 5 non-blocking
Why this is blocked
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.
|
|
Gittensory is closing this pull request on the maintainer's behalf (No linked issue detected; Maintainer requires a linked issue; AI reviewers agree on a likely critical defect: The PR's own checklist admits 'No linked issue' — per repo policy every external contributor PR must close or clearly link an eligible open issue, and while the code comments reference '#1499 quality-signal family' as precedent, that is not a formal link/close and should be confirmed with the maintainer before merging as-is.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Summary
A
describe.only/it.only/test.onlyaccidentally committed to a test file silently skips every other test in that file — CI stays green while most of the suite no longer runs. It's an easily-missed footgun that no current analyzer catches: the existingdebug-leftoveranalyzer deliberately skips test files (it targetsdebugger/console/printin non-test source).This adds a new pure, local
focusedTestanalyzer — the test-file counterpart ofdebug-leftover:.onlychained onto a known test-block function (describe/context/suite/it/test/specify) in added lines of changed test files, line-cited via hunk headers.stream.only(never matches; string-literal content is stripped before matching (via the sharedcodeOnly), so a.onlyinside a string isn't flagged; and onlyisTestPathfiles are scanned.defaultEnabledlike its sibling quality analyzers; purely additive..env.exampleregenerated vianpm --prefix review-enrichment run metadata.No linked issue
A self-contained new local analyzer touching only
review-enrichment/(plus the three generated catalog artifacts). It mirrors the accepted pattern and precedent of the sibling quality analyzers (debug-leftover,floating-promise,error-swallow,todo-marker, …). No external behavior changes beyond surfacing the new advisory finding.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coverage— nosrc/**lines changed (the analyzer lives underreview-enrichment/; the only non-review-enrichmentedits are the generatedapps/gittensory-ui/src/lib/rees-analyzers.tscatalog and.env.example, neither measured by Codecov), socodecov/patchhas no diff to gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:version-auditnpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderatereview-enrichment/test/focused-test.test.tscovers every branch: each test-block function, whitespace tolerance, ordinary tests / non-test.only/ embedded-identifier / no-call-paren negatives, string-literal stripping, non-test-file skip, hunk line-citation across context/removed lines, themaxFindingscap, the multi-file entrypoint, and the render section (present with findings, omitted when empty).npm run rees:testpasses (1194 tests; analyzer-metadata check clean); the analyzer-registry stable-order test is updated for the new descriptor.Validated green against the full GitHub CI
validate-codecheck set —actionlint,db:migrations:check,db:schema-drift:check,cf-typegen:check,selfhost:validate-observability,typecheck,test:coverage,test:workers,build:mcp,test:mcp-pack,build:miner,rees:test,ui:openapi:check,ui:openapi:settings-parity,ui:version-audit,ui:lint,ui:typecheck,ui:test,ui:build. Branch rebased on latestmain.Safety
rees-analyzers.tscatalog entry (no route/component change; screenshots N/A).Notes
Modeled end-to-end on the sibling
debug-leftoveranalyzer (#2015): samedetect*+scanPatchFor*+scan*shape, same hunk line-citation, samecodeOnlyliteral stripping, same descriptor/render/registry wiring and generated-artifact regeneration. The two are complementary —debug-leftoverscans non-test source,focusedTestscans test files — and share no overlap.