Skip to content

Use test merge commits for package state - #1328

Open
Jake Bailey (jakebailey) wants to merge 3 commits into
microsoft:mainfrom
jakebailey:fix-mergebot-potential-merge-commit
Open

Use test merge commits for package state#1328
Jake Bailey (jakebailey) wants to merge 3 commits into
microsoft:mainfrom
jakebailey:fix-mergebot-potential-merge-commit

Conversation

@jakebailey

Copy link
Copy Markdown
Member

If someone sends a PR from and old commit, then we'll get author data wrong. Use the GitHub generated merge commit instead.

Capture PR 75475 demonstrating that a stale pull request head is incorrectly interpreted as changing package owners.
Read proposed package metadata from GitHub's generated test merge commit instead of the raw pull request head. Verify that its parents match the reported base and head before trusting it, and fail closed when it is unavailable.

Copilot AI 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.

Pull request overview

Uses GitHub’s generated merge commit when deriving package state, preventing stale PR bases from producing incorrect ownership data.

Changes:

  • Queries and validates potentialMergeCommit.
  • Uses its tree for package-state lookups.
  • Adds generated GraphQL artifacts, validation tests, and fixture coverage.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/mergebot/src/pr-info.ts Validates and uses the merge commit.
packages/mergebot/src/queries/pr-query.ts Queries merge commit metadata.
packages/mergebot/src/queries/schema/graphql.ts Updates generated GraphQL types/document.
packages/mergebot/src/queries/schema/gql.ts Updates generated query mappings.
packages/mergebot/src/_tests/fixturedActions.test.ts Adds compatibility and validation tests.
packages/mergebot/src/_tests/fixtures/75475/_response.json Records the GraphQL response.
packages/mergebot/src/_tests/fixtures/75475/_files.json Records base and merge-tree files.
packages/mergebot/src/_tests/fixtures/75475/_downloads.json Records package downloads.
packages/mergebot/src/_tests/fixtures/75475/derived.json Records derived state.
packages/mergebot/src/_tests/fixtures/75475/result.json Records expected actions.
packages/mergebot/src/_tests/fixtures/75475/mutations.json Records expected mutations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/mergebot/src/pr-info.ts Outdated
Use the trusted base tree as placeholder package state when GitHub cannot create a test merge commit due to conflicts. The conflict still blocks merging until the author resolves it.

Copilot AI 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.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

@jakebailey

Copy link
Copy Markdown
Member Author

I think this is fine but it rarely happens that anyone sends a PR from an ancient fork, it just happened during my week and I thought it was fixable.

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