Skip to content

fix(code): verify remote state before classifying push divergence - #123

Merged
danii1 merged 2 commits into
mainfrom
fix/prepush-false-divergence
Sep 2, 2026
Merged

fix(code): verify remote state before classifying push divergence#123
danii1 merged 2 commits into
mainfrom
fix/prepush-false-divergence

Conversation

@danii1

@danii1 danii1 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • classify failed pushes from the current remote ref state instead of rejection-shaped hook/test output
  • preserve failing hook output and the automatic hook-fix path when the remote remains an ancestor of HEAD
  • keep genuine remote races on the divergence/retry path, including force-with-lease failures
  • report handled address-review failures to Sentry before the subprocess exits, with command and PR context
  • report worker-side review subprocess spawn errors and swallowed review/relay handler exceptions with repo, PR, event, and stage context
  • replace the conflict resolver rejection-text fixture with a real concurrent remote update

Why

A failing pre-push test suite can print simulated [rejected] / non-fast-forward diagnostics. The previous combined-output scan mistook those fixture messages for Git own rejection, skipped hook recovery, and reported a false branch divergence.

The address-review CLI then caught the resulting exception and exited explicitly. That bypassed the process-wide unhandled-error handlers, while the parent worker retained only a boolean failure, so Sentry never received the actionable exception.

Test plan

  • bun run test conflict-resolver.test.ts git-hook-fixer.test.ts (47/47)
  • bun run test for @getdevintern/code (1298/1298)
  • pre-commit repo-wide format, lint, and typecheck
  • pre-push repo-wide tests and typecheck

@danii1
danii1 merged commit 8f3fb6f into main Sep 2, 2026
1 check passed
@danii1
danii1 deleted the fix/prepush-false-divergence branch September 2, 2026 07:16
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.

1 participant