[AISOS-2409] Epic status remains "New" after associated features and PRs are merged and closed - #306
Conversation
…and PRs are merged and closed Detailed description: - Transition state's epic_keys to 'In Progress' in setup_workspace - Transition parent Epic of Feature ticket to 'In Progress' in setup_workspace - Transition parent Epic of Feature ticket to 'Closed' in aggregate_feature_status - Wrap transitions in try-except block to gracefully handle transient Jira API errors - Added unit tests test_workspace_setup_transitions_epics_and_parent_epic and test_aggregate_feature_status_transitions_parent_epic Closes: AISOS-2410
Detailed description: - Modified 'docs/guide/feature-workflow.md' to detail automatic Jira status transitions for associated Tasks, Epics, and parent Epics to 'In Progress' at workspace setup/implementation, and to 'Closed' at completion/merge. - Added a new detailed section 'Automatic Jira Status Transitions' to 'docs/guide/labels.md' explaining standard Jira status transitions for Tasks, Epics, Features, and parent Epics. - Updated proposal 'proposals/workflow-status-updates-in-jira.md' and related indexes to mark status as 'Implemented' and include Epics and parent Epics in the design diagram/transitions list. Closes: AISOS-2409-docs
🛠️ Forge PR CommandsThis pull request was created by Forge! You can use the following commands by commenting on this PR:
Feel free to use these commands to manage your workflow! |
eshulman2
left a comment
There was a problem hiding this comment.
Code review
Found 1 issue. See the inline comment below.
🤖 Generated with Claude Code
- If this code review was useful, please react with 👍. Otherwise, react with 👎.
| try: | ||
| feature_issue = await jira.get_issue(ticket_key) | ||
| if feature_issue.parent_key: | ||
| await jira.transition_issue(feature_issue.parent_key, JiraStatus.CLOSED.value) |
There was a problem hiding this comment.
The parent Epic is closed as soon as this Feature completes, without checking whether the Epic's other child Features are done. The sibling function aggregate_epic_status guards its transition with _check_epic_completion(...) before closing an Epic (see L140-L148), but this parent-Epic path skips any completion check.
An Epic with multiple Features will close prematurely when the first Feature merges. This also contradicts the PR's own docs ("automatically transitioned to Closed once all child tickets are merged and completed") and the stated ordering invariant.
Consider gating this on a completion check over the parent Epic's children before transitioning it to Closed.
There was a problem hiding this comment.
Forge implemented this feedback in the latest pushed revision.
|
Forge is addressing PR review feedback now. |
1 similar comment
|
Forge is addressing PR review feedback now. |
Detailed description: - Gated parent Epic completion in aggregate_feature_status on child completion check, ensuring consistency with sibling status aggregation logic and workflow specification. - Updated and added unit tests in test_human_review_completion.py to verify correct behavior when child tickets are incomplete or complete. Closes: AISOS-2409-review-fix
|
Forge is addressing PR review feedback now. |
1 similar comment
|
Forge is addressing PR review feedback now. |
Detailed description: - Gated parent Epic completion in aggregate_feature_status on child completion check, ensuring consistency with sibling status aggregation logic and workflow specification. - Updated _check_epic_completion to support an optional set of completed_keys to ignore when determining completeness. - Integrated completed_keys into aggregate_epic_status and aggregate_feature_status to prevent race conditions caused by asynchronous Jira search indexing delays. - Added comprehensive unit tests in test_human_review_completion.py to verify correct behavior under simulated search lag conditions and when child tickets are incomplete or complete. Closes: AISOS-2409-review-fix
…ility fixes Detailed description: - Added defensive/safe handling for potential None values in epic_keys, implemented_tasks, and task_keys state fields. - Implemented case-insensitive matching for completed keys in _check_epic_completion to ensure robustness against different casing in Jira keys. - Added a robust case-insensitive lag check unit test to verify full coverage. Closes: AISOS-2409-review-review-impl
Address review findings on the cascading Epic status transitions: - Don't close a Feature's parent Epic when get_epic_children returns no results. The Feature is always a child of its parent, so an empty result signals a JQL/hierarchy mismatch rather than a childless Epic; closing on that ambiguity risks a premature transition. Add treat_empty_as_complete (default True, preserving existing callers) and pass False for the parent check. - Document why completed_keys unions tasks, epics, and the Feature key when probing the parent Epic (defensive against varied hierarchies + search lag). - Model the parent Epic's child as the Feature itself in the transition test, and add a regression test for the empty-children skip path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
Summary
This pull request implements cascading status transitions for parent Epics during both the start and completion phases of the automated SDLC orchestrator. By automatically transitioning parent Epics to "In Progress" when implementation begins and to "Closed" when the child features and PRs are successfully completed and merged, it ensures Jira boards reflect the real-time status of high-level Epics without leaving them permanently stuck in the "New" state.
Changes
Core Workflow Transitions
src/forge/workflow/nodes/workspace_setup.py:epic_keysto "In Progress" status.parent_key) to "In Progress".src/forge/workflow/nodes/human_review.py:aggregate_feature_statusto fetch the Feature issue representation.parent_key) to "Closed" status usingJiraStatus.CLOSED.valuegated on a completion check of child tickets.Documentation Updates
docs/guide/feature-workflow.md: Updated to detail automatic status transitions for associated Tasks, Epics, and parent Epics to 'In Progress' during workspace setup, and to 'Closed' at completion/merge.docs/guide/labels.md: Added a new 'Automatic Jira Status Transitions' section explaining standard transitions.proposals/workflow-status-updates-in-jira.md: Marked the proposal status as 'Implemented' and updated related design diagrams and transition lists.Testing Improvements
tests/unit/workflow/nodes/test_workspace_setup.py: Addedtest_workspace_setup_transitions_epics_and_parent_epicto assert correct transitions on tasks, state epic keys, and parent Epics to In Progress.tests/unit/workflow/nodes/test_human_review_completion.py: Added and updated unit tests to verify correct parent Epic transition behavior when child tickets are incomplete or complete.Implementation Notes
X | Nonesyntax instead ofOptional[X]for variable annotations.Testing
ruffformatting/linting andmypystatic typing checks) to ensure standard compliance.Related Tickets
Generated by Forge SDLC Orchestrator
Fixing #305