Skip to content
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

Travis: auto rebase on master before running #1526

Merged
merged 1 commit into from
Aug 11, 2014
Merged

Travis: auto rebase on master before running #1526

merged 1 commit into from
Aug 11, 2014

Conversation

Kijewski
Copy link
Contributor

@Kijewski Kijewski commented Aug 1, 2014

It can happen that two PRs don't interfere with each other in the sense
that they hurt automatic rebasing, but still do not work together. The
prime example is PR1 changes the API of some function that PR2 uses. If
PR1 is merged, and PR2 is not rebased before merging, the error might
get unnoticed before the next build. Travis CI would have have told both
PR1 and PR2 are fine, but will complain (rather unnoticedly) that our
master does not compile.

This PR automatically rebases the PR on top of the current master,
before running the tests. If the automatic rebase fails, then this is
fine, because you will need to manually rebase again before merging,
anyway. The manual rebase, i.e. new push, will trigger Travis CI.

So, the main idea of this PR is that to can hit the "Restart Build"
button in Travis CI before hitting the merge button in Github.

@Kijewski Kijewski added the tests label Aug 1, 2014
@Kijewski Kijewski added this to the Release NEXT MAJOR milestone Aug 1, 2014
@LudwigKnuepfer
Copy link
Member

Makes sense, Travis is unhappy though.

@@ -22,7 +22,12 @@ install:
- git config --global user.email "travis@example.com"
- git config --global user.name "Travis CI"

- git remote add riot https://github.com/RIOT-OS/RIOT.git
- git fetch riot master --depth=1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --depth=1 (as far as I always understood it) option could lead to [edit: a higher risk of] merge errors if the merge base is not present.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Joa, I'll just delete the parameter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(just to emphasis how dangerous this is: after testing this my repository now isn't working anymore, because there is now this 4546c3f commit in it, that has no parents and basically leads to me not being able to do anything sensible)

@LudwigKnuepfer
Copy link
Member

restarting Travis

@Kijewski
Copy link
Contributor Author

It works.

script:
- git rebase riot/master || true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make sense to git rebase --abort if the rebase failed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, totally right.

@LudwigKnuepfer
Copy link
Member

ACK

@Kijewski
Copy link
Contributor Author

Btw. this works, too: https://travis-ci.org/RIOT-OS/RIOT/builds/32233979#L1148

It can happen that two PRs don't interfere with each other in the sense
that they hurt automatic rebasing, but still do not work together. The
prime example is PR1 changes the API of some function that PR2 uses. If
PR1 is merged, and PR2 is not rebased before merging, the error might
get unnoticed before the next build. Travis CI would have have told both
PR1 and PR2 are fine, but will complain (rather unnoticedly) that our
master does not compile.

This PR automatically rebases the PR on top of the current master,
before running the tests. If the automatic rebase fails, then this is
fine, because you will need to manually rebase again before merging,
anyway. The manual rebase, i.e. new push, will trigger Travis CI.

So, the main idea of this PR is that to can hit the "Restart Build"
button in Travis CI before hitting the merge button in Github.
Kijewski added a commit that referenced this pull request Aug 11, 2014
Travis: auto rebase on master before running
@Kijewski Kijewski merged commit 3b7591f into RIOT-OS:master Aug 11, 2014
@Kijewski Kijewski deleted the rebase-on-master branch August 11, 2014 16:23
@LudwigKnuepfer
Copy link
Member

Nice @ retry

@OlegHahm
Copy link
Member

Actually, I don't get the purpose of this PR. When a PR B won't work after a PR A got merged, Travis would fail anyway, wouldn't it?

@Kijewski
Copy link
Contributor Author

Only after you rebase.

@OlegHahm
Copy link
Member

But why would you rebase? Usually a simple merge should do it.

@Kijewski
Copy link
Contributor Author

But if you merge in the master, then it's wrong order, isn't it?

@OlegHahm
Copy link
Member

But if you merge in the master, then it's wrong order, isn't it?

Why? Isn't that exactly what would happen if you hit the merge button?

@miri64
Copy link
Member

miri64 commented Sep 13, 2014

I second @OlegHahm.

@Kijewski
Copy link
Contributor Author

Why didn't you say anything in the ten days that the PR was open?..

@miri64
Copy link
Member

miri64 commented Sep 13, 2014

Because I just realized that ;-)

@OlegHahm
Copy link
Member

Sorry, I didn't understand the description but was trusting the review. Only realized now that some old PRs were failing due to this PR.

@Kijewski
Copy link
Contributor Author

Failing PRs were the idea of this PR. The question is if the other PRs are falsely failing. Can you name examples?

@OlegHahm
Copy link
Member

I cannot recall which PR it was, but it was failing because of missing blacklisting for some applications on ATMega2560 that should have nothing to do with the PR.

@Kijewski
Copy link
Contributor Author

This behavior is the very intention of this PR:

  • $USER1 creates a $PR1. It passes all test but the PR gets not merged immediately.
  • $USER2 creates $PR2, which implements board $BOARD, and $PR2 gets merged.
  • $PR1 now passes every test but for $BOARD, which has $LACKING_FEATURE.
  • Without Travis: auto rebase on master before running #1526 you'd never notice the problem until you hit the merge button.

QED

@OlegHahm
Copy link
Member

I still don't see the reason for rebasing instead of merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: tests Area: tests and testing framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants