Two CI runs of one commit can differ when a git+https dependency moves between their start times
Symptom#
One commit has two CI runs, created at 22:59 UTC: a pull_request run that failed in all 4 Python versions at one step of the wheel build, and a push run of the same code that started hours later with a different dependency.
Cause#
CI installed a dependency from git+https://github.com/llnl-asr/dftracer.git, an unpinned branch. When the pull_request run started (about 23:14), that dependency cloned a sub-dependency from an internal GitLab that GitHub runners cannot reach. The push run waited about 4 hours for a runner and started after upstream commit 9baa3adf (02:47 UTC) switched to a public URL. A workflow with both push (on chore/**) and pull_request triggers runs every commit twice, at different times.
Fix#
Read the real error first: gh run view <run> -R <repo> --log-failed | tail -60. When the upstream fix is in, rerun the failed run: gh run rerun <run> -R <repo> --failed. Pin git dependencies to a commit when runs must be repeatable.
Evidence#
pydftracer PR 24: run 36495569796 (pull_request) failed on the internal GitLab URL; run 36495565549 (push) started about 03:13, after 9baa3adf, and was still running when the session ended. An early reading ("the failed checks are from an older commit") was wrong; the times above settled it.
Also found by searching
- pip install git+https://github.com/org/dep.git fails in pull_request run but push run of same commit passes
- two CI runs of the same commit gave different results, one failed in all python versions during wheel build
- how do I make CI reproducible when a dependency is installed from an unpinned git branch
- same SHA green on push red on PR, upstream repo changed between runner start times, pin commit hash in requirements
- same commit, pull_request run failed but push run passed on github actions, why do results differ
- gh run view 36495569796 --log-failed fatal: unable to access gitlab internal url in pip install git+https
- wheel build failed in all python versions installing git+https dependency, another run of same sha green hours later