ci: fix git clone depth being too small, and typo in debug msg
Technically this option can be configured in the Gitlab UI, but I spent about 3 hours debugging a CI failure caused by it being too low and I don't want to risk forgetting this can happen later if/when someone decides to lower it in the UI. By setting it here, we can have some context/history about why.
This fixes the CI in !5688 (merged)
Also see: https://docs.gitlab.com/17.4/ee/user/project/repository/monorepos/index.html#shallow-cloning
Merge request reports
Activity
mentioned in merge request !5688 (merged)
of course CI is failing because of pmbootstrap#2465 (closed)
In case anyone wonders why this was so painful to debug in the gitlab CI... here's all the info I could get when git merge-base fails:
commit HEAD: acd334c19c357ef30718d925e11aa25b76d2edbe commit upstream/master: 822b7ee0d06f05ff6d2eb37bcf4a1825569be692 FAIL! 1 06:31:16.709390 git.c:465 trace: built-in: git merge-base upstream/master HEAD ERROR DEBUG: Command '['git', '-C', '/builds/postmarketOS/pmaports', 'merge-base', 'upstream/master', 'HEAD']' returned non-zero exit status 1. Traceback (most recent call last): File "/builds/postmarketOS/pmaports/.ci/lib/apkbuild_linting.py", line 11, in <module> apkbuilds = {file for file in common.get_changed_files(removed=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/builds/postmarketOS/pmaports/.ci/lib/common.py", line 125, in get_changed_files commit = run_git(["merge-base", branch_upstream, "HEAD"])[:-1] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/builds/postmarketOS/pmaports/.ci/lib/common.py", line 29, in run_git return subprocess.check_output(cmd, stderr=stderr).decode() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/subprocess.py", line 466, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['git', '-C', '/builds/postmarketOS/pmaports', 'merge-base', 'upstream/master', 'HEAD']' returned non-zero exit status 1.
Ya, that's right, nothing from git (I had to set
GIT_TRACE=1
just to get anything from git). The base sha (822b7ee0) shows up just fine withgit show ...
. I still don't fully understand wtf happened here but debugging this in the CI was quite painfuladded ci label
added 15 commits
-
016dacfa...e03dc38b - 13 commits from branch
master
- f37c93ed - ci: common: fix typo when printing upstream branch sha (MR 5718)
- 344658db - CI: gitlab: increase git clone depth to 100 (MR 5718)
-
016dacfa...e03dc38b - 13 commits from branch
enabled an automatic merge when all merge checks for 344658db pass