[codex] fix merger post-rebase CI polling#105
Merged
Conversation
DiffGuard AI AnalysisAI Review Summary🏆 Overall Score: 88/100 This PR adds a critical smoke test for the merger success path and fixes a variable scoping issue in the shell script. The implementation is solid with a focused scope, though the test setup complexity presents minor maintainability concerns. ✅ Key Strengths
|
| Bug Name | Affected Files | Description | Confidence |
|---|---|---|---|
| Variable Scoping | scripts/night-watch-merger-cron.sh |
The local declaration on ci_waited and ci_poll inside the loop check would cause logic failures in nested function calls (subshells) where the variables would be isolated from the polling logic. |
High 🟢 |
📋 Issues Found
| Issue Type | Issue Name | Affected Components | Description | Impact/Severity |
|---|---|---|---|---|
| Maintainability | Inline Mock Complexity | core-flow-smoke.test.ts |
The mock gh and sleep scripts are defined inline with 40+ line strings, making the test harder to scan and maintain. |
Low |
| Testing | Implementation Coupling | core-flow-smoke.test.ts |
The sleep mock explicitly checks for argument 15, tying the test to the specific ci_poll value in the script. |
Low |
🔚 Conclusion
This is a well-structured PR that fixes a genuine bug while adding valuable test coverage. The bug fix is critical for correct polling behavior, and the test effectively validates the happy path. Merge recommended after the bug fix is confirmed, with test maintainability as a minor follow-up.
Analyzed using z-ai/glm-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
localdeclarations from the merger script post-rebase CI polling blockRoot Cause
localis only valid inside Bash functions. The merger loop usedlocalafter a successful rebase, so an otherwise eligible PR could fail before reachinggh pr merge.Validation
yarn workspace @jonit-dev/night-watch-cli vitest run src/__tests__/scripts/core-flow-smoke.test.ts -t "merger should merge"bash -n scripts/night-watch-merger-cron.shyarn workspace @jonit-dev/night-watch-cli vitest run src/__tests__/scripts/core-flow-smoke.test.ts src/__tests__/scripts/night-watch-helpers.test.ts src/__tests__/scripts/helpers.test.tsturbo run verifyand lint-staged tasks