screwdriver
screwdriver copied to clipboard
Can't rerun a build.
What happened: I can't rerun a build whose commit depth is deeper more than 50.
What you expected to happen: I can rerun all builds even if that commit depth is deeper more than 50.
How to reproduce it:
- Run a build.
- Push 50+ commits.
- Try to rerun a build which was run in 1st step.
Is this because of shallow clone depth? On a side note, why would someone need to rerun something like 50 commits before?
@d2lam Yes, it's because of shallow clone depth. Its config is defined by an environment variable and we don't have a way to edit it in past events. For instance, a user runs build many times (50+) because builds somehow failed. Then a user tries to run last successful build and it cannot be run. Another situation would be pushing many commits at once. A user pushes 25 commits and 30 commit, then the user can't restart the build that has run before two events. Merging or rebasing many commits may also cause this. This issue can be resolved by retrying without depth setting if first git clone has failed.
FYI: You can use the environment variable GIT_SHALLOW_CLONE_DEPTH to work around this problem.
If your pull request branch has more than $GIT_SHALLOW_CLONE_DEPTH commits (default: 50), you may see pull request builds fail with this error. This message indicates that git cannot find a common shared ancestor between your feature branch and the main branch. To resolve this issue, you could disable or tune the shallow clone settings (see them listed here) for your job, or reduce the number of commits on your feature branch (e.g. rebase and squash).
https://docs.screwdriver.cd/user-guide/FAQ#why-do-my-pull-request-builds-fail-with-the-error-fatal-refusing-to-merge-unrelated-histories-in-the-sd-setup-scm-step