Repository navigation
fix: flux appsignal incidents list, get and resources read the server's responses - #27
Merged
Merged
Conversation
The server has sent each incident type's listing as AppSignal's own
Markdown ({"type","content"}) since the endpoint was added, either alone
for --type exception/anomaly or one per type under "exceptions" and
"anomalies". The CLI expected a list of structured incidents and failed
to decode every response. It now decodes both shapes and prints the
listings (exceptions first); --json gives [{"type","content"}, ...].
Flux issue: https://app.basecamp.com/5734045/buckets/45557517/todos/10448800497
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A null, empty, missing or otherwise unknown "incidents" value, or a listing without a type, decoded to zero listings, so the CLI printed "No incidents found." (or [] with --json): a false all-clear. These now fail with "unexpected incidents response". Flux issue: https://app.basecamp.com/5734045/buckets/45557517/todos/10448800497 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ponses
Like incidents list, both commands expected structured fields the server
never sent. The server answers {"number","content"} for an incident and
{"sections","content"} for resources, with AppSignal's own Markdown as
content, so get printed an empty header and resources printed nothing.
Both now print that Markdown and give the server's object with --json.
A response without those fields fails with "unexpected incident
response" or "unexpected resources response". The skill's incidents get
example now passes the number as an argument, as the command takes it.
Flux issue: https://app.basecamp.com/5734045/buckets/45557517/todos/10448800497
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
JoeriDijkstra
approved these changes
Oct 28, 2026
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.
Flux issue: https://app.basecamp.com/5734045/buckets/45557517/todos/10448800497
Problem
The CLI's AppSignal read commands (v0.6.0) don't work against flux-test or production:
flux appsignal incidents listfails withfailed to decode response: json: cannot unmarshal object into Go struct field IncidentsResponse.incidents of type []api.Incident.flux appsignal incidents get <N>prints an empty# Incident #N:/State:.flux appsignal resourcesprints nothing.Cause
The CLI drifted. The server hasn't changed: since the AppSignal endpoints were added (eyra/flux c8aa577, 2026-02-05), each one wraps AppSignal's MCP text (Markdown) as
content:GET …/appsignal/incidents,--type exceptionoranomaly:{"incidents": {"type": "exception", "content": "# Exception Incidents\n…"}}GET …/appsignal/incidents, all types (the default):{"incidents": {"exceptions": {…}, "anomalies": {…}}}GET …/appsignal/incidents/:number:{"number": 121, "content": "# Incident #121: ArgumentError\n…"}GET …/appsignal/resources:{"sections": ["users", …], "content": "# Application Resources\n…"}The CLI's AppSignal commands (5910d69, 2026-06-17) were written against structured incidents and resources that no server version ever sent.
Fix (CLI only)
--json:incidents listprints[{"type","content"}, …];incidents getprints{"number","content"};resourcesprints{"sections","content"}.{}, a missing key or field, a listing without a type, and the old structured shapes.incidents getexample now passes the number as an argument, as the command takes it.All commits are
fix:. Merging into master makestag.ymltag and release v0.6.1 (a patch release).Tests and verification
TestListIncidents,TestListIncidentsUnexpectedShape,TestGetIncident,TestGetAppSignalResourcesandTestAppSignalUnexpectedShapes(success and error cases).TestAppSignalIncidentsListandTestAppSignalIncidentsGetAndResources(text and--json).go test -race ./...,go vet ./...andgo mod tidy -diffpass.--app Flux/prod):incidents list(all,--type anomaly,--json),incidents get 121andresources(--sections namespaces,--json).--project next --app Next/next.eyra.co):incidents list,incidents get 1andresources.Not in this PR: the server's
appsignal appslist keeps AppSignal's header and URL lines (Flux issue 10448845294).Pre-reviewed by an AI agent (herdr-projects flux · t-0083, head 8a58d3b): fixed M1 (an unknown, null or missing incidents shape fails with ErrUnexpectedIncidents instead of printing "No incidents found") and L1 (error-case tests); the incidents get and resources delta had no findings.
🤖 Generated with Claude Code
Written by an AI agent (Claude Code · claude-opus-5-5, herdr-projects flux · t-0079).