Summary
When iloom creates issues (e.g., epic issues via il plan), it passes labels to gh issue create --label. If the label doesn't exist on the repository, the gh CLI fails with an error. iloom should automatically check for and create missing labels before attempting to create the issue.
Problem
Currently, createIssue() in src/utils/github.ts passes labels directly to the gh CLI without verifying they exist. This causes failures when:
- A user runs
il plan on a fresh repo that doesn't have the epic label
- Any issue creation specifies a label that hasn't been manually created on the repo
This is a self-demonstrating bug — creating this very epic with an epic label fails if the label doesn't exist.
Proposed Solution
Add an ensureLabelsExist() utility function in src/utils/github.ts that:
- Checks if each label exists on the repo using
gh api to query the labels endpoint
- Creates any missing labels using
gh api POST to the labels endpoint
- Is called by
createIssue() before the gh issue create command
This should be a general-purpose solution that works for any label, not just epic.
Key Files
src/utils/github.ts — createIssue() function (line ~247)
src/mcp/GitHubIssueManagementProvider.ts — calls createIssue()
src/utils/github.test.ts — tests for github utilities
Acceptance Criteria
Summary
When iloom creates issues (e.g., epic issues via
il plan), it passes labels togh issue create --label. If the label doesn't exist on the repository, theghCLI fails with an error. iloom should automatically check for and create missing labels before attempting to create the issue.Problem
Currently,
createIssue()insrc/utils/github.tspasses labels directly to theghCLI without verifying they exist. This causes failures when:il planon a fresh repo that doesn't have theepiclabelThis is a self-demonstrating bug — creating this very epic with an
epiclabel fails if the label doesn't exist.Proposed Solution
Add an
ensureLabelsExist()utility function insrc/utils/github.tsthat:gh apito query the labels endpointgh apiPOST to the labels endpointcreateIssue()before thegh issue createcommandThis should be a general-purpose solution that works for any label, not just
epic.Key Files
src/utils/github.ts—createIssue()function (line ~247)src/mcp/GitHubIssueManagementProvider.ts— callscreateIssue()src/utils/github.test.ts— tests for github utilitiesAcceptance Criteria
repoparameter for cross-repo operations