Skip to content

Fix hygiene fixture race#638

Merged
flyingrobots merged 1 commit into
mainfrom
fix-type-import-hygiene-fixture-race
Jun 4, 2026
Merged

Fix hygiene fixture race#638
flyingrobots merged 1 commit into
mainfrom
fix-type-import-hygiene-fixture-race

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Jun 4, 2026

Copy link
Copy Markdown
Member

Closes #637.

Summary

  • Stop type-import-hygiene-shape.test.ts from writing transient fixtures under src/domain.
  • Use ESLint.lintText with an existing domain source file as the TypeScript project-service anchor, preserving typed ESLint coverage without creating files matched by broad repo gates.
  • Add regression assertions that the former source-tree hygiene fixture paths do not exist after the lint probes.

Validation

  • RED: npm exec vitest run test/unit/scripts/type-import-hygiene-shape.test.ts failed before the helper change because source-tree fixtures existed during the test.
  • GREEN: npm exec vitest run test/unit/scripts/type-import-hygiene-shape.test.ts
  • Concurrent proof: npm run lint, npm run typecheck, and npm run test:local run at the same time all passed.
  • git diff --check
  • Pre-push IRONCLAD M9 passed, including static gates and npm run test:local with 537 files / 7117 tests.

Summary by CodeRabbit

  • Tests
    • Refactored unit tests to improve reliability and maintainability through streamlined test execution methods.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 282788ac-3fae-4fd7-8ea9-ce7708d9fd1d

📥 Commits

Reviewing files that changed from the base of the PR and between c1586cb and 52a2649.

📒 Files selected for processing (1)
  • test/unit/scripts/type-import-hygiene-shape.test.ts

📝 Walkthrough

Walkthrough

The test refactors away temporary fixture file creation and switches to in-memory ESLint linting via lintText instead of lintFiles, eliminating transient files that interfere with concurrent lint and typecheck commands.

Changes

Type Import Hygiene Test Migration

Layer / File(s) Summary
Convert to in-memory ESLint linting
test/unit/scripts/type-import-hygiene-shape.test.ts
Removed fixture file I/O and added constants, an assertion helper to verify fixture absence, and updated the test setup to lint inline source text with lintText and a static filePath, ensuring no temporary files land under src/domain/**/*

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A test that wrote files to disk,
Now whispers its code through the mist—
No temp files to chase,
No cleanup race,
Just text in memory, crisp! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix hygiene fixture race' accurately describes the main fix: resolving race conditions caused by transient fixtures in the type-import-hygiene-shape test.
Description check ✅ Passed The description covers all required template sections including summary, issue reference (#637), and validation details demonstrating the fix was tested.
Linked Issues check ✅ Passed The PR fully addresses issue #637's acceptance criteria: refactored test uses lintText instead of writing fixtures under src/, adds regression assertions, and validation shows all concurrent runs pass.
Out of Scope Changes check ✅ Passed All changes are scoped to the type-import-hygiene-shape test file and directly address the race condition issue without unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-type-import-hygiene-fixture-race

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

Release Preflight

  • package version: 18.0.0
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If you tag this commit as v18.0.0, release workflow will publish.

@flyingrobots

Copy link
Copy Markdown
Member Author

@codex Code Lawyer activity summary for PR #638.

Source Severity File Lines Finding Outcome
Self-review - - - No diff findings after reviewing git diff origin/main...HEAD. No RED/GREEN fix commit required.
PR threads - - - GraphQL returned 0 review threads and 0 unresolved inline comments. Nothing to resolve.
CodeRabbit global comment Reviewed test/unit/scripts/type-import-hygiene-shape.test.ts L1-L137 CodeRabbit reported no actionable comments. Its generic docstring-coverage warning was reviewed and not classified as a repo-policy finding because this PR changes a test file and local JSDoc enforcement applies to src/ and bin/. No code change.

Validation evidence:

Check Result
git status --porcelain Clean before audit
git fetch origin Completed
gh pr checks 638 All checks pass
git diff --check Passed
npm exec vitest run test/unit/scripts/type-import-hygiene-shape.test.ts Passed, 3 tests
Former fixture path absence check src/domain/type-import-hygiene-fixture.ts and src/domain/template-expression-hygiene-fixture.ts do not exist
npm run lint Passed
npm run typecheck Passed
npm run test:local Passed, 537 files / 7117 tests

Merge gate judgment:

Gate State
CI green Pass
Unresolved review threads Pass, 0 threads
Changes Requested reviews Pass, 0
CodeRabbit cooldown Pass, CodeRabbit status is green and no cooldown comment is present
Local tests/linters Pass
Approvals Locked, 0 approvals

@flyingrobots flyingrobots merged commit be48230 into main Jun 4, 2026
18 checks passed
@flyingrobots flyingrobots deleted the fix-type-import-hygiene-fixture-race branch June 4, 2026 17:10
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.

BAD type-import hygiene test writes transient fixtures under src/domain

1 participant