Skip to content

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

Merged
mrodm merged 4 commits into
elastic:mainfrom
mrodm:create_new_dispatch_backport_pipeline
Jul 29, 2026
Merged

mrodm merged 4 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
Comment thread .buildkite/pipeline.yml Outdated
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 Outdated
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.

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.

Used the same settings as integrations-publish pipeline for this new pipeline.

@mrodm
mrodm requested a review from mallendem July 27, 2026 15:55
echo "Not on main branch (branch: ${BUILDKITE_BRANCH}), skipping"
exit 0
fi
if [[ "${BUILDKITE_PIPELINE_SLUG}" != "integrations-backport-dispatch" ]]; then

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 wonder if we could keep the value integrations-backport-dispatch in a shared variable across all the places is used so in case the string is changed (probably not) no typo error can occur? i see it hardcoded in a number a places

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.

Most of the usages are in the buildkite pipeline definitions, and there I think it cannot be used environment variables for that.
I will leave it as it is, that pipeline name should not change.

@teresaromero teresaromero left a comment

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.

lgtm

@mergify

mergify Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@mrodm

mrodm commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator Author

/test

@infra-vault-gh-plugin-prod

infra-vault-gh-plugin-prod Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

Package azure_frontdoor 👍(2) 💚(0) 💔(1)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
access 2518.89 2127.66 -391.23 (-15.53%) 💔

Package bitdefender 👍(1) 💚(0) 💔(2)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
push_configuration 37037.04 24390.24 -12646.8 (-34.15%) 💔
push_statistics 76923.08 58823.53 -18099.55 (-23.53%) 💔

Package jamf_protect 👍(1) 💚(3) 💔(1)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
telemetry_legacy 1792.11 1474.93 -317.18 (-17.7%) 💔

Package mimecast 👍(5) 💚(5) 💔(1)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
threat_intel_malware_grid 7407.41 5524.86 -1882.55 (-25.41%) 💔

To see the full report comment with /test benchmark fullreport

@mrodm

mrodm commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator Author

Merging since CI failures are unrelated to this change.

@mrodm
mrodm merged commit 11a2f7c into elastic:main Jul 29, 2026
8 of 9 checks passed
@mrodm
mrodm deleted the create_new_dispatch_backport_pipeline branch July 29, 2026 07:36
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

3 participants