git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Reducing redundant build at Travis?

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 12, 2017, 23:44 UTC
Message-ID
<xmqqeftlz0dv.fsf@gitster.mtv.corp.google.com>

I usually try to stay as late as possible to finish all the integration branches in order before pushing out the result; it is more efficient to be able to batch things (for humans).

I however noticed that This often means we would have multiple build jobs at Travis for branches and builds on Windows often fails waiting for its response. Since I tagged the tip of 'maint', and I wanted to give all the build a fair chance to succeed without other build jobs starving it of resources, I pushed out 'maint' and the tag before others, even though I already have all the other integration branches ready.

Unfortunately, https://travis-ci.org/git/git/builds/ shows that it does not care if it spawned a job to build the tip of 'maint' and another for 'v2.13.3' that point at the same thing.

I do not mind this behaviour terribly for Linux builds that never seem to time out, but it is wasteful. Here is what I came up with to skip the build and test on a branch tip that is tagged, but I suspect this would not actually work (when told to build a tag, I suspect that it would try to find an exact-match and ends up finding itself, refusing to do the work).

I also do not quite like the way that I had to add a check like this for every script: thing in the .travis.yml file (the attached does not even cover MacOS whose build tends to take a lot longer). I suspect that you or others who are better versed with the system may have better idea to have a single centralized check that avoids a tip of a branch that is pointed at by a release tag.

Thanks.
 ci/run-linux32-build.sh | 6 ++++++
 ci/run-windows-build.sh | 6 ++++++
 2 files changed, 12 insertions(+)
diff --git a/ci/run-linux32-build.sh b/ci/run-linux32-build.sh
index e30fb2cddc..ffb5c8fdf1 100755
--- a/ci/run-linux32-build.sh
+++ b/ci/run-linux32-build.sh
@@ -6,6 +6,12 @@
 #   run-linux32-build.sh [host-user-id]
 #
 
+if TAG=$(git describe --exact-match HEAD 2>/dev/null)
+then
+	echo "The tip of the branch is exactly at $TAG"
+	exit 0
+fi
+
 # Update packages to the latest available versions
 linux32 --32bit i386 sh -c '
     apt update >/dev/null &&
diff --git a/ci/run-windows-build.sh b/ci/run-windows-build.sh
index 2d98f6b2f9..74d4819d74 100755
--- a/ci/run-windows-build.sh
+++ b/ci/run-windows-build.sh
@@ -12,6 +12,12 @@ test -z "$GFW_CI_TOKEN" && echo "GFW_CI_TOKEN not defined" && exit
 BRANCH=$1
 COMMIT=$2
 
+if TAG=$(git describe --exact-match "$COMMIT" 2>/dev/null)
+then
+	echo "Tip of $BRANCH exactly at $TAG"
+	exit 0
+fi
+
 gfwci () {
 	local CURL_ERROR_CODE HTTP_CODE
 	CONTENT_FILE=$(mktemp -t "git-windows-ci-XXXXXX")
Next: Lars Schneider
Message 1 of 12 in “Reducing redundant build at Travis?”
  1. Junio C HamanoJul 12, 2017
  2. Lars SchneiderJul 13, 2017
  3. Junio C HamanoJul 13, 2017
  4. Jeff KingJul 14, 2017
  5. Junio C HamanoJul 14, 2017
  6. Jeff KingJul 14, 2017
  7. Lars SchneiderJul 20, 2017
  8. Junio C HamanoJul 20, 2017
  9. Lars SchneiderJul 21, 2017
  10. Junio C HamanoJul 21, 2017
  11. Lars SchneiderJul 26, 2017
  12. Junio C HamanoJul 26, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.