[WIP] Add hidden fly ticket command for support-ticket submission - #5040
Draft
eliferrous wants to merge 1 commit into
Draft
[WIP] Add hidden fly ticket command for support-ticket submission#5040eliferrous wants to merge 1 commit into
fly ticket command for support-ticket submission#5040eliferrous wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ticketcommand 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 hiddenfly ticketnamespace (aliasedfly mayday) whosecreatesubcommand 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: hiddensecrets keys).How:
internal/command/ticketpackage following theinternal/command/incidentsshape: parent group command with nil runner,createsubcommand withRequireSession+LoadAppNameIfPresent.--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.--message→ piped stdin → interactive prompt →NonInteractiveError.CreateTicketRequestincreate.gois the proposed body forPOST /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.--jsonemits{dry_run: true, org, ticket}.more_help; hidden commands register normally.cmd/audit linthit:inconsistent-aliasesflags themaydayalias becausefly tokens 3p ticketshares the nameticket(lint is not CI-enforced; no other new findings).Follow-ups (not in this PR):
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 existingSupportFormWorker, and responds{ticket_ref, url}; non-entitled orgs get a structured "no support plan" response with community/upgrade URLs. Tier gating stays server-side.user_email/full_name; the macaroon API pipeline resolves org, not user, and agents hold org/deploy tokens.internal/uiexmethod, replace the dry run with the real call, unhide the command.--attach-diagnostics(candidates: latest~/.fly/logs/flyctl-*.log, thefly doctor diagzip flow, Plain attachment uploads);$EDITORbody authoring.Related to:
Design discussion with Eli on CLI support-ticket submission.
Documentation
🤖 Generated with Claude Code
https://claude.ai/code/session_01NzNAbdQJfbjEeTTbQBmcwy
Generated by Claude Code