Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdded a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Greptile SummaryThis PR tightens test isolation for the Codex hook sync suite by introducing a
Confidence Score: 5/5Safe to merge — changes are test-only and all findings are minor style/consistency suggestions. All findings are P2: the first test not using the helper is a low-risk inconsistency (the script it exercises doesn't read the newly-guarded vars today), and the extra CLAUDE_CODE_PACKAGE_MANAGER entry is harmless. No production code is touched, and the hermetic env correctly covers the variables that actually matter for the sync/check test. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Test as codex-hooks.test.js
participant Helper as makeHermeticCodexEnv()
participant Sync as sync-ecc-to-codex.sh
participant MCP as merge-mcp-config.js (Node)
participant Check as check-codex-global-state.sh
Test->>Helper: makeHermeticCodexEnv(homeDir, codexDir)
Helper-->>Test: { HOME, USERPROFILE, CODEX_HOME, AGENTS_HOME, ECC_GLOBAL_HOOKS_DIR, CLAUDE_PACKAGE_MANAGER, CLAUDE_CODE_PACKAGE_MANAGER }
Test->>Sync: runBash(syncScript, ['--update-mcp'], hermeticEnv)
Sync->>MCP: node merge-mcp-config.js (inherits CLAUDE_PACKAGE_MANAGER=npm)
MCP-->>Sync: merged config.toml
Sync-->>Test: exit 0
Test->>Check: runBash(checkScript, [], hermeticEnv)
Check-->>Test: exit 0 + stdout with context7 MCP section match
|
| CLAUDE_PACKAGE_MANAGER: 'npm', | ||
| CLAUDE_CODE_PACKAGE_MANAGER: 'npm', |
There was a problem hiding this comment.
CLAUDE_CODE_PACKAGE_MANAGER is not consumed by any script
CLAUDE_PACKAGE_MANAGER is the env var read by scripts/lib/package-manager.js (line 167). CLAUDE_CODE_PACKAGE_MANAGER only appears as a commented-out example in .env.example and is never read at runtime. Including it is harmless and defensive, but worth a comment so future readers understand the intent rather than wondering whether it's a typo of the active var.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
Testing
Summary by cubic
Make Codex hook sync tests run in a hermetic environment by setting explicit Codex and package manager env. Prevents CI runner state from leaking in and stabilizes the suite.
makeHermeticCodexEnv()to build an isolated env (HOME/USERPROFILE,CODEX_HOME,.agents,ECC_GLOBAL_HOOKS_DIR,CLAUDE_PACKAGE_MANAGER,CLAUDE_CODE_PACKAGE_MANAGER=npm).tests/scripts/codex-hooks.test.js.Written for commit d8c940f. Summary will update on new commits.
Summary by CodeRabbit