Skip to content

test(scm): cover GitHub merged_at detection in listed PRs - #5

Open
stefan-ernst wants to merge 1 commit into
mainfrom
test/github-merged-pr-detection
Open

stefan-ernst wants to merge 1 commit into
mainfrom
test/github-merged-pr-detection

Conversation

@stefan-ernst

Copy link
Copy Markdown
Contributor

Adds regression coverage for Windshiftapp/core#304.

githubPullRequest.toPullRequest() must treat a non-nil merged_at as merged, because GitHub's list endpoint (GET /repos/{owner}/{repo}/pulls) omits the merged field. Without that, SCM sync stores merged PRs as closed and never emits scm_pr_merged or runs smart commits.

The test drives ListPullRequests through an httptest server with list-shaped JSON (no merged key) and covers a merged PR, a closed-unmerged PR, and an open PR, plus the single-PR merged: true path.

Depends on Windshiftapp/core#309 for the production fix. internal/scm is not in the fast lane, so this test runs only in the complete Go suite (./test go), which the nightly core-main compatibility lane exercises; the PR unit job runs the fast lane only.

Commands run:

  • ./test --core <core-with-fix> go -run 'TestGitHubListPullRequestsDetectsMergedFromMergedAt|TestGitHubPullRequestMergedFlagStillHonoured' ./internal/scm
  • ./test --core <core-with-fix> go ./internal/scm
  • bun run scripts/check-public-suite.mjs

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