Skip to content

[AISOS-2269] review_response_gate ignores GitHub PR review events — only Jira comments can unpause it#195

Open
ekuris-redhat wants to merge 2 commits into
forge-sdlc:mainfrom
ekuris-redhat:forge/aisos-2269
Open

[AISOS-2269] review_response_gate ignores GitHub PR review events — only Jira comments can unpause it#195
ekuris-redhat wants to merge 2 commits into
forge-sdlc:mainfrom
ekuris-redhat:forge/aisos-2269

Conversation

@ekuris-redhat

Copy link
Copy Markdown
Collaborator

Summary

This Pull Request resolves an issue where the orchestrator worker ignores GitHub pull request review and merge events when a workflow is paused at the review_response_gate node, causing the workflow to remain stuck. By consolidating review-related nodes into a shared constant and registering the response gate for external signaling, the orchestrator now correctly unpauses workflows upon receiving GitHub review and merge webhook events. This ensures a consistent, automated developer experience regardless of whether a workflow is resumed via Jira comments or native GitHub events.

Changes

Orchestrator Worker (Core Resumption Logic)

  • Defined a module-level constant _REVIEW_GATES in src/forge/orchestrator/worker.py containing both "human_review_gate" and "review_response_gate".
  • Added "review_response_gate" to _signal_required_nodes to ensure external webhook signals can resume the workflow at this gate.
  • Refactored pull_request_review event checks in _handle_resume_event to match when current_node is in _REVIEW_GATES instead of hardcoding "human_review_gate".
  • Refactored PR merge event checks in _handle_resume_event to match when current_node is in _REVIEW_GATES.

Unit Tests

  • Added a new unit test class TestHandleResumeEventReviewGates in tests/unit/orchestrator/test_worker.py to cover resume and unpause behaviors across review gates.
  • Implemented tests verifying that pull request approvals, reviews, and merges successfully unpause workflows at the review_response_gate.
  • Implemented tests verifying that existing human_review_gate unpause behavior is fully preserved.

Implementation Notes

  • Consolidating "human_review_gate" and "review_response_gate" into the _REVIEW_GATES constant avoids hardcoding and ensures that any future review gates can be easily integrated without duplicating logic.
  • Registering review_response_gate in _signal_required_nodes is required to allow the orchestrator worker to recognize the gate as one requiring external signals and cleanly update state context upon resumption.

Testing

  • Unit Testing: Added unit tests to tests/unit/orchestrator/test_worker.py covering review_response_gate and human_review_gate behavior under various GitHub webhook payloads.
  • Bidirectional Validation: Verified that tests fail when the code changes are reverted, and pass successfully when the changes are applied.
  • Linting & Formatting: Verified that all modified files comply with code quality requirements using ruff.

Related Tickets


Generated by Forge SDLC Orchestrator

…eview events

Detailed description:
- Defined _REVIEW_GATES module-level constant to represent review gates in src/forge/orchestrator/worker.py.
- Added 'review_response_gate' to _signal_required_nodes in src/forge/orchestrator/worker.py so that external signals can resume the workflow at this gate.
- Updated the conditional check for pull_request_review events to support _REVIEW_GATES.
- Updated the conditional check for pull_request merged events to support _REVIEW_GATES.
- Added comprehensive unit tests in tests/unit/orchestrator/test_worker.py to verify resume and unpause behaviors for both 'human_review_gate' and 'review_response_gate' across review and merge events.

[bidirectional: PASS] Verified that tests failed when the fix was reverted, and passed when the fix was applied.

Closes: AISOS-2269-qualreview
ekuris-redhat

This comment was marked as outdated.

ekuris-redhat

This comment was marked as off-topic.

ekuris-redhat

This comment was marked as duplicate.

@ekuris-redhat ekuris-redhat left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the following review issues:

  1. Add review_response_gate to _FRESH_INVOKE_NODES in worker.py so it follows the same resume path as human_review_gate.

  2. Add a review_response_gate entry to the _stage_label_for_node mapping in worker.py so resume ack comments show a proper label.

  3. Add a test for the commented review state at review_response_gate.

  4. Add a test verifying that a PR review event arriving when is_paused=False at review_response_gate is correctly ignored.

- Add review_response_gate to _FRESH_INVOKE_NODES for fresh resume path
- Add review_response_gate to _stage_label_for_node for proper ack labels
- Guard PR review handling with is_paused check to ignore events when
  workflow is already running
- Add test for "commented" review state at review_response_gate
- Add test verifying PR review events are ignored when is_paused=False

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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