fix: don't dereference a nil release when the post-create lookup fails - #722
Open
NickJosevski wants to merge 1 commit into
Open
fix: don't dereference a nil release when the post-create lookup fails#722NickJosevski wants to merge 1 commit into
NickJosevski wants to merge 1 commit into
Conversation
ReleaseService.GetByID returns (nil, err) on failure, so the warning branch after a successful create panicked instead of printing the warning: it read Assembled and ReleaseNotes off the nil result. A transient server error immediately after the release was created took the CLI down with a nil pointer dereference. Print the version with empty details instead, and treat a nil release with no error as a lookup failure too. Co-Authored-By: Claude Opus 5 (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.
ReleaseService.GetByIDreturns(nil, err)on failure, but the warning branch after a successfulrelease createreadAssembledandReleaseNotesoff that nil result:So a transient server error in the window immediately after the release was created took the CLI down with a nil pointer dereference, instead of printing the warning that line was written to print. The release itself exists by that point, so the version still needs reporting.
Prints the version with empty details instead, and treats a nil release with no error as a lookup failure too.
Provenance
Pre-existing on
main; found while reviewing #703 and originally fixed there. Lifting it into its own PR so it isn't gated on that stack, which isn't intended to merge as-is.Verification
New
release creation warns, rather than panicking, when the post-create lookup failscovers it: the post-createGETresponds 500, and the command is expected to warn and still report the version. Confirmed it's a genuine regression test — reverting thecreate.gochange makes it fail withpanic: runtime error: invalid memory address or nil pointer dereference.go build ./...clean,go test ./pkg/...green.🤖 Generated with Claude Code