Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[OKD 3.11] Testing GitLab Build Trigger - payload includes 3 commits and triggers build based on wrong commit #23799
Hello you lovely people!
I'm posting in hopes of verifying and/or identifying a bug.
When testing the integration in GitLab to trigger an OpenShift build, the webhook payload sent by GitLab contains an array commits containing the last 3 commits.
OpenShift triggers a build, but clones the oldest commit (which is the last one in the array) and not the newest (meaning it reverts to an older code version)
When instead pushing to the GitLab repository to trigger the webhook, the commit array only contains one entry - the most recent commit - the OpenShift build therefore is OK.
Steps To Reproduce
With test from GitLab
Actual commit to repository
With test - build is potentially initiated with the wrong commit, therefore building the image with outdated code.
When triggering builds when testing the webhook from GitLab the checkout_sha should be used to identify the commit.
JSON Payloads (test and actual commit)
Sensitive information has been redacted