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

Test merges again and return to using TRAVIS_COMMIT_RANGE #17

Merged
merged 2 commits into from
Mar 21, 2017

Conversation

wking
Copy link
Contributor

@wking wking commented Mar 21, 2017

Partially revert #15 and #16. #15 breaks when FETCH_HEAD doesn't exist (more in opencontainers/runc#1383) and #16 was a patch over the updated #15 commit range.

This commit adds the workaround for travis-ci/travis-ci#4596 which runtime-spec has been using since opencontainers/runtime-spec#216.

More details on the changes in the commit messages, if folks are particularly curious.

Partially reverting ca82522 (git: do not include merges in the commit
range, 2017-03-21, vbatts#16).  I've kept the unrelated --no-pager addition
from that commit.

I think merges in the commit range should be checked against whatever
criteria the caller is asking for.  If the caller does not want to
check a machine-generated commit, they shouldn't include it in the
commit range.

And we already have special-cases for merges.  For example, we skip
DCO checks for merge commits.  I'd be happier without that special
case, because human-generated merge commits can still add novel code
(and therefore should have Signed-off-by), etc.  But I don't think we
want a blanket pass for merge commits.

Signed-off-by: W. Trevor King <[email protected]>
Master builds only have a 'git clone ...' [1] so FETCH_HEAD isn't
defined and git-validation crashes [2].  This commit partially reverts
8a12a8f (main: default travis commit range is unreliable, 2017-03-21,
vbatts#13) to avoid that crash.  If TRAVIS_COMMIT_RANGE is unset [3],
falling back to TRAVIS_COMMIT may be fine.

The ... -> .. replacement works around travis-ci/travis-ci#4596 until
that is fixed upstream [4].  This avoids pulling in commits from the
base tip that aren't reachable from the head tip (e.g. if master has
advanced since the PR branched off, and the PR is against master).  We
only want to check commits that are in the head branch but not in the
base branch (more details on the range syntax in [5]).

Once the Travis bug does get fixed, the shell replacement will be a
no-op.  So we don't have to worry about checks breaking once the bug
gets fixed, and can periodically poll the bug and remove the
workaround at out leisure after the fix.

[1]: https://travis-ci.org/opencontainers/runc/jobs/213508696#L243
[2]: https://travis-ci.org/opencontainers/runc/jobs/213508696#L347
[3]: opencontainers/runc#1378 (comment)
[4]: travis-ci/travis-ci#4596
[5]: http://git-scm.com/docs/gitrevisions#_specifying_ranges

Signed-off-by: W. Trevor King <[email protected]>
@wking wking force-pushed the test-merges-again branch from 892c2ef to cdd7165 Compare March 21, 2017 19:16
@wking
Copy link
Contributor Author

wking commented Mar 21, 2017

As evidence of #16 being unnecessary when we're using TRAVIS_COMMIT_RANGE, the current tests for this PR have 965d975cff34aa55e94be693663bc453bf4ea03f as the tip commit and 9b7297d813671ee2f31b9d0e50599104a2efa160...cdd7165f804affb39d5ab3a7876e17966858b714 )which we use as 9b7297d..cdd7165) as TRAVIS_COMMIT_RANGE (so not including 965d975).

@vbatts
Copy link
Owner

vbatts commented Mar 21, 2017

such a silly bug to have to dance around

@vbatts vbatts merged commit 4cee76b into vbatts:master Mar 21, 2017
wking added a commit to wking/git-validation that referenced this pull request Mar 21, 2017
It's (string, old, new, n), not (old, new, string, n) [1].  Fixes a
typo I'd introduced in cdd7165 (main: Return to using
TRAVIS_COMMIT_RANGE (with ... -> .. fix), 2017-03-21, vbatts#17).

[1]: https://golang.org/pkg/strings/#Replace

Signed-off-by: W. Trevor King <[email protected]>
@wking wking deleted the test-merges-again branch March 21, 2017 22:17
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.

2 participants