Skip to content

Problematic use of baseRefOid to get the merge base commit in trymerge #104713

@huydhn

Description

@huydhn

🐛 Describe the bug

The problem

I notice a curious discrepancy between Dr.CI and trymerge in #104121 where Dr.CI correctly identified inductor_torchbench as a broken trunk failure but trymerge didn't. Taking a closer look, it turns out that Dr.CI and trymerge used 2 different commits as the merge base.

curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <TOKEN>"\
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/pytorch/pytorch/compare/1cb87771c1efef32df7009d75bed08249df8ecad...main

This can be easily verify by running @pytorchbot rebase on a PR, Dr.CI merge_base_commit would point to the head of viable/strict as it should be while baseRefOid would point to the head of PyTorch main, the PR target branch.

Yet more problem

I tried to switch trymerge to use the same comparison API as Dr.CI, however, there is another problem in the discrepancy between GitHub GraphQL and its REST API. https://docs.github.com/en/graphql/reference/objects#comparison was added quite recently https://docs.github.com/en/graphql/overview/changelog#schema-changes-for-2022-10-18-1 and it seems to lack the merge_base_commit information returned by the REST API

Conclusion

  • Dr.CI gets the correct merge base
  • Rebase works but it might lead to a discrepancy in detecting broken trunk jobs between Dr.CI and trymerge

Versions

PyTorch CI, trymerge

cc @ZainRizvi @kit1980 @clee2000

Metadata

Metadata

Assignees

Labels

module: devxRelated to PyTorch contribution experience (HUD, pytorchbot)triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions