feat: implement issue #976 — fix(initiative-driver): don't release a sub-issue that is itself an epic (nested-epic-driven-as-story) - #979
Conversation
…sub-issue that is itself an epic (nested-epic-driven-as-story)
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
More reviews will be available in 52 minutes and 14 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a Nested-epic detection and tests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the initiative driver script to prevent releasing nested epics as stories by introducing a sub_issue_numbers helper function and skipping sub-issues that either carry a gate label or have their own sub-issues. Corresponding tests were added to verify this behavior. The review feedback suggests validating that the required positional parameter is provided to the new sub_issue_numbers function to avoid unbound variable errors under set -u.
Dev-Lead — waiting on PR blockers (intent: review-changes)PR: #979 |
|
Note @don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/initiative-driver.sh`:
- Around line 182-186: The skip check in initiative-driver.sh should
short-circuit on GATE_LABEL before calling sub_issue_numbers. Update the logic
around n_children, has_label, and the epic skip branch so gate-labeled items are
detected first and skipped immediately, then only fetch child sub-issues for
non-gate cases. This keeps transient sub-issues lookup failures from affecting
gate-labeled nested epics.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: d5b85d1c-dd58-4bbc-b9dc-dbeed10552b2
📒 Files selected for processing (2)
scripts/initiative-driver.shtests/test_initiative_driver.bats
|
@donpetry-bot review |
|
@don-petry I'm on it — starting a fresh review now. Results will appear in a few minutes. |
Dev-Lead — fix-reviews (applied)Changes committed and pushed. |
|
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-28T02:48:34Z. |
Dev-Lead — waiting on PR blockers (intent: fix-reviews)PR: #979 |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: e9f14ccfbde6ea6446b376872ab89a25294cc675
Review mode: triage-approved (single reviewer)
Summary
Fixes nested-epic mis-release in the initiative driver: drive_epic now skips any child that is itself an epic (carries GATE_LABEL, or has native sub-issues of its own) instead of releasing it as a story. Adds a guarded sub_issue_numbers helper and three new bats tests. Triage cleared this as low-risk; confirmation review agrees.
Linked issue analysis
Closes #976. The change directly implements the requested behavior — an armed nested epic is driven independently via the sweep, so the parent must not implement it as a story (refs the #934/#938 incident, #882). Coverage added for: gate-label skip, native-sub-issue skip, and a plain story still releasing. The cross-repo and blocked_by tests were updated with empty sub_issues mocks to satisfy the new eligibility check.
Findings
No blocking findings.
- gemini-code-assist flagged a possible unbound-variable risk in the new helper under set -u; the head commit guards it with [[ $# -lt 1 ]] -> error+return 1. Resolved.
- CodeRabbit requested that GATE_LABEL be short-circuited before the sub_issue_numbers API call (so a transient lookup failure cannot block a gate-labeled nested epic from being skipped); the head commit checks has_label GATE_LABEL first and only then fetches children. CodeRabbit subsequently APPROVED on the head SHA.
- Script runs under set -euo pipefail and the sweep invokes drive_epic in a ( set -e; ... ) subshell, so the direct n_children assignment correctly aborts only that epic's drive on a transient API error rather than masking it as 'not an epic' — matching the documented intent.
- Secret-scanning MCP tool not exposed in this environment; gitleaks CI passed and the diff contains no secrets.
CI status
All substantive checks green: CI Lint/ShellCheck/Compile/Secret-scan(gitleaks)/Agent Security Scan, Lint (shellcheck, bats, validate-agent-profiles, gh-aw-compile), unit-tests, CodeQL (actions + python), SonarCloud, AgentShield, Holdout Guard, Test-Deletion Guard. Dependency-audit jobs appropriately SKIPPED. The CANCELLED entries are self-superseding agent workflows (dev-lead dispatch/ci-relay, review trigger) under concurrency control, not test failures. mergeStateStatus is BLOCKED only because the org-leads team review is still required — which this approval addresses.
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.



Closes #976
Implemented by dev-lead agent. Please review.
Summary by CodeRabbit