Skip to content

[CI][Backports] add integrations-backport-dispatch private pipeline for triggering backport creation - #20284

Open
mrodm wants to merge 3 commits into
elastic:mainfrom
mrodm:create_new_dispatch_backport_pipeline
Open

[CI][Backports] add integrations-backport-dispatch private pipeline for triggering backport creation#20284
mrodm wants to merge 3 commits into
elastic:mainfrom
mrodm:create_new_dispatch_backport_pipeline

Conversation

@mrodm

@mrodm mrodm commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Proposed commit message

[CI][Backports] add integrations-backport-dispatch private pipeline

Move backport branch creation trigger from the public integrations pipeline
to a new private integrations-backport-dispatch pipeline, preventing failures
caused by public-to-private pipeline trigger restrictions in Buildkite.

The public integrations pipeline can fail to trigger the private
integrations-backport pipeline in some scenarios due to public→private
pipeline restrictions in Buildkite. This PR introduces a new dedicated
private pipeline (integrations-backport-dispatch) that reliably triggers
integrations-backport on merges to main.

WHAT:

  • New .buildkite/pipeline.backport-dispatch.yml: private pipeline that
    runs check-backports-inventory and trigger-backport-create on pushes
    to main when .backports.yml changes.
  • pipeline.yml: removed the trigger-backport-create step (moved to
    dispatch pipeline); narrowed check-backports-inventory to PR-only since
    the main-push case is now owned by the dispatch pipeline.
  • pipeline.backport.yml: added integrations-backport-dispatch as a
    valid trigger source in the check-ui guard; added failure email
    notifications scoped to automated runs from the dispatch pipeline.
  • trigger_backport.sh: added a safeguard that exits 1 if backport branch
    creation 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 and
    pipeline.backport-dispatch.yml to skip_ci_on_only_changed.
  • non_package_patterns.txt: added pipeline.backport-dispatch.yml so
    changes 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 integrations pipeline for PR builds.

An example of the failure this addresses can be seen in:
https://buildkite.com/elastic/integrations/builds/46280

Author's Checklist

  • Revert commit 0c3d9a6f47 ("Skip integrations tests - to be removed") before merging — it was added for testing purposes only.

Related issues


This PR was generated with the assistance of Claude (claude-sonnet-4-6).

mrodm and others added 3 commits July 21, 2026 18:32
…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>
@mrodm mrodm self-assigned this Jul 22, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

cc @mrodm

Comment thread .buildkite/pipeline.yml
Comment on lines +173 to +174
if: |
build.branch == "nonexisting"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be reverted before merging

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is some leftover?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll remove it before merging to avoid triggering a new step for each package defined in the repo (460 or more steps).

Comment on lines +39 to +42
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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mrodm
mrodm marked this pull request as ready for review July 22, 2026 14:25
@mrodm
mrodm requested a review from a team as a code owner July 22, 2026 14:25
@mrodm
mrodm requested a review from a team July 22, 2026 14:25
@mrodm

mrodm commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator Author

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.
Thanks in advance!

Comment thread .buildkite/pipeline.yml
Comment on lines +173 to +174
if: |
build.branch == "nonexisting"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is some leftover?

Comment thread catalog-info.yaml
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')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't build PRs, build.pull_request.id == null is always true, so the second part is never evaluated.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread catalog-info.yaml
ecosystem:
access_level: MANAGE_BUILD_AND_READ
everyone:
access_level: READ_ONLY

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backport pipeline has

        everyone:
          access_level: BUILD_AND_READ

Not against lowering the permissions, double checking to see if it is intended.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's expected to have that value 👍
This would allow to run this pipeline for any user that merges Pull Requests in the integrations.

@mrodm
mrodm requested a review from mallendem July 27, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

backport: make branch creation PR-driven via .backports.yml

2 participants