Skip to content

feat(issues): enforce Epic association and in-progress rules#228

Draft
sami-marreed wants to merge 2 commits into
mainfrom
feat/enforce-epic-association
Draft

feat(issues): enforce Epic association and in-progress rules#228
sami-marreed wants to merge 2 commits into
mainfrom
feat/enforce-epic-association

Conversation

@sami-marreed
Copy link
Copy Markdown
Contributor

Feature

Summary

Enforces two issue workflow rules, both in GitHub Actions and in the AI agent commands (Cursor / Claude / Bob):

  • Rule 1 — Epic association required: every non-[Bug], non-[Epic] issue must include Epic: #<n> in its body. Checked on issues.opened and issues.edited; the workflow posts a comment and fails if the line is absent.
  • Rule 2 — Epic must be in-progress first: applying status: todo or status: in-progress to an issue is blocked unless the referenced Epic already carries status: in-progress. The workflow removes the label and posts an explanatory comment if the rule is violated.

Files changed:

File Change
.github/workflows/enforce-issue-epic.yml New GitHub Actions workflow implementing both rules
.cursor/commands/cuga-new-feature.md Require Epic association when creating a new issue
.claude/commands/cuga-new-feature.md Same (mirrored)
.bob/commands/cuga-new-feature.md Same (mirrored)
.cursor/commands/cuga-move-issue.md New command — move an issue to Todo/In-Progress with Epic validation
.claude/commands/cuga-move-issue.md Same (mirrored)
.bob/commands/cuga-move-issue.md Same (mirrored)
CONTRIBUTING.md Document Issue Workflow Rules, status labels, and one-time label setup

One-time repo setup required: create the status: todo and status: in-progress labels (commands in CONTRIBUTING.md).

Testing

  • Tested locally; tests pass

- Add `enforce-issue-epic` GitHub Actions workflow that:
  - Blocks any non-Bug/non-Epic issue opened or edited without an `Epic: #<n>` line
  - Blocks applying `status: todo` or `status: in-progress` to an issue whose
    referenced Epic does not carry `status: in-progress`; also removes the
    premature label and posts an explanatory comment
- Update `cuga-new-feature` agent command (Cursor/Claude/Bob) to require
  Epic association before creating an issue
- Add new `cuga-move-issue` agent command (Cursor/Claude/Bob) that validates
  both rules before applying a status label
- Document Issue Workflow Rules and status label setup in CONTRIBUTING.md

Signed-off-by: Sami Marreed <sami.marreed@ibm.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0b130396-c781-4c11-acd4-6ff7f8cc0990

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/enforce-epic-association

Comment @coderabbitai help to get the list of available commands and usage tips.

Switch the Epic in-progress check from label-based to GitHub Projects Status
field. The workflow now triggers on `projects_v2_item.edited`, reads the issue's
and Epic's Status via GraphQL, and clears the Status field (reverting the move)
if the Epic is not In Progress on the board.

Update cuga-move-issue agent command to query project item Status via
`gh issue view --json projectItems` and use `gh project item-edit` to apply
the new status after validation.

Requires a `PROJECT_TOKEN` secret (PAT with `read:project` + `repo` scopes).

Signed-off-by: Sami Marreed <sami.marreed@ibm.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