Commit graph

6 commits

Author SHA1 Message Date
Babak K. Shandiz
0c0d316b9a
test(discussion create): consolidate into TestCreateRun table test
- Merge TestCreateRun_nonInteractive, TestCreateRun_tty, and related tests
  into a single TestCreateRun table with 11 cases
- Add partial-flag cases for missing title, body, and category
- Add tty blank body returns error case
- Add tty does not prompt when all flags provided case

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-07 09:08:51 +01:00
Babak K. Shandiz
47cabb26ae
fix(discussion create): remove success message from stderr
Only print the discussion URL to stdout. No additional output on stderr.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-07 09:08:51 +01:00
Babak K. Shandiz
bdceb21248
fix(discussion create): allow --repo override
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-05-07 08:58:53 +01:00
Babak K. Shandiz
3850cacb55
fix(discussion create): improve validation and output behavior
- Move non-interactive flag validation to arg parsing stage
- Add blank title/body/category validation at flag parsing
- Keep interactive blank-title/body checks after prompts
- Always print URL to stdout; success message to stderr in TTY mode
- Consolidate test cases and add isTTY field

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-07 08:46:07 +01:00
Max Beizer
a1fd235755
fix: label atomicity, validation order, blankAllowed, help text
- Resolve labels before creating discussion so a bad label name
  doesn't leave an orphaned discussion (atomicity fix)
- Validate --title/--category/--body non-interactively before calling
  ListCategories to avoid an unnecessary network round-trip
- Set blankAllowed=false so the markdown editor rejects empty bodies
- Clarify help text: --body is required when not running interactively
- Update tests to match new behavior; rename label-not-found test to
  make the atomicity guarantee explicit

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:29:12 -05:00
Max Beizer
e471f3f8f1
feat: add gh discussion create command
Implements the 'gh discussion create' CLI command, wiring up the
already-merged Create client method. Supports:
- --title/-t, --body/-b, --category/-c, --label/-l flags
- Interactive prompting when TTY and required flags are missing
- Non-TTY mode requiring all flags
- TTY and non-TTY output formats

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 14:52:07 -05:00