build jobs should fail early if NVR mismatch between SRPM and RPMs is detected
https://gitlab.com/redhat/red-hat-ci-tools/kernel/cki-internal-pipelines/cki-internal-contributors/-/pipelines/1295164819 failed because of a mismatch between Makefile and .gitlab-ci.yml:
-
the Makefile came from the merged feature+target branch, because of the manual merge in the merge stage
The pipeline ran for the feature branch head ( https://gitlab.com/redhat/rhel/src/kernel/rhel-8/-/commit/961189e00f4a9105cf2dee0836646078c2449d73), but a merge commit was available ( https://gitlab.com/redhat/rhel/src/kernel/rhel-8/-/commit/def6e99b0e420349dc6bf48d940d4367ea7ef652), and that was used going forward.
-
the .gitlab-ci.yml came from the feature branch alone, as can be seen at https://gitlab.com/redhat/rhel/src/kernel/rhel-8/-/merge_requests/6646/pipelines where the first pipeline only had the blue
merge request
label; as the MR was based on an outdated target branch head, it didn't pull in the disttag override
This resulted in the correct NVR for the source RPM, but wrong NVRs for the binary RPMs:
This was fixed by rebasing on the target branch, which triggered a second pipeline with the correct disttag override:
In general, this is not much of a problem:
- there are rarely any updates to the .gitlab-ci.yml file
- GitLab should only trigger merged result pipelines even for draft MRs unless there are merge conflicts with the target branch
The sensitive period is really during z-stream branching before the GA builder container image becomes available, which is also the case here.
This is hard to fix in the pipeline, but easy to fix locally by rebasing on the target branch. As this is annoying to both kernel devs hitting this and the CKI person tasked with debugging the failure, AC:
-
alert about this in the merge/build jobs with the request to rebase the MR to pull in the updated target branch, e.g. by detecting a difference in .gitlab-ci.yml between the ref that GitLab used for triggering the pipeline and the ref that will be used for merge/build stages