Skip to content

Integrate ensureLabelsExist() into createIssue() flow #15

@helixclaw

Description

@helixclaw

Summary

Wire up ensureLabelsExist() into the createIssue() flow so labels are auto-verified/created before gh issue create.

Context

Child issue of #12. Depends on #13 (ensureLabelsExist implementation).

Implementation Details

Changes to createIssue() in src/utils/github.ts

Before the gh issue create command is assembled, add:

let validLabels = labels
if (labels && labels.length > 0) {
  validLabels = await ensureLabelsExist(labels, repo)
}
if (validLabels && validLabels.length > 0) {
  args.push('--label', validLabels.join(','))
}

This replaces the current block at ~line 271:

if (labels && labels.length > 0) {
  args.push('--label', labels.join(','))
}

Acceptance Criteria

  • createIssue() calls ensureLabelsExist() when labels are provided
  • Only validated labels are passed to gh issue create
  • Issue creation succeeds even when some labels can't be created (graceful degradation)
  • createIssueInRepo() wrapper also benefits (delegates to createIssue())
  • Integration test covering the end-to-end flow

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions