Documentation
¶
Overview ¶
Package feedback builds and sends the reports `volcano feedback` files: a coding agent's (or a person's) account of a problem it hit with Volcano, such as a CLI bug, docs that disagree with the CLI, or a missing command.
A report is the agent's text plus the machine and agent fields a usage event carries (telemetry.Client). It is sent to POST /cli/feedback on the cloud API (volcano-hosting). The server joins a report to the usage events of the same device_id around its timestamp to find the failing command, so the CLI keeps no record of past runs. Feedback follows the telemetry setting unless the user ran `volcano feedback enable` or `disable`. Sending requires a login token, so only Volcano accounts can send reports; while telemetry is off, a report carries no device ID or project ID and is marked anonymous, so the server does not attribute it to the user.
Index ¶
Constants ¶
const ( MaxSummary = 120 MaxDetails = 4000 MaxExpected = 1000 MaxActual = 4000 MaxWorkaround = 2000 MaxCommand = 500 MaxCommands = 10 )
Length limits, in characters.
Variables ¶
var Categories = []string{
"cli_bug",
"docs_mismatch",
"missing_capability",
"platform_error",
"confusing_ux",
"instruction_conflict",
}
Categories are the kinds of problem a report can be about.
Functions ¶
func Send ¶
Send posts payload to apiURL's /cli/feedback, with token as a bearer when it is set. The server rejects a report without a valid token. A nil client uses one with a timeout. The request goes through the API client's shared transport (api.WrapDoer), so --debug traces it and the CLI acts on the response's instructions, such as a reauth notice, as for any API call.
Types ¶
type Input ¶
type Input struct {
Category string `json:"category"`
Summary string `json:"summary"`
Details string `json:"details"`
Expected string `json:"expected"`
Actual string `json:"actual"`
Workaround string `json:"workaround"`
Commands []string `json:"commands"`
}
Input is what the reporter wrote, from flags or from the JSON object `volcano feedback --input` reads.
func ParseInput ¶
ParseInput reads one JSON object with Input's keys from r. Unknown keys, keys that differ from Input's only in case, repeated keys, and anything after the object are errors, so a misspelled key is not silently dropped and no value silently replaces another.
type Report ¶
type Report struct {
// FeedbackID is a UUIDv7 generated here, so the CLI can print it without
// reading the response, and the server can read the time it was made
// from it. Each run generates a new one, so an agent that reruns the
// command after a failed send sends a new ID.
FeedbackID string `json:"feedback_id"`
// Anonymous asks the server not to attribute the report to the logged-in
// user. It is set while telemetry is off.
Anonymous bool `json:"anonymous"`
// DeviceID is empty while telemetry is off, as is ProjectID.
DeviceID string `json:"device_id,omitempty"`
Timestamp string `json:"timestamp"`
Category string `json:"category"`
Summary string `json:"summary"`
Details string `json:"details"`
Expected string `json:"expected,omitempty"`
Actual string `json:"actual,omitempty"`
Workaround string `json:"workaround,omitempty"`
Commands []string `json:"commands"`
CLIVersion string `json:"cli_version"`
OS string `json:"os"`
Arch string `json:"arch"`
Agent string `json:"agent"`
AgentSource string `json:"agent_source"`
PluginInstalled bool `json:"plugin_installed"`
PluginVersion string `json:"plugin_version"`
ProjectID string `json:"project_id,omitempty"`
}
Report is the request body of POST /cli/feedback. Field names are the wire contract with volcano-hosting; the server validates and redacts every value again.