[CI][Backports] add integrations-backport-dispatch private pipeline for triggering backport creation - #20284
[CI][Backports] add integrations-backport-dispatch private pipeline for triggering backport creation#20284mrodm wants to merge 3 commits into
Conversation
…ing backport creation The public integrations pipeline can fail to trigger the private integrations-backport pipeline in some scenarios due to public→private pipeline restrictions in Buildkite. Move the backport branch creation trigger to a new dedicated private pipeline (integrations-backport-dispatch) that reliably triggers integrations-backport on merges to main. Changes: - Add .buildkite/pipeline.backport-dispatch.yml with inventory validation and backport creation trigger steps - Remove trigger-backport-create step from pipeline.yml; narrow check-backports-inventory to PR-only in that pipeline - Allow integrations-backport-dispatch as a valid trigger source in pipeline.backport.yml and add failure email notifications - Add pipeline slug safeguard in trigger_backport.sh so branch creation only runs from integrations-backport-dispatch - Register the new pipeline in catalog-info.yaml, pull-requests.json, and non_package_patterns.txt Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
💚 Build Succeeded
cc @mrodm |
| if: | | ||
| build.branch == "nonexisting" |
There was a problem hiding this comment.
To be reverted before merging
There was a problem hiding this comment.
I guess this is some leftover?
There was a problem hiding this comment.
Yes, I'll remove it before merging to avoid triggering a new step for each package defined in the repo (460 or more steps).
| if [[ "${BUILDKITE_PIPELINE_SLUG}" != "integrations-backport-dispatch" ]]; then | ||
| echo "Backport branch creation can only run from the 'integrations-backport-dispatch' pipeline (got: ${BUILDKITE_PIPELINE_SLUG})" | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
If this pipeline is triggered from main (and therefore it would create a new backport branch), it must be running from the new integrations-backport-dispatch pipeline.
|
Hi @elastic/observablt-ci , adding you as a reviewers in case there is anything that should be changed or improved regarding the changes in Buildkite pipelines. |
| if: | | ||
| build.branch == "nonexisting" |
There was a problem hiding this comment.
I guess this is some leftover?
| build_tags: false | ||
| filter_enabled: true | ||
| filter_condition: >- | ||
| build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null && build.source == 'api') |
There was a problem hiding this comment.
If we don't build PRs, build.pull_request.id == null is always true, so the second part is never evaluated.
There was a problem hiding this comment.
Just copied from the other catalog-info entries.
I did the same, just in case at some point it is updated to run in Pull Requests as a safe guard, even if it is not supposed to do so.
| ecosystem: | ||
| access_level: MANAGE_BUILD_AND_READ | ||
| everyone: | ||
| access_level: READ_ONLY |
There was a problem hiding this comment.
backport pipeline has
everyone:
access_level: BUILD_AND_READ
Not against lowering the permissions, double checking to see if it is intended.
There was a problem hiding this comment.
It's expected to have that value 👍
This would allow to run this pipeline for any user that merges Pull Requests in the integrations.
Proposed commit message
The public
integrationspipeline can fail to trigger the privateintegrations-backportpipeline in some scenarios due to public→privatepipeline restrictions in Buildkite. This PR introduces a new dedicated
private pipeline (
integrations-backport-dispatch) that reliably triggersintegrations-backporton merges to main.WHAT:
.buildkite/pipeline.backport-dispatch.yml: private pipeline thatruns
check-backports-inventoryandtrigger-backport-createon pushesto
mainwhen.backports.ymlchanges.pipeline.yml: removed thetrigger-backport-createstep (moved todispatch pipeline); narrowed
check-backports-inventoryto PR-only sincethe main-push case is now owned by the dispatch pipeline.
pipeline.backport.yml: addedintegrations-backport-dispatchas avalid trigger source in the
check-uiguard; added failure emailnotifications scoped to automated runs from the dispatch pipeline.
trigger_backport.sh: added a safeguard that exits 1 if backport branchcreation is attempted from any pipeline other than
integrations-backport-dispatch.catalog-info.yaml: registered the new pipeline as a Backstage resource.pull-requests.json: added the new pipeline entry andpipeline.backport-dispatch.ymltoskip_ci_on_only_changed.non_package_patterns.txt: addedpipeline.backport-dispatch.ymlsochanges to it alone do not trigger package integration tests.
WHY:
Buildkite restricts public pipelines from triggering private pipelines in
certain scenarios (e.g. fork builds, specific webhook configurations). By
moving the backport branch creation trigger to a private pipeline, we
eliminate that failure mode while keeping the dry-run validation in the
public
integrationspipeline for PR builds.An example of the failure this addresses can be seen in:
https://buildkite.com/elastic/integrations/builds/46280
Author's Checklist
0c3d9a6f47("Skip integrations tests - to be removed") before merging — it was added for testing purposes only.Related issues