Skip to content

Update gitlab/ earlier to update _VERSION files

Ash McKenzie requested to merge ashmckenzie/fix-ensure-databases-running into master

What does this Merge Request do?

Context

On Slack, it was reported that a gdk update threw the following error:

--snip--
--------------------------------------------------------------------------------
Building gitlab-org/gitaly 4b9bbc37dd7bc587ee28fb7beab8b9c384a41e4c
--------------------------------------------------------------------------------
cd _build && ./makegen > Makefile
cd _build && /Library/Developer/CommandLineTools/usr/bin/make install INSTALL_DEST_DIR=/Users/thiago/repos/gitlab-development-kit/gitaly
# go install
mkdir -p /Users/thiago/repos/gitlab-development-kit/gitaly
cd bin && install gitaly gitaly-blackbox gitaly-debug gitaly-hooks gitaly-ssh gitaly-wrapper praefect /Users/thiago/repos/gitlab-development-kit/gitaly
grpc-1.27.0-universal-darwin requires ruby version < 2.7.dev, >= 2.3, which is
incompatible with the current version, ruby 2.7.2p137
make: *** [gitaly/bin/gitaly] Error 5
❌️ ERROR: Failed to update.
-------------------------------------------------------
--snip--

The error was as a result of an attempt to run the gitaly/bin/gitaly Makefile target in an outdated gitaly/ directory. The happens because of the order of execution (shortened to contain just the relevant targets) because the gitlab/GITALY_SERVER_VERSION file holds the git SHA of what the gitlab/ should contain:

graph LR
  id1[gdk update]-->id2[make update]
  id2-->id3[make ensure-databases-running]
  id3-->id4[make gitaly-setup]
  id4-->BANG

The fix

This MR ensures the gitlab/ directory is updated earlier in the gdk update process so the following files are updated and ready to be update further projects:

  • GITALY_SERVER_VERSION
  • GITLAB_ELASTICSEARCH_INDEXER_VERSION
  • GITLAB_KAS_VERSION
  • GITLAB_PAGES_VERSION
  • GITLAB_SHELL_VERSION
  • GITLAB_WORKHORSE_VERSION

The adjusted flow calls make gitlab/.git/pull earlier which means gitlab/GITALY_SERVER_VERSION is updated prior to make gitaly-setup which updates the gitaly/ directory to the correct git SHA:

graph LR
  id1[gdk update]-->id2[make update]
  id2-->id3[make gitlab/.git/pull]
  id3-->id4[make ensure-databases-running]
  id4-->id5[make gitaly-setup]
  id5-->OK

Merge Request checklist

  • Tests added for new functionality. If not, please raise Issue to follow-up.
  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Documentation added/updated, if needed.
  • gdk doctor test added, if needed.
Edited by Ash McKenzie

Merge request reports