Skip to content

fix: update GitHub contract test fixture to a commit the API still associates with a PR#836

Merged
jumboduck merged 1 commit intomainfrom
fix-contract-test
Apr 28, 2026
Merged

fix: update GitHub contract test fixture to a commit the API still associates with a PR#836
jumboduck merged 1 commit intomainfrom
fix-contract-test

Conversation

@jumboduck
Copy link
Copy Markdown
Contributor

GitHub's associatedPullRequests API intermittently drops associations for
older commits. Bump the fixture from e21a8af (PR #6, broken) to
475dd3d (PR #829, recent and verified).

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

…sociates with a PR

GitHub's associatedPullRequests API intermittently drops associations for
older commits. Bump the fixture from e21a8af (PR #6, broken) to
475dd3d (PR #829, recent and verified).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jumboduck jumboduck enabled auto-merge (squash) April 28, 2026 15:47
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 28, 2026

Claude finished @jumboduck's task in 3m 6s —— View job


PR Review: Update GitHub contract test fixture

  • Run static analysis (build, vet, mod tidy)
  • Read changed files and understand the diff
  • Review code quality, correctness, and test coverage
  • Post review feedback

Static Analysis

All checks pass — go build, go vet, and go mod tidy produce no issues.

Review

Verified the new fixture data is correct. gh pr view 829 confirms PR #829 is MERGED with merge commit 475dd3d1fe69f0d64057defeb0504aad2e132e9d, matching the values in the PR. The commit exists in the repo. All 4 call sites (GithubCommitWithPR() and GithubPRNumber()) are updated consistently between the two changed files.

The comment rewrite in testHelpers.go is a nice improvement — the old comment was vague ("for reasons we cannot fathom"), while the new version documents the pattern clearly and keeps a breadcrumb trail of previous values. This will save future debugging time when GitHub inevitably drops another association.

One nit (outside the diff)

In internal/github/github_contract_test.go:136, the hybrid fallback test still hardcodes URL: "https://github.com/kosli-dev/cli/pull/6", but prNumber now comes from testHelpers.GithubPRNumber() which returns 829. The test passes because it compares the fake data against itself, so there's no functional bug — but the PR number and URL are inconsistent, which could confuse a future reader. Worth updating to /pull/829 for consistency (or using fmt.Sprintf with GithubPRNumber()).

Summary

Clean, minimal fix. LGTM with the optional nit above.

@jumboduck jumboduck merged commit a1a1f6e into main Apr 28, 2026
16 checks passed
@jumboduck jumboduck deleted the fix-contract-test branch April 28, 2026 15:54
Comment on lines +40 to +41
// The GitHub API intermittently stops returning PR associations for older commits
// for reasons we cannot fathom. When that happens, update to a more recent commit.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤦

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.

3 participants