Add canonical repo fixture builder#327
Conversation
|
Warning Review limit reached
More reviews will be available in 48 minutes and 30 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18b63626d6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cwd, | ||
| encoding: 'utf-8', | ||
| stdio: ['ignore', 'pipe', 'pipe'], | ||
| env: { ...process.env, ...opts.env }, |
There was a problem hiding this comment.
Scrub inherited Git env for fixture commands
When tests are launched from a Git hook or any wrapper that exports GIT_DIR, GIT_WORK_TREE, GIT_INDEX_FILE, etc., this env spread makes every fixture git command ignore the temp cwd and operate against the inherited repository/index instead. In that context the new canonical builder can fail with “no changes” or, worse, mutate the caller’s repo rather than the fixture; clear Git-specific environment variables before merging opts.env so fixture repos are actually isolated.
Useful? React with 👍 / 👎.
Summary
test/helpers/repo-fixture.js, a fluent canonical fixture builder for temporary Git repos.Problem Statement
mkdtemp,git init, identity config, file writes, commits, branches, and merges in every suite.ADR Compliance (Required)
Relevant ADR(s)
Compliance Declaration
Exception Request (Required if deviating)
Architecture Laws Checklist (Hard Gates)
Canonical Truth & Context
--at,--observer,--trust) or deterministically defaulted.Determinism & Provenance
Artifact Hygiene
Contracts & Compatibility
Extension/Effects Safety (if applicable)
Scope Control
Backward Compatibility
Test Plan (Required)
Unit
Integration
npm testDeterminism
Contract/Schema
npm testPolicy Gates
npm run lint npx vitest run test/design-docs.test.js git diff --check npm testSecurity / Trust Impact
execFileSync('git', args)with argv arrays, not shell strings.Performance Impact
test/repo-fixture.test.jspassed in roughly 1.3 seconds locally; fullnpm testpassed.Observability / Debuggability
Operational Notes
18b6362.Linked Issues / Milestones
Reviewer Quick Verdict Block (for maintainers)
MUST (Hard Gates)
SHOULD (Quality)
Verdict