-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Always checkout github.head_ref #49578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
💊 CI failures summary and remediationsAs of commit 6ade4d2 (more details on the Dr. CI page):
2 failures not recognized by patterns:
🚧 1 fixed upstream failure:These were probably caused by upstream breakages that were already fixed.
Please rebase on the
|
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samestep has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
oh I seem to have broken everything haha |
|
We should probably go ahead with what actions/checkout#27 (comment) suggests which is to upgrade the |
| architecture: x64 | ||
| - name: Fetch PyTorch | ||
| uses: actions/checkout@v1 | ||
| - name: Checkout PR tip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore this.
| architecture: x64 | ||
| - name: Fetch PyTorch | ||
| uses: actions/checkout@v1 | ||
| - name: Checkout PR tip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
| architecture: x64 | ||
| - name: Checkout PyTorch | ||
| uses: actions/checkout@v1 | ||
| with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only reason why this is is the quick-chck branch is missing
- name: Checkout PR tip
while all the others already ensures PR tip
walterddr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually I take it back. your change here adding ref: ${{ github.head_ref }} and the "checkout PR tip" step addresses different thing.
no, they're supposed to address the same thing; the difference is just that my PR doesn't work, whereas yours does 😛 |
|
actually I think you should still address Eli's comment to upgrade to v2. |
@seemethere could you clarify what you meant in your comment earlier?
it was my understanding that the default behavior of the |
|
They were saying that there was an issue in the original v1 where if the base reference is updated before the job actually does its checkout then the job will unknowingly use an updated version of the branch instead of the reference that originally spawned the job. Since we do an explicit checkout of the |
|
@seemethere ah I see, yeah that makes sense 👍 when we upgrade to v2, should we set the version as simply |
|
as of now I think However it would've been nice on the log to printout exact checkout version for reference - in case we need to pin a version, we need to know which version worked previously./ |
Summary: This PR replaces our current "Checkout PR tip" step (which is duplicated across many places) using a [scenario](https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit) from the `actions/checkout` README. We previously tried something similar in #49578, but using `github.head_ref` didn't work. The reason this PR works is because, for events besides `pull_request`, the value of `github.event.pull_request.head.sha` defaults to the empty string, so it's as if we didn't set the `ref` option for `actions/checkout` at all, so it just uses its default behavior (e.g. for `push` events). Incidentally, this PR also upgrades our use of `actions/checkout` from `v1` to `v2`, which introduces shallow clones by default. A couple of our jobs require deep clones, so we use `fetch-depth: 0` in those cases. Pull Request resolved: #53719 Test Plan: CI. Reviewed By: albanD Differential Revision: D26949121 Pulled By: samestep fbshipit-source-id: e06f8066682ae0557fb5a055a10ea33b6bd320db
Summary: This PR replaces our current "Checkout PR tip" step (which is duplicated across many places) using a [scenario](https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit) from the `actions/checkout` README. We previously tried something similar in pytorch#49578, but using `github.head_ref` didn't work. The reason this PR works is because, for events besides `pull_request`, the value of `github.event.pull_request.head.sha` defaults to the empty string, so it's as if we didn't set the `ref` option for `actions/checkout` at all, so it just uses its default behavior (e.g. for `push` events). Incidentally, this PR also upgrades our use of `actions/checkout` from `v1` to `v2`, which introduces shallow clones by default. A couple of our jobs require deep clones, so we use `fetch-depth: 0` in those cases. Pull Request resolved: pytorch#53719 Test Plan: CI. Reviewed By: albanD Differential Revision: D26949121 Pulled By: samestep fbshipit-source-id: e06f8066682ae0557fb5a055a10ea33b6bd320db
This PR was prompted by a surprising divergence between two runs of the same
quick-checksjob:masterwas 6db5e85masterwas ea4ccc7This was caused by
actions/checkout@v1merging intomasterby default, causing nondeterministic CI behavior regardless of the base of the current PR. All our other current jobs mitigate this issue by adding a "Checkout PR tip" step that checks out${{ github.event.pull_request.head.sha }}when on a PR, but that step was missing from thequick-checksjob. This PR replaces all those additional steps with just a bit of extra configuration on theactions/checkout@v1step itself, which is shorter and less error-prone:Solution and discussion can be found here: actions/checkout#27 (comment)