Skip to content

1.0 polish: chart rendering, docs accuracy, CI (part of #29) - #35

Open
quinnmil wants to merge 1 commit into
mainfrom
29b-charts-docs-polish
Open

quinnmil wants to merge 1 commit into
mainfrom
29b-charts-docs-polish

Conversation

@quinnmil

Copy link
Copy Markdown
Contributor

Addresses part of #29 (tracking issue — see there for the full checklist; a companion PR handles the remaining structured-output/command-correctness items).

Chart rendering (internal/output/chart.go)

  • Downsampling now keeps the largest-magnitude value per bucket instead of picking one point by index, so a spike between sampled points still shows up in the plotted line.
  • The trailing partial time bucket (the API's most recent, not-yet-closed bucket) is excluded from both the plotted line and Min/Max/Avg, so the stats and the chart describe the same data.
  • Large millisecond stats promote to seconds ("5.7s" instead of "5.7kms").
  • The chart title renders once (styled header) instead of twice (header + the chart library's own caption).
  • Summary: always shows, including a genuine zero, matching the other three stats.
  • New internal/output/chart_test.go covers all five with 13 cases, including a 600-point series with one spike that survives downsampling to 60 points.

Docs & help text

  • README's credentials-path docs now cover macOS/Linux/Windows correctly (os.UserConfigDir returns ~/Library/Application Support on macOS, not ~/.config).
  • scout auth status now prints the config path in use, and the README points at it.
  • Root --help lists anomalies, insights, usage, billing; --from help includes 2w.
  • Added Example: blocks to jobs metrics, traces list, metrics get, endpoints metrics.
  • README's stale hardcoded example ids (an error group, a trace id) now reference "get an id from scout X list" instead, so the examples don't rot.

CI

  • .github/workflows/ci.yml now runs gofmt -l and go vet ./... alongside the existing test/lint jobs. Fixed the one pre-existing unformatted file (internal/output/progress.go) so the new check is unconditional.

Remaining polish

  • scout billing's usage bars now show one block for any nonzero usage (previously rounded to an empty bar below 2.5%).
  • Table cells are capped at 60 display columns with an ellipsis — one long URI no longer stretches a table past a normal terminal width. --json output is uncapped.
  • Chart/metric titles show a decoded endpoint name / the app's name instead of a raw Base64 id or "App Add usage command #6".
  • scout apps show now reports last_reported_at, falling back to the list payload (the single-app API response omits it).
  • API error messages no longer repeat identical text ("Not Found: Not Found").
  • String truncation (tables, span tree, API error bodies) is now grapheme-aware via a shared output.Truncate, so it can't split a multibyte character.
  • scout metrics get / scout endpoints metrics now validate --type client-side with the valid list, instead of round-tripping to the server for a 422 (matching jobs metrics's existing behavior).
  • scout setup <name> now matches case-insensitively, with a clearer error pointing at scout setup for the valid list.

Note on cmd/setup.go

This branch merges in #32 (issue #27's docs-URL fix) so the case-insensitivity fix here composes with the corrected per-framework URLs rather than conflicting with it later — scout setup RAILS now both matches case-insensitively and resolves to the real docs page.

Test plan

  • gofmt -l . (clean, including the previously-unformatted file)
  • go vet ./..., go build, go test -race ./..., golangci-lint run ./... — all clean
  • Live smoke tests: auth status (config path), billing (usage bars), setup RAILS/setup notarealframework, metrics get --type bogus, chart titles with decoded names

🤖 Generated with Claude Code

https://claude.ai/code/session_01BK3fzED9ksTWsvoPfsEwpS

Squashed for a clean rebase onto main after v0.5.0 landed, and reverted
the changelog.d/ fragment system in favor of a direct CHANGELOG.md edit
(dropped per team discussion — more process than this repo's PR
concurrency warrants). Functional content is unchanged from the
original review.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BK3fzED9ksTWsvoPfsEwpS
@quinnmil
quinnmil force-pushed the 29b-charts-docs-polish branch from fb9cd7e to ebbd49f Compare September 11, 2026 17:26
@mitchh456

Copy link
Copy Markdown

This reverts the merged v0.5.0 CHANGELOG entry.

CHANGELOG.md:3 — this branch parents directly on 3aa5f56 ("Bump version to v0.5.0 (#34)"), the commit that added these lines, but the diff replaces ## [0.5.0] - 2026-09-10 and its release summary with ## Pending. On merge the file ends up with two ## Pending headings, no [0.5.0] section at all, and the PR references reverted to the numbers #34 corrected (#23#8, #24#18, #22#20, #21#19). It's a clean edit on the current file, so git reports MERGEABLE and nothing flags it.

The identical clobber is in #36, so fixing one doesn't fix the other — whichever merges second re-applies it. #32 and #33 branch from the same commit and leave [0.5.0] intact, so this isn't a stale-base artifact.

Is the CHANGELOG restructure intentional? Nothing in the description, the commit message, or #29 mentions it.

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.

1.0 polish: structured output, edge cases, docs accuracy (tracking)

2 participants