Skip to content

fix: workflow create command shadowed by generated create#119

Merged
sofq merged 1 commit intomainfrom
fix/workflow-create-shadowed
Apr 15, 2026
Merged

fix: workflow create command shadowed by generated create#119
sofq merged 1 commit intomainfrom
fix/workflow-create-shadowed

Conversation

@sofq
Copy link
Copy Markdown
Owner

@sofq sofq commented Apr 15, 2026

Summary

  • jr workflow create --project KAN --type Task --summary "..." failed with "unknown flag: --project" because the generated workflow create (raw Jira workflow API) shadowed the hand-written convenience command
  • Root cause: root.go's init() called mergeCommand() before workflow.go's init() registered subcommands (Go runs inits alphabetically by filename), so the generated create was copied into the empty hand-written workflowCmd
  • Fix: move RegisterAll() and mergeCommand() from init() to Execute(), which runs after all init() functions complete

Test plan

  • jr workflow create --project KAN --type Task --summary "test" now works
  • All generated subcommands still accessible (e.g. jr workflow get-all)
  • make test passes (unit, integration, e2e)
  • Full manual retest against live Jira instance (assign, transition, comment, link, log-work, move, diff, batch, template, cache, watch)

Move generated.RegisterAll() and mergeCommand() from init() to
Execute() so that all package-level init functions have completed
before merging. Previously, root.go's init ran before workflow.go's
init (alphabetical order), so mergeCommand saw an empty workflowCmd
and copied the generated "create" (raw Jira workflow API) into it.
The hand-written "create" (convenience issue creation) was then
added as a duplicate and Cobra returned the generated one first.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sofq sofq merged commit 8039420 into main Apr 15, 2026
15 checks passed
@sofq sofq deleted the fix/workflow-create-shadowed branch April 15, 2026 14:20
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