Skip to content

v0.1.5: fix GhCliReleaseSource list call asking for view-only url field#9

Merged
StuartMeeks merged 1 commit into
mainfrom
fix-gh-list-url-field
May 25, 2026
Merged

v0.1.5: fix GhCliReleaseSource list call asking for view-only url field#9
StuartMeeks merged 1 commit into
mainfrom
fix-gh-list-url-field

Conversation

@StuartMeeks

@StuartMeeks StuartMeeks commented May 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • One-line bug fix: gh release list --json doesn't accept url (it's view-only). v0.1.4's list call asked for tagName,name,url,publishedAt,isDraft,isPrerelease; gh exits non-zero with Unknown JSON field: "url", GhProcess throws, the source's catch-all swallows it, and consumers see "Could not determine the latest release."
  • Surfaced by pl-app update --prerelease against a private repo whose only releases were prereleases — the new flag finally routes through the list path against real gh, exposing the latent bug.
  • Fix: drop name and url from the list --json value. Neither was read from the list result (only tagName, publishedAt, isDraft, isPrerelease drive filter + sort); the full detail (incl. url, assets) is still fetched per-tag via gh release view.

Why this slipped through v0.1.4

Existing GhCliReleaseSource tests use a fake gh runner with canned JSON, so they never exercise the real gh CLI's field-validation. gh release list was only reached when a Channel was set or IncludePrereleases was true at the source — both uncommon before --prerelease landed.

Regression test

Adds GetLatestAsync_list_call_does_not_request_view_only_json_fields — captures the actual arg list passed to the runner and asserts the --json value for release list doesn't include url or assets. Catches regressions at unit-test time without needing real gh.

Test plan

  • dotnet build — clean.
  • dotnet test — 172 passing (171 → 172, +1 regression).
  • dotnet build -c Release — produces NextIteration.SpectreConsole.SelfUpdate.0.1.5.nupkg.
  • Maintainer to verify against the pl-app repro (pl-app update --prerelease against softwareone-platform/swo-adobe-vipm-price-lists, which has prereleases v0.3.0-rc.1 and v0.3.0-rc.2 only) — should now find v0.3.0-rc.2.

🤖 Generated with Claude Code

`gh release list --json` exposes a narrower field set than
`gh release view --json` — notably `url` is view-only. v0.1.4's
list call asked for `tagName,name,url,publishedAt,isDraft,isPrerelease`,
so gh exited non-zero with "Unknown JSON field: \"url\"". GhProcess
threw, GhCliReleaseSource's catch-all swallowed it, and consumers saw
"Could not determine the latest release."

Surfaced by pl-app running `update --prerelease` against a private
repo whose only releases were prereleases — the new flag finally
exercises the list path against real gh, exposing the latent bug.

Fix: drop `name` and `url` from the list `--json` value. Neither was
read from the list result (only tagName/publishedAt/isDraft/isPrerelease
drive filter+sort); the full detail incl. url/assets is still fetched
per-tag via `gh release view`.

Regression test asserts the list args stay within `release list`'s
supported JSON fields — using a fake runner that captures the actual
arg list rather than canned JSON.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@StuartMeeks StuartMeeks merged commit 574e0b1 into main May 25, 2026
4 checks passed
@StuartMeeks StuartMeeks deleted the fix-gh-list-url-field branch May 25, 2026 04:39
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 participant