Skip to content
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

Fails on GitLab when triggering a new pipeline on a branch without new commits #79

Closed
christophebedard opened this issue Jun 26, 2020 · 2 comments · Fixed by #80
Closed
Assignees
Labels
bug Something isn't working

Comments

@christophebedard
Copy link
Owner

Job after a merge to master: https://gitlab.com/micro-ROS/ros_tracing/tracetools_analysis/-/jobs/612272575

Detected: GitLab
on default branch 'master': will check new commits
Checking commits: 38da641ae4ed7472a814e10ac3513b0c3e5e763a..10310dbd8c3ac5e8e505a9292becaede0bfeff1a

Nightly job that was triggered a bit later (no new changes): https://gitlab.com/micro-ROS/ros_tracing/tracetools_analysis/-/jobs/612419164

Detected: GitLab
on default branch 'master': will check new commits
Checking commits: 0000000000000000000000000000000000000000..10310dbd8c3ac5e8e505a9292becaede0bfeff1a
error: fatal: Invalid revision range 0000000000000000000000000000000000000000..10310dbd8c3ac5e8e505a9292becaede0bfeff1a

So it would seem that this line & the CI_COMMIT_BEFORE_SHA env var give an invalid SHA:

commit_hash_base = get_env_var('CI_COMMIT_BEFORE_SHA')

@christophebedard christophebedard added the bug Something isn't working label Jun 26, 2020
@christophebedard christophebedard self-assigned this Jun 26, 2020
@christophebedard
Copy link
Owner Author

Weird behaviour for CI_COMMIT_BEFORE_SHA, as reported here:

@christophebedard
Copy link
Owner Author

Findings:

So the problem seems to be schedules. It would make sense to not run dco-check or have it do nothing if it's a scheduled pipeline. A simpler solution could be to set commit_hash_base to commit_hash_head if commit_hash_base is all zeros. This way it won't check anything and is rather simple.

However, if the schedule is not on the default branch (which definitely happens), then it will try to check commits off of the default branch (given the current logic in GitlabRetriever.get_commit_range()), which still doesn't really make sense. Therefore, we could simply detect the schedule (CI_PIPELINE_SOURCE == schedule) and not do anything/set base to head and mention it in a verbose_print().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant