v0.1.5: fix GhCliReleaseSource list call asking for view-only url field#9
Merged
Conversation
`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>
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.
Summary
gh release list --jsondoesn't accepturl(it's view-only). v0.1.4's list call asked fortagName,name,url,publishedAt,isDraft,isPrerelease; gh exits non-zero withUnknown JSON field: "url",GhProcessthrows, the source's catch-all swallows it, and consumers see "Could not determine the latest release."pl-app update --prereleaseagainst a private repo whose only releases were prereleases — the new flag finally routes through the list path against real gh, exposing the latent bug.nameandurlfrom the list--jsonvalue. Neither was read from the list result (onlytagName,publishedAt,isDraft,isPrereleasedrive filter + sort); the full detail (incl.url,assets) is still fetched per-tag viagh release view.Why this slipped through v0.1.4
Existing
GhCliReleaseSourcetests use a fake gh runner with canned JSON, so they never exercise the real gh CLI's field-validation.gh release listwas only reached when aChannelwas set orIncludePrereleaseswastrueat the source — both uncommon before--prereleaselanded.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--jsonvalue forrelease listdoesn't includeurlorassets. 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— producesNextIteration.SpectreConsole.SelfUpdate.0.1.5.nupkg.pl-app update --prereleaseagainstsoftwareone-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