Skip to content

fix(PL-5471): preserve release info when commit metadata lookup fails#280

Merged
nwaller-nesto merged 3 commits into
masterfrom
fix/PL-5471/graceful-commit-metadata-error
Jun 22, 2026
Merged

fix(PL-5471): preserve release info when commit metadata lookup fails#280
nwaller-nesto merged 3 commits into
masterfrom
fix/PL-5471/graceful-commit-metadata-error

Conversation

@nwaller-nesto

@nwaller-nesto nwaller-nesto commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What

When GetCommitsMetadata or GetCommitsGitHubAuthors fail during release promote, the error now degrades gracefully instead of producing a malformed commit body.

Why

Previously, these errors propagated up to perform(), which constructed a bare ReleaseInfo with all version and tag fields zeroed. The commit template would then render blank versions and a broken compare URL:

- Promote my-service  → 
  https://github.com/org/my-service/compare/...

GetProjectSourceDir failure was already handled gracefully (storing the error and returning the partial struct). This fix applies the same pattern to the two downstream calls so version/tag fields remain populated and the error is surfaced via the existing # Rendering Errors: footer.

Test Plan

  • Added two unit test cases to TestGetReleaseInfo covering both failure paths
  • Confirmed both cases fail against the unfixed code and pass with the fix

Note

Low Risk
Localized change to promote PR message assembly with tests; no auth or data-path changes, only error-handling behavior for optional enrichment steps.

Overview
getReleaseInfo no longer aborts promote PR rendering when commit history or GitHub author lookups fail. Failures on GetCommitsMetadata and GetCommitsGitHubAuthors now follow the same graceful path as GetProjectSourceDir: the error is stored on ReleaseInfo.Error, the function returns a populated struct (versions, git tags, compare range), and the promote message can still render with the existing # Rendering Errors: footer.

When author lookup fails but commit metadata succeeds, the change continues building the commit list with empty GitHubAuthor fields instead of dropping all release context.

Two TestGetReleaseInfo cases lock in both failure paths.

Reviewed by Cursor Bugbot for commit ffd6227. Bugbot is set up for automated code reviews on this repo. Configure here.

nwaller-nesto and others added 2 commits June 17, 2026 10:05
Add two cases to TestGetReleaseInfo verifying that GetCommitsMetadata
and GetCommitsGitHubAuthors failures leave getReleaseInfo returning a
non-nil ReleaseInfo with version and tag fields intact (rather than
propagating nil, error up to the caller).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When GetCommitsMetadata or GetCommitsGitHubAuthors fail (e.g. because
the gitTagTemplate produces a tag prefix that doesn't exist in the
service's repo), the error previously propagated up to perform(), which
then created a bare ReleaseInfo with all version and tag fields zeroed.
The commit template would render blank versions and a broken compare URL
like https://github.com/org/repo/compare/...

Match the existing graceful pattern used for GetProjectSourceDir failure:
store the error in releaseInfo.Error and return the partial struct so
version/tag fields remain populated and the template renders a valid
(if commit-list-free) body. The error is still surfaced via the
existing '# Rendering Errors:' footer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nwaller-nesto nwaller-nesto marked this pull request as ready for review June 22, 2026 20:15

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 43707fb. Configure here.

Comment thread internal/release/promote/pr_rendering.go Outdated
When GetCommitsGitHubAuthors fails after GetCommitsMetadata succeeds,
fall through to the commit-building loop with a nil authors map instead
of returning early, so the already-fetched commit list is not discarded.
Extend the test to assert commits are preserved with empty GitHubAuthor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nwaller-nesto nwaller-nesto merged commit cb491f8 into master Jun 22, 2026
6 checks passed
@nwaller-nesto nwaller-nesto deleted the fix/PL-5471/graceful-commit-metadata-error branch June 22, 2026 20:24
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