Skip to content
Snippets Groups Projects

ci: fix git clone depth being too small, and typo in debug msg

Merged Clayton Craft requested to merge craftyguy/ci_fixes into master

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

Merge request pipeline #208497 passed

Merge request pipeline passed for 344658db

Approved by

Merged by NewbyteNewbyte 5 months ago (Oct 19, 2024 12:11pm UTC)

Merge details

  • Changes merged into master with 344658db.
  • Deleted the source branch.
  • Auto-merge enabled

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Clayton Craft mentioned in merge request !5688 (merged)

    mentioned in merge request !5688 (merged)

  • Author Maintainer

    of course CI is failing because of pmbootstrap#2465 (closed) :upside_down:

  • Author Maintainer

    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 with git show .... I still don't fully understand wtf happened here but debugging this in the CI was quite painful :disappointed:

  • Pablo Correa Gomez approved this merge request

    approved this merge request

  • added ci label

  • Pablo Correa Gomez added type::fix label and removed ci label

    added type::fix label and removed ci label

  • Alexey Minnekhanov approved this merge request

    approved this merge request

  • Robert Eckelmann approved this merge request

    approved this merge request

  • Thanks for investigating this!

  • Newbyte approved this merge request

    approved this merge request

  • Newbyte added 15 commits

    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)

    Compare with previous version

  • Newbyte enabled an automatic merge when all merge checks for 344658db pass

    enabled an automatic merge when all merge checks for 344658db pass

  • merged

Please register or sign in to reply
Loading