Skip to content

fix: use gt rig list --json in bead-links endpoint#33

Open
Ljferrer wants to merge 1 commit into
web3dev1337:masterfrom
Ljferrer:fix/links-use-rig-list-json
Open

fix: use gt rig list --json in bead-links endpoint#33
Ljferrer wants to merge 1 commit into
web3dev1337:masterfrom
Ljferrer:fix/links-use-rig-list-json

Conversation

@Ljferrer
Copy link
Copy Markdown

Summary

/api/bead/:beadId/links was the only rig-enumerating endpoint still parsing the pretty-printed text output of gt rig list.
/api/rigs and /api/setup/status already prefer gt rig list --json with a text fallback — this brings the links endpoint in line.

Why

Parsing structured --json is more robust than scraping display text, which has already drifted once: the legacy two-space-indent
format vs. the current emoji-prefixed format (🟢 RigName) that motivated the parseRigNames helper. Pinning to JSON avoids the
next such break. The text path is kept as a fallback for older gt builds without --json.

Verification

  • Endpoint resolves both rigs end-to-end ([Links] Found rigs: GasTownTower, GigaClip), returns 200.
  • Integration suite green: 127/127.
  • No behavior change for current gt.

The `/api/bead/:beadId/links` endpoint was the only rig-enumerating
endpoint still parsing the pretty-printed text output of `gt rig list`.
`/api/rigs` and `/api/setup/status` already prefer `gt rig list --json`
with a text fallback; this brings the links endpoint in line.

Parsing the structured `--json` output is more robust than scraping
display text (which has already drifted once — the legacy two-space
indent vs. the current emoji-prefixed format that motivated
`parseRigNames`). The text path is retained as a fallback for older
`gt` builds that don't support `--json`.

No behavior change for current `gt`; verified the endpoint still
resolves both rigs end-to-end. Integration suite green (127/127).
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