Skip to content

[WIP] Add hidden fly ticket command for support-ticket submission - #5040

Draft
eliferrous wants to merge 1 commit into
masterfrom
claude/refine-local-plan-10tbq4
Draft

[WIP] Add hidden fly ticket command for support-ticket submission#5040
eliferrous wants to merge 1 commit into
masterfrom
claude/refine-local-plan-10tbq4

Conversation

@eliferrous

Copy link
Copy Markdown
Contributor

Change Summary

What and Why:

Support tickets can currently only be filed through the dashboard's LiveView form. This PR stakes out the CLI side of a fly ticket command so tickets can be filed from the terminal by humans and by agents (error contextualization) alike. This first commit is a CLI mockup only: a hidden fly ticket namespace (aliased fly mayday) whose create subcommand runs the full UX — flags, stdin body, prompts, validation — and then dry-run prints the composed request payload with a "not wired up yet" notice. The command stays hidden until the backing endpoint ships (prior art: hidden secrets keys).

How:

  • New internal/command/ticket package following the internal/command/incidents shape: parent group command with nil runner, create subcommand with RequireSession + LoadAppNameIfPresent.
  • Fully flag-drivable for agent use: --subject, --message/-m, --priority low|high|emergency, --category, --product, --mpg-cluster-id, plus standard --app/--org/--json. Category/product have shell completions matching the dashboard enums.
  • Body resolution order: --message → piped stdin → interactive prompt → NonInteractiveError.
  • Validation mirrors the dashboard form: message 10–5000 chars, priority enum.
  • CreateTicketRequest in create.go is the proposed body for POST /api/v1/organizations/:org_slug/support/tickets; org is deliberately a path param (so the API's macaroon org authorization resolves it) rather than a body field. --json emits {dry_run: true, org, ticket}.
  • Registered in root under more_help; hidden commands register normally.
  • Known/accepted cmd/audit lint hit: inconsistent-aliases flags the mayday alias because fly tokens 3p ticket shares the name ticket (lint is not CI-enforced; no other new findings).

Follow-ups (not in this PR):

  1. API endpoint: POST /api/v1/organizations/:org_slug/support/tickets — thin controller that validates into the existing support-request form, maps priority → Plain impact/emergency (emergency→P0, high→degraded_performance/P1, low→general_issue/P2), enqueues the existing SupportFormWorker, and responds {ticket_ref, url}; non-entitled orgs get a structured "no support plan" response with community/upgrade URLs. Tier gating stays server-side.
  2. Identity (open question): the worker needs user_email/full_name; the macaroon API pipeline resolves org, not user, and agents hold org/deploy tokens.
  3. flyctl wiring: new internal/uiex method, replace the dry run with the real call, unhide the command.
  4. Diagnostics: opt-in --attach-diagnostics (candidates: latest ~/.fly/logs/flyctl-*.log, the fly doctor diag zip flow, Plain attachment uploads); $EDITOR body authoring.

Related to:

Design discussion with Eli on CLI support-ticket submission.


Documentation

  • Fresh Produce
  • In superfly/docs, or asked for help from docs team
  • n/a (command is hidden until the endpoint ships)

🤖 Generated with Claude Code

https://claude.ai/code/session_01NzNAbdQJfbjEeTTbQBmcwy


Generated by Claude Code

Adds a new 'fly ticket' namespace (aliased as 'fly mayday') with a
'create' subcommand for filing support tickets from the CLI. The
command is hidden until the backing support API endpoint ships.

'ticket create' is fully flag-drivable for agent use (--subject,
--message, --priority, --category, --product, --mpg-cluster-id,
--json), reads the ticket body from stdin when piped, and falls back
to an interactive prompt. It validates like the dashboard form
(message 10-5000 chars, priority low|high|emergency), then dry-run
prints the composed request payload with a notice that submission
isn't wired up yet. The CreateTicketRequest struct is the proposed
body for POST /api/v1/organizations/:org_slug/support/tickets, with
the org as a path param.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NzNAbdQJfbjEeTTbQBmcwy
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.

2 participants