8000 [MRG+1] Use GitHub's merge refs to test PRs on CircleCI by jakirkham · Pull Request #8211 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG+1] Use GitHub's merge refs to test PRs on CircleCI #8211

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

Merged
merged 1 commit into from
Jan 18, 2017

Conversation

jakirkham
Copy link
Contributor

Fixes #8058

Unlike other CIs, CircleCI does not test the merge commit of a PR with its base branch. Instead it tests the PR's head commit. The problem with this is the PR's status could differ when it is merged with the base branch. For instance, if one needs changes in the base branch to get their PR to pass, they must rebase/merge to get them into the history the PR. This normally isn't a problem, but sometimes things do go wrong when doing this merge/rebase, which adds a new unneeded difficulty. Alternatively, a passing PR could turn out to fail when merged into the base branch because some new content in the base branch was not tested against in the PR.

To solve these issues, we checkout the merge ref for a PR (if it is a PR) from GitHub. However, it should be noted that the merge ref can be out-of-date in some cases w.r.t. the base branch. Still this is the commonly used strategy on Travis CI and AppVeyor. If we had enough info, we could ideally terminate a build that has merge conflicts. Unfortunately it doesn't seem that CircleCI gives us this info.

cc @jnothman

Unlike other CIs, CircleCI does not test the merge commit of a PR with
its base branch. Instead it tests the PR's head commit. The problem with
this is the PR's status could differ when it is merged with the base
branch. For instance, if one needs changes in the base branch to get
their PR to pass, they must rebase/merge to get them into the history
the PR. This normally isn't a problem, but sometimes things do go wrong
when doing this merge/rebase, which adds a new unneeded difficulty.
Alternatively, a passing PR could turn out to fail when merged into the
base branch because some new content in the base branch was not tested
against in the PR.

To solve these issues, we checkout the merge ref for a PR (if it is a
PR) from GitHub. However, it should be noted that the merge ref can be
out-of-date in some cases w.r.t. the base branch. Still this is the
commonly used strategy on Travis CI and AppVeyor. If we had enough info,
we could ideally terminate a build that has merge conflicts.
Unfortunately it doesn't seem that CircleCI gives us this info.
@jakirkham jakirkham changed the title BLD: Use GitHub's merge refs to test PRs on CircleCI Use GitHub's merge refs to test PRs on CircleCI Jan 18, 2017
@jnothman
Copy link
Member

LGTM. I cursorily checked that this should not conflict with our build_doc.sh

@jnothman jnothman changed the title Use GitHub's merge refs to test PRs on CircleCI [MRG+1] Use GitHub's merge refs to test PRs on CircleCI Jan 18, 2017
@raghavrv
Copy link
Member

Thanks a lot @jakirkham... In it goes... (Merging without confirmation from appveyor as it should not be affected in anyway...)

@raghavrv raghavrv merged commit 5d6460d into scikit-learn:master Jan 18, 2017
@jakirkham jakirkham deleted the circle_merge_prs branch January 18, 2017 02:02
@jakirkham
Copy link
Contributor Author

Glad to help. 😄

Wasn't sure if this was BLD or MNT. So sorry if I messed that up.

@jnothman
Copy link
Member
jnothman commented Jan 18, 2017 via email

@lesteve
Copy link
Member
lesteve commented Jan 18, 2017

Out of interest, has anyone tried to see what happens if you add CircleCI on your fork? This is sometimes convenient to test things out without having to open a PR.

@lesteve
Copy link
Member
lesteve commented Jan 18, 2017

Out of interest, has anyone tried to see what happens if you add CircleCI on your fork

I guess this works fine because CIRCLE_PR_NUMBER is unset.

raghavrv pushed a commit to raghavrv/scikit-learn that referenced this pull request Jan 18, 2017
…#8211)

Unlike other CIs, CircleCI does not test the merge commit of a PR with
its base branch. Instead it tests the PR's head commit. The problem with
this is the PR's status could differ when it is merged with the base
branch. For instance, if one needs changes in the base branch to get
their PR to pass, they must rebase/merge to get them into the history
the PR. This normally isn't a problem, but sometimes things do go wrong
when doing this merge/rebase, which adds a new unneeded difficulty.
Alternatively, a passing PR could turn out to fail when merged into the
base branch because some new content in the base branch was not tested
against in the PR.

To solve these issues, we checkout the merge ref for a PR (if it is a
PR) from GitHub. However, it should be noted that the merge ref can be
out-of-date in some cases w.r.t. the base branch. Still this is the
commonly used strategy on Travis CI and AppVeyor. If we had enough info,
we could ideally terminate a build that has merge conflicts.
Unfortunately it doesn't seem that CircleCI gives us this info.
@ogrisel
Copy link
Member
ogrisel commented Jan 19, 2017

Thanks @jakirkham :)

@jakirkham
Copy link
Contributor Author

Out of interest, has anyone tried to see what happens if you add CircleCI on your fork

I guess this works fine because CIRCLE_PR_NUMBER is unset.

Yes, we have tried this. As you have noted, the guards checking CIRCLE_PR_NUMBER protect against this being an issue.

That said, there is an important caveat. CircleCI's build model is different from other CIs like Travis and AppVeyor. Namely CircleCI views all builds as equivalent regardless of whether they are on your fork or in a PR. This differs from Travis and AppVeyor, which view these as two separate builds (one at the branch tip and the other at the merge of the PR). Thus if one enables CircleCI on their fork, then the build will only occur on user's fork. As a result this script won't do anything in that case. Just something to keep in mind.

@lesteve
Copy link
Member
lesteve commented Jan 19, 2017

Thus if one enables CircleCI on their fork, then the build will only occur on user's fork. As a result this script won't do anything in that case. Just something to keep in mind.

That's what I thought, but thanks a lot spelling it out and confirming my suspicions.

sergeyf pushed a commit to sergeyf/scikit-learn that referenced this pull request Feb 28, 2017
@jakirkham < 8000 a class="avatar avatar-user" style="width:20px;height:20px;" data-test-selector="commits-avatar-stack-avatar-link" data-hovercard-type="user" data-hovercard-url="/users/sergeyf/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/sergeyf"> @sergeyf
…#8211)

Unlike other CIs, CircleCI does not test the merge commit of a PR with
its base branch. Instead it tests the PR's head commit. The problem with
this is the PR's status could differ when it is merged with the base
branch. For instance, if one needs changes in the base branch to get
their PR to pass, they must rebase/merge to get them into the history
the PR. This normally isn't a problem, but sometimes things do go wrong
when doing this merge/rebase, which adds a new unneeded difficulty.
Alternatively, a passing PR could turn out to fail when merged into the
base branch because some new content in the base branch was not tested
against in the PR.

To solve these issues, we checkout the merge ref for a PR (if it is a
PR) from GitHub. However, it should be noted that the merge ref can be
out-of-date in some cases w.r.t. the base branch. Still this is the
commonly used strategy on Travis CI and AppVeyor. If we had enough info,
we could ideally terminate a build that has merge conflicts.
Unfortunately it doesn't seem that CircleCI gives us this info.
@Przemo10 Przemo10 mentioned this pull request Mar 17, 2017
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
…#8211)

Unlike other CIs, CircleCI does not test the merge commit of a PR with
its base branch. Instead it tests the PR's head commit. The problem with
this is the PR's status could differ when it is merged with the base
branch. For instance, if one needs changes in the base branch to get
their PR to pass, they must rebase/merge to get them into the history
the PR. This normally isn't a problem, but sometimes things do go wrong
when doing this merge/rebase, which adds a new unneeded difficulty.
Alternatively, a passing PR could turn out to fail when merged into the
base branch because some new content in the base branch was not tested
against in the PR.

To solve these issues, we checkout the merge ref for a PR (if it is a
PR) from GitHub. However, it should be noted that the merge ref can be
out-of-date in some cases w.r.t. the base branch. Still this is the
commonly used strategy on Travis CI and AppVeyor. If we had enough info,
we could ideally terminate a build that has merge conflicts.
Unfortunately it doesn't seem that CircleCI gives us this info.
NelleV pushed a commit to NelleV/scikit-learn that referenced this pull request Aug 11, 2017
…#8211)

Unlike other CIs, CircleCI does not test the merge commit of a PR with
its base branch. Instead it tests the PR's head commit. The problem with
this is the PR's status could differ when it is merged with the base
branch. For instance, if one needs changes in the base branch to get
their PR to pass, they must rebase/merge to get them into the history
the PR. This normally isn't a problem, but sometimes things do go wrong
when doing this merge/rebase, which adds a new unneeded difficulty.
Alternatively, a passing PR could turn out to fail when merged into the
base branch because some new content in the base branch was not tested
against in the PR.

To solve these issues, we checkout the merge ref for a PR (if it is a
PR) from GitHub. However, it should be noted that the merge ref can be
out-of-date in some cases w.r.t. the base branch. Still this is the
commonly used strategy on Travis CI and AppVeyor. If we had enough info,
we could ideally terminate a build that has merge conflicts.
Unfortunately it doesn't seem that CircleCI gives us this info.
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
…#8211)

Unlike other CIs, CircleCI does not test the merge commit of a PR with
its base branch. Instead it tests the PR's head commit. The problem with
this is the PR's status could differ when it is merged with the base
branch. For instance, if one needs changes in the base branch to get
their PR to pass, they must rebase/merge to get them into the history
the PR. This normally isn't a problem, but sometimes things do go wrong
when doing this merge/rebase, which adds a new unneeded difficulty.
Alternatively, a passing PR could turn out to fail when merged into the
base branch because some new content in the base branch was not tested
against in the PR.

To solve these issues, we checkout the merge ref for a PR (if it is a
PR) from GitHub. However, it should be noted that the merge ref can be
out-of-date in some cases w.r.t. the base branch. Still this is the
commonly used strategy on Travis CI and AppVeyor. If we had enough info,
we could ideally terminate a build that has merge conflicts.
Unfortunately it doesn't seem that CircleCI gives us this info.
maskani-moh pushed a commit to maskani-moh/scikit-learn that referenced this pull request Nov 15, 2017
…#8211)

Unlike other CIs, CircleCI does not test the merge commit of a PR with
its base branch. Instead it tests the PR's head commit. The problem with
this is the PR's status could differ when it is merged with the base
branch. For instance, if one needs changes in the base branch to get
their PR to pass, they must rebase/merge to get them into the history
the PR. This normally isn't a problem, but sometimes things do go wrong
when doing this merge/rebase, which adds a new unneeded difficulty.
Alternatively, a passing PR could turn out to fail when merged into the
base branch because some new content in the base branch was not tested
against in the PR.

To solve these issues, we checkout the merge ref for a PR (if it is a
PR) from GitHub. However, it should be noted that the merge ref can be
out-of-date in some cases w.r.t. the base branch. Still this is the
commonly used strategy on Travis CI and AppVeyor. If we had enough info,
we could ideally terminate a build that has merge conflicts.
Unfortunately it doesn't seem that CircleCI gives us this info.
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.

5 participants
0