Skip to content

Refactor pre push logic to avoid long-sessions timeouts by git commands#69

Merged
dbrosio3 merged 3 commits into
mainfrom
refactor-pre-push-logic
Jun 28, 2026
Merged

Refactor pre push logic to avoid long-sessions timeouts by git commands#69
dbrosio3 merged 3 commits into
mainfrom
refactor-pre-push-logic

Conversation

@dbrosio3

Copy link
Copy Markdown
Member

This pull request introduces a significant refactor and improvement to the local push workflow, especially around the pushgate push command. The main change is that pushgate push now runs all local checks and confirmation prompts before opening a network session with the remote, using git push --no-verify only after all checks pass. This avoids holding a remote session idle during long local operations and ensures a more robust, testable, and user-friendly experience. The implementation also modularizes the local push gate logic and clarifies documentation throughout the codebase.

Local Push Workflow Refactor and Clarification

Major changes to the push workflow:

  • pushgate push now runs the full local Pushgate workflow—including deterministic checks, warning confirmations, and local AI review—before invoking git push --no-verify, ensuring the remote connection is only opened if all checks pass. [1] [2] [3]
  • The logic for running and confirming local checks has been extracted to a new runLocalPushGate function, improving testability and maintainability.
  • The method for handling skip controls and mapping them to environment variables has been improved and centralized.

Documentation and Interface Updates

  • All relevant documentation files (README.md, docs/architecture/overview.md, docs/architecture/runtime-flow.md, docs/domain/model.md) have been updated to reflect the new workflow, emphasizing that pushgate push runs local checks before the network push and clarifying the behavior of skip controls. [1] [2] [3] [4] [5] [6]

Pre-push Hook Context Extraction

  • The logic for extracting the pushed branch from pre-push hook stdin is now encapsulated in a dedicated module, improving clarity and reusability. [1] [2]

These changes collectively make the push workflow more robust, user-friendly, and easier to maintain.

Pushgate Hook Harness added 3 commits June 28, 2026 16:24
- Add `local-push-gate-run.ts` to handle the local push gate execution, including changed file resolution, deterministic checks, warning confirmation, and local AI review.
- Introduce `pre-push-hook-context.ts` to manage pre-push context and branch parsing from stdin.
- Refactor `pre-push.ts` to utilize the new local push gate workflow, simplifying the decision-making process and removing deprecated run-decision logic.
- Remove `run-decisions.ts` as its functionality has been integrated into the new workflow structure.
- Update tests to reflect changes in the workflow, ensuring proper handling of skip controls and local AI checks.
@dbrosio3 dbrosio3 merged commit 98aeffb into main Jun 28, 2026
1 check passed
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