Skip to content

[AISOS-2199] Task takeover workflow does not transition Jira ticket status after PR merge#160

Merged
eshulman2 merged 3 commits into
forge-sdlc:mainfrom
ekuris-redhat:forge/aisos-2199
Jul 16, 2026
Merged

[AISOS-2199] Task takeover workflow does not transition Jira ticket status after PR merge#160
eshulman2 merged 3 commits into
forge-sdlc:mainfrom
ekuris-redhat:forge/aisos-2199

Conversation

@ekuris-redhat

@ekuris-redhat ekuris-redhat commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

This pull request resolves a critical gap in the task takeover workflow by ensuring that Jira tickets are properly transitioned and labeled when a task is completed after a pull request merge. Previously, the workflow updated only internal states, leaving the ticket status out-of-sync in Jira. With this fix, completed takeover tickets are automatically closed and labeled as approved, ensuring state consistency across systems and reducing manual overhead for developers.

Changes

Workflows

  • src/forge/workflow/task_takeover/graph.py: Updated the complete_task_takeover function to initialize a JiraClient, transition the completed task takeover ticket to JiraStatus.CLOSED, and set the workflow label to ForgeLabel.TASK_REVIEW_APPROVED.
  • Integrated error resilience patterns matching other human-review nodes, wrapping the Jira operations in a try-except block to prevent external Jira failures from crashing the core execution workflow, and ensuring the JiraClient is safely closed in a finally block.

Testing

  • tests/workflow/test_task_takeover_graph.py: Introduced unit tests to validate the updated complete_task_takeover node, testing successful ticket closure and label application, as well as testing that exceptions raised during Jira operations are safely logged as warnings and do not interrupt execution.

Implementation Notes

  • Resilience over Rigidity: In line with the pattern in complete_tasks inside src/forge/workflow/nodes/human_review.py, Jira transition failures are treated as non-fatal. They are logged as warnings rather than raising exceptions, ensuring that a temporary network issue with the Jira API does not block or fail the entire workflow.
  • Resource Management: A standard try-finally block was employed to guarantee that JiraClient.close() is always executed, avoiding leaked HTTP connections or sessions.

Testing

  • Unit Testing: Added unit tests confirming that complete_task_takeover makes the appropriate transition_issue and set_workflow_label calls with the expected arguments.
  • Error Handling Verification: Simulated API failure scenarios to ensure exceptions thrown during the Jira lifecycle are caught, logged, and gracefully bypassed without disrupting workflow termination.

Related Tickets


Generated by Forge SDLC Orchestrator

Detailed description:
- Updated complete_task_takeover in src/forge/workflow/task_takeover/graph.py to transition Jira tickets to CLOSED status and apply ForgeLabel.TASK_REVIEW_APPROVED label.
- Handled errors resiliently to log warnings if Jira client updates fail.
- Ensured proper cleanup by closing JiraClient in a finally block.
- Added comprehensive unit tests validating success and failure flows.

Closes: AISOS-2199
Auto-committed by Forge container fallback.
@eshulman2 eshulman2 added bug Something isn't working area:workflow Workflow graphs, orchestration, state, routing, and gates area:integrations Jira and other external service integrations ready-for-review labels Jul 16, 2026
@ekuris-redhat

Copy link
Copy Markdown
Collaborator Author

Tested locally:

  1. Ran full unit test suite : 1465 passed, no regressions
  2. Triggered a fresh task takeover workflow on AISOS-2206
  3. Workflow completed through PR merge
  4. After merge, complete_task_takeover transitioned the Jira ticket to Closed/Done and set the forge:review-approved label

Before this fix, the ticket status remained unchanged after PR merge.

Comment thread Pipfile Outdated
@@ -0,0 +1,11 @@
[[source]]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is this file needed?

@ekuris-redhat

Copy link
Copy Markdown
Collaborator Author

Forge is addressing PR review feedback now. This status update is informational.

@eshulman2
eshulman2 merged commit b66d044 into forge-sdlc:main Jul 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:integrations Jira and other external service integrations area:workflow Workflow graphs, orchestration, state, routing, and gates bug Something isn't working ready-for-review verified/tested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants