Merge request webhook - add merged results pipeline details
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Context
Include information about the merged results pipeline in the merge request webhook event.
When a project has merged results pipeline enabled the resulting merge request pipeline is run with a commit hash resulting from merging the source branch into the target branch and thus the commit seen by tools running inside the runner is not "real" in that it is the proposed commit hash if the MR were to be merged. This an important detail for applications integrating with GitLab's merge request webhooks must have. Without the details about the merged results pipeline in the merge request webhook event there is no way for applications that listen to webhooks to correlate the pipeline executions.
Ideally this is part of the Epic &5147 that is tracking various Merge Request Webhook improvements.
I should also mention that I came across #225597 which is part of the aforementioned epic. So maybe the details are already in the event but just not documented?
Current workaround
Use the API to get the branches for a commit and see if they follow this pattern.
See #350086 (comment 822077692)
Proposal
Add a new property alongside the "real" last commit ID (see object_attributes.last_commit.id
). Nest it under the object_attributes.last_commit
object as merged_results_id
:
{
"object_attributes": {
"last_commit": {
"id": "SHA",
"merged_results_id": "FAKESHA or null if not a merged results pipeline"
}
}
}