From d9b7bc39b471014339a3688dee0ca54a51c4666f Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 12 Sep 2015 12:13:00 -0700 Subject: [PATCH 1/3] .travis: Convert TRAVIS_COMMIT_RANGE base...head to base..head Work around travis-ci/travis-ci#4596 until that is fixed upstream [1]. 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 [2]). 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://github.com/travis-ci/travis-ci/issues/4596 [2]: http://git-scm.com/docs/gitrevisions#_specifying_ranges Signed-off-by: W. Trevor King --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9780433d5..43f0e55ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,5 +18,6 @@ install: true script: - make .govet - make .golint - - make .gitvalidation + - echo "${TRAVIS_COMMIT_RANGE} -> ${TRAVIS_COMMIT_RANGE/.../..} (travis-ci/travis-ci#4596)" + - TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}" make .gitvalidation - make docs From dd40abea2e3f22ae82ba4c2d21f33511bf574f93 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 23 Jan 2017 15:59:05 -0800 Subject: [PATCH 2/3] Makefile: Use 'ifdef TRAVIS_COMMIT_RANGE' for git-validation Only use the auto-ranging when Travis tells us what the range is. Use our EPOCH_TEST_COMMIT-based range in all other cases. ifdef is described in [1]. [1]: https://www.gnu.org/software/make/manual/html_node/Conditional-Syntax.html Signed-off-by: W. Trevor King --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 41c2409ac..1d5401828 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ endif # When this is running in travis, it will only check the travis commit range .gitvalidation: @which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false) -ifeq ($(TRAVIS),true) +ifdef TRAVIS_COMMIT_RANGE git-validation -q -run DCO,short-subject,dangling-whitespace else git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD From 550a73abb54ca70f459580b47ede4a74da283aa2 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 23 Jan 2017 15:59:30 -0800 Subject: [PATCH 3/3] .travis.yml: Print TRAVIS_* environment variables To make make debugging Travis environment issues more straightforward. Signed-off-by: W. Trevor King --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 43f0e55ab..7f6c11f11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ before_install: install: true script: + - env | grep TRAVIS_ - make .govet - make .golint - echo "${TRAVIS_COMMIT_RANGE} -> ${TRAVIS_COMMIT_RANGE/.../..} (travis-ci/travis-ci#4596)"