Skip to content

[AISOS-2409] Epic status remains "New" after associated features and PRs are merged and closed - #306

Merged
eshulman2 merged 8 commits into
forge-sdlc:mainfrom
ekuris-redhat:forge/aisos-2409
Aug 19, 2026
Merged

eshulman2 merged 8 commits into
forge-sdlc:mainfrom
ekuris-redhat:forge/aisos-2409

Conversation

@ekuris-redhat

@ekuris-redhat ekuris-redhat commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

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

  • Modified src/forge/workflow/nodes/workspace_setup.py:
    • Added logic to transition state-defined epic_keys to "In Progress" status.
    • Implemented lookup of the Feature/Bug ticket's representation to transition its parent Epic (parent_key) to "In Progress".
    • Wrapped these transitions in safe, error-tolerant try-except blocks to prevent transient Jira API failures from halting workspace setup.
  • Modified src/forge/workflow/nodes/human_review.py:
    • Updated aggregate_feature_status to fetch the Feature issue representation.
    • Configured automatic transition of the Feature's parent Epic (parent_key) to "Closed" status using JiraStatus.CLOSED.value gated on a completion check of child tickets.
    • Wrapped transition and fetching logic in safe try-except blocks to gracefully handle API errors.

Documentation Updates

  • Modified 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.
  • Modified docs/guide/labels.md: Added a new 'Automatic Jira Status Transitions' section explaining standard transitions.
  • Modified proposals/workflow-status-updates-in-jira.md: Marked the proposal status as 'Implemented' and updated related design diagrams and transition lists.

Testing Improvements

  • Modified tests/unit/workflow/nodes/test_workspace_setup.py: Added test_workspace_setup_transitions_epics_and_parent_epic to assert correct transitions on tasks, state epic keys, and parent Epics to In Progress.
  • Modified 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

  • Ordering Invariant: Strictly honors the hierarchical rule that child tasks and Features are completed/processed before transitioning parent Epics to "Closed", preventing invalid Jira workflow states.
  • Error Isolation: Wrapped all Jira transitions in safe try-except blocks with warnings to isolate critical node logic from external Jira API rate limits or transient failures.
  • Type Compatibility: Used modern Python X | None syntax instead of Optional[X] for variable annotations.

Testing

  • Unit Tests: Implemented robust unit tests validating cascading status transition logic on both the workspace setup and human review completion nodes.
  • Verification: Executed the full unit test suite (over 2,000 unit tests successfully passed) and ran code quality checks (ruff formatting/linting and mypy static typing checks) to ensure standard compliance.

Related Tickets


Generated by Forge SDLC Orchestrator
Fixing #305

…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
@ekuris-redhat

Copy link
Copy Markdown
Collaborator Author

🛠️ Forge PR Commands

This pull request was created by Forge! You can use the following commands by commenting on this PR:

  • /forge rebase - Merge the base branch (e.g. main) into this PR branch, with conflicts resolved by AI.
  • /forge skip-gate <name> - Skip a named CI check (substring match) for this PR. This setting persists across subsequent pushes.
  • /forge unskip-gate <name> - Remove a previously set CI check skip.

Feel free to use these commands to manage your workflow!

@eshulman2 eshulman2 left a comment

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.

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)

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.

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.

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.

Forge implemented this feedback in the latest pushed revision.

@forgeSmith-bot

Copy link
Copy Markdown
Collaborator

Forge is addressing PR review feedback now.

1 similar comment
@forgeSmith-bot

Copy link
Copy Markdown
Collaborator

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
@forgeSmith-bot

Copy link
Copy Markdown
Collaborator

Forge is addressing PR review feedback now.

1 similar comment
@forgeSmith-bot

Copy link
Copy Markdown
Collaborator

Forge is addressing PR review feedback now.

ekuris-redhat and others added 5 commits August 17, 2026 13:47
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>
@eshulman2

Copy link
Copy Markdown
Collaborator

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants