-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commitsar fails with 0 commits to check on main branch #354
Comments
The current workaround for us is, to use two separate pipelines, where the main branch validation operates on the commit range. Gitlab CI based workaround relying on CI populated variables that help to identify the last commit:
|
I will investigate this.Thanks for the report @kowalczykp |
@kowalczykp sorry to be getting to this so late. I will set up commitsar to default to the commit provided by CI if running in CI. The issue is the Most CIs provide this info so I'll set it up :) |
When dealing with commits on branches/PRs, commitsar works as expected, but it behaves inconsistently on main branch:
When PR lands on main, as the last commit (fast-forward merge without merge commit) and CI (gitlab CI) manages to finish the commitsar pipeline before any new changes land, everything works as expected: Only a single/last commit is being found and checked.
When new changes land on main BEFORE the commitsar pipeline runs for previous commits, the following error happens:
While this mostly happens for frequent commits scenarios, the easiest way to deterministically reproduce it is to re-run a pipeline that previously passed on the main branch, but now has new commits ahead of it. This is always consistent and results in failure.
IMO Expected behaviour would be to check a single commit, that's triggering the CI and ensure the pipeline results is deterministic and re-running it on same commit produces the same output
Possibly related: #167
The text was updated successfully, but these errors were encountered: