-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Rebase xla job on top master before running CI build. #36852
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
💊 Build failures summary and remediationsAs of commit 0b7fe74 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker. This comment has been revised 18 times. |
086231c
to
a99ffd8
Compare
a99ffd8
to
4988bf2
Compare
.circleci/config.yml
Outdated
PR_NUM=$(basename $CIRCLE_PULL_REQUEST) | ||
CIRCLE_PR_BASE_BRANCH=$(curl -s https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$PR_NUM | jq -r '.base.ref') | ||
echo "Rebase on top of $CIRCLE_PR_BASE_BRANCH branch before building in environment $BUILD_ENVIRONMENT" | ||
if [[ "${CIRCLE_PR_BASE_BRANCH}" == "master" ]]; then |
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.
Why we would like to have separate handling for master based PR?
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.
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.
master is not broken too often but we don't want chain failure where all CI fails as soon as master break I think.
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.
It should be based off of the base branch that the PR is basing its changes off of.
Hardcoding origin/master
should never be an option because that immediately breaks as soon as we do a release branch.
if [[ "${CIRCLE_PR_BASE_BRANCH}" == "master" ]]; then | ||
git rebase "${REBASE_TARGET}" | ||
else | ||
git rebase "origin/${CIRCLE_PR_BASE_BRANCH}" |
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.
You should just merge with master here, there's no reason to actually do a rebase. The rebase is more likely to fail as each individual commit in the PR must merge cleanly.
We already have some existing logic for merging with master:
# TODO We may want to move the rebase logic to a separate step after checkout
# Rebase to master only if in xenial_py3_6_gcc5_4 case
if [[ "${CIRCLE_BRANCH}" != "master" && "${BUILD_ENVIRONMENT}" == *"gcc5"* ]]; then
is there any reason this couldn't have been reused in this case?
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.
Hmmm no particular reason, I just thought rebase would be cleaner and easier than a merge :P
Yea I can revert it back to merging :D
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.
Like I commented before, you should merge with whatever the base branch is for the PR.
If a base branch isn't available then it's a no-op.
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.
@seemethere What do you mean by base branch for the PR
? Do you mean CIRCLE_PR_BASE_BRANCH
? It's indeed origin/master
if you are merging into master, and it'll be release/1.5
if you want to merge into release/1.5
. This is totally fine for release branches right?
Note this code block is also guarded by CIRCLE_PULL_REQUEST
that it only runs on PRs not branches.
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.
Don't actually rebase?
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'd highly recommend against hardcoding any merge / rebase logic against origin/master
as it's likely to break whenever we do release branches.
We've already experienced this with 1.5.0
and we wouldn't like to repeat the exercise again for future releases.
.circleci/config.yml
Outdated
PR_NUM=$(basename $CIRCLE_PULL_REQUEST) | ||
CIRCLE_PR_BASE_BRANCH=$(curl -s https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$PR_NUM | jq -r '.base.ref') | ||
echo "Rebase on top of $CIRCLE_PR_BASE_BRANCH branch before building in environment $BUILD_ENVIRONMENT" | ||
if [[ "${CIRCLE_PR_BASE_BRANCH}" == "master" ]]; then |
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.
It should be based off of the base branch that the PR is basing its changes off of.
Hardcoding origin/master
should never be an option because that immediately breaks as soon as we do a release branch.
if [[ "${CIRCLE_PR_BASE_BRANCH}" == "master" ]]; then | ||
git rebase "${REBASE_TARGET}" | ||
else | ||
git rebase "origin/${CIRCLE_PR_BASE_BRANCH}" |
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.
Like I commented before, you should merge with whatever the base branch is for the PR.
If a base branch isn't available then it's a no-op.
1fa4cf7
to
0b7fe74
Compare
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.
@ailzhang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This PR tries to rebase on top of origin/master before building xla job.
I also saw a TODO in existing code which does a very similar thing (rebase on master for gcc5 jobs), so I just fixed the TODO by moving the logic into a separate step.
Currently the logic is:
For these gcc5 and xla jobs, we rebase on top of "target" branch before building.
viable/strict
if we want. But after a second thought, how quicklyviable/strict
moves forward is not controlled only by xla job, and it's hard to predict how long the breakage will last if it's not moving. But we do have control over how long a xla breakage lasts onorigin/master
(which should be short since we monitor it closely). So I currently want to keeporigin/master
and move toviable/strict
when it's super stable.pytorch_paralleltbb_linux_xenial_py3_6_gcc5_4_build
which would fall into the rebase logic as well, but since those jobs doesn't run on PRs(so the old logic was essentially no-op), I didn't enabled the new logic on those jobs.