Skip to content

github import --dry-run runs the action verb into the title and emits a dangling comma when an issue has no labels #35

Description

@unbraind

Found while functionally testing pm-github against real data — a --dry-run import of unbraind/pm-cli (19 open issues).

What it prints

  [dry-run] #982 import pm test --remove reports ok:true and removes nothing when … (open, )
  [dry-run] #860 import pm-beads --preserve-source-ids changes source ID casing (open, bug,reliability)

Two defects on the same line (index.ts:2690):

console.error(`  [dry-run] #${issue.number} ${action} ${title} (${status}, ${labels.join(",")})`);
  1. The action verb runs into the title. ${action} ${title} with no separator makes import read as the first word of the issue title — #982 import pm test --remove reports…. For titles that begin with a verb this is genuinely ambiguous, and this is the output an operator reads to decide whether to run the real import.
  2. A dangling comma when there are no labels. labels.join(",") is "" for an unlabelled issue, so the line ends (open, ). Most issues in a real repo are unlabelled, so this is the common case, not the edge case.

Suggested fix

const meta = labels.length > 0 ? `${status}, ${labels.join(",")}` : status;
console.error(`  [dry-run] #${issue.number} ${action}: ${title} (${meta})`);

Giving:

  [dry-run] #982 import: pm test --remove reports ok:true and removes nothing when … (open)
  [dry-run] #860 import: pm-beads --preserve-source-ids changes source ID casing (open, bug,reliability)

The atomic variant at index.ts:2581 has the same verb-adjacency shape (#${entry.issueNumber} ${action} ${entry.title}) and should move with it, and --link-deps output nearby is worth a glance for the same pattern.

Context: the rest of the command is sound

Everything else checked out against real data and is worth recording so this issue is not read as a general reliability concern:

  • github validate resolves the token via the gh CLI, reports remaining API quota with its reset time, and confirms repo accessibility with the HTTP status.
  • github import --dry-run fetched all 19 open issues correctly, classified each as import vs update against existing pm items, and wrote nothing.

Only the rendering of the plan is wrong.

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