Repository navigation
backport: deploy backport-branch automation workflows to active backport branches #19262
Description
Summary
Several workflows trigger on events scoped to backport-* branches — sync-backport-changelog.yml (#19215) on push, post-backport-branch.yml (#19214) on pull_request, and the owner-sync CI check (#19686) on pull_request — and GitHub Actions resolves both event types from the workflow files present on the branches involved in the event, not from main:
pushworkflows execute from the workflow file on the branch being pushed to.pull_request(non-pull_request_target) workflows execute from a merge of the PR's head and base branches.
In both cases, if the workflow file is absent from the backport branch, GitHub never schedules it — the automation is silently skipped for every existing branch.
This issue covers the one-time migration to add these workflows (and any scripts they call) to all currently active branches.
This issue is a follow-up to #19215, #19214, and #19686 — existing branches will not benefit from this automation until the migration is run, but each of those issues can ship and be useful for all newly created branches immediately.
Background
The existing backport branches were created from commits that predate the backport automation work. The backport_branch.sh script already copies the required files when creating new branches, so new branches are covered from day one. The gap is the existing active branches, which need a one-time migration after #19215, #19214, and #19686 ship.
There is no workaround via workflow_run or workflow_dispatch — both push and pull_request events on a backport branch will only fire workflows that already exist on that branch (or, for pull_request, on the head branch cut from it).
Deliverables
One-time migration script
A script (or documented manual procedure) that, for each active branch in .backports.yml:
- Checks out the backport branch
- Copies
.github/workflows/sync-backport-changelog.yml,.github/workflows/post-backport-branch.yml, the owner-sync CI check workflow introduced in Sync package owners between backport branches and main #19686, and any scripts they call (resolved at implementation time from each issue's deliverables) onto the branchConsider reusing the same approach
backport_branch.shalready uses to copy required files frommainwhen creating new branches (git checkout main -- <path>per file/directory) instead of building a separate ad hoc copy mechanism for this migration script. - Opens a PR against the backport branch with the label
automation
The script can be run once by the ecosystem team after #19215, #19214, and #19686 ship. A migration PR per branch is preferred over a force-push so that the addition goes through CI and review.
Note: the exact set of files to copy is determined by #19215's, #19214's, and #19686's final implementations. Coordinate with those issues before running the migration.
Considerations
- File set may grow: if future issues add more workflows or scripts that need to run on backport branches, the migration script should be extended and re-run. This is now the third workflow requiring this treatment — worth defining an explicit manifest of "files required on every backport branch" rather than continuing to hard-code individual filenames.
- Sync package owners between backport branches and main #19686 has two deliverables — only one belongs here: syncing owners into
manifest.yml/CODEOWNERSat backport-PR-creation time lives inbackport_apply.sh, invoked by automation frommain's checkout — it is not branch-resident and needs no migration. The CI check enforcing owner sync on PRs targeting a backport branch is the part that matters here; confirm with Sync package owners between backport branches and main #19686's implementation whether it's a new workflow file (add to the copy list above) or a step added to an already-migrated file (the migration would then need to push updates to previously migrated branches, not just an initial copy). - Migration ordering: run the migration only after backport: sync changelog entries from backport branches to main automatically #19215, backport: automate backport PR creation from checklist and fix changelog links #19214, and Sync package owners between backport branches and main #19686 are fully merged and stable. Running it against a partially implemented workflow risks pushing a broken file to production branches.
Acceptance criteria
- All currently active branches listed in
.backports.ymlhavesync-backport-changelog.yml,post-backport-branch.yml, and the owner-sync CI check (and their dependencies) present - Pushing to any active backport branch after migration triggers
sync-backport-changelog.ymlcorrectly - Opening an
auto-backportPR against any active branch after migration correctly triggerspost-backport-branch.yml - All currently active branches enforce the owner-sync CI check from Sync package owners between backport branches and main #19686 on PRs targeting them
- Migration PRs are labelled
automationand do not triggerauto-backport.ymlon merge
Activity
infra-vault-gh-plugin-prod commentedon May 28, 2026
Pinging @elastic/ecosystem (Team:Ecosystem)
github-actions commentedon May 28, 2026
tl;dr: This should be sequenced as a post-
#19215migration, but it is not executable yet from currentmainbecause.backports.ymlis missing (no authoritative active-branch list) and the sync workflow file is not present in this checkout.Recommendation
Proceed with this issue, but gate execution on two prerequisites:
#19215is merged and the finalsync-backport-changelogfile set is known..backports.yml, which is not in currentmain).Then run a one-time per-branch PR migration (not force-push), label each PR
automation, and explicitly trigger CI for workflow-only changes.Findings
ls .github/workflows | grep -E 'backport|changelog' || true(no output).backports.ymldoes not exist in current checkout, so the acceptance criterion “branches listed in.backports.yml” cannot be executed yet.test -f .backports.yml && echo present || echo missing→missinggit ls-remote --heads origin 'backport-*' | wc -l→58mainwhen creating backport branches..buildkite/scripts/backport_branch.sh:206-211#19215/#19262are needed.docs/extend/developer-workflow-support-old-package.md:117-121.github/workflows/can skip default Buildkite PR CI unless manually triggered..buildkite/pull-requests.json:16,26,38Verification
Detailed Action Plan
Finalize dependencies from
#19215.github/workflows/sync-backport-changelog.yml, plus any invoked scripts/actions).#19262explicitly defers exact file set to#19215final implementation.Establish active branch source of truth
.backports.ymlis intended, land/populate it first.#19262acceptance criteria to reference it explicitly.Generate one PR per active backport branch
main.automationlabel at PR creation.Prevent silent CI gaps for workflow-only PRs
.github/workflows/-only changes can skip default Buildkite PR CI (.buildkite/pull-requests.json:26), run the required PR checks explicitly (e.g., manual trigger policy used by the team).Roll out and verify
sync-backport-changelog.ymlis picked up from branch context.Future-proof file propagation
Related Items
automationlabel behavior.buildkite/scripts/backport_branch.sh:90-106.buildkite/scripts/backport_branch.sh:206-211.github/workflowsfrommain.buildkite/pull-requests.json:16,26,38docs/extend/developer-workflow-support-old-package.md:117-121Note
🔒 Integrity filter blocked 5 items
The following items were blocked because they don't meet the GitHub integrity level.
search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".pull_request_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter:What is this? | From workflow: Issue Triage
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
juliaElastic commentedon Jun 24, 2026
@mrodm @jsoriano The blockers are both closed, is this issue ready to work on in next sprint?
mrodm commentedon Jun 26, 2026
@juliaElastic Yes, this could be done as part of the next sprint. We will need to check if all the CI scripts should be updated, maybe there are some backport branches that could have the CI pipeline broken now.
It could be worth also picking up #19213 in the same sprint; it's unblocked too.
mrodm commentedon Jul 3, 2026
It would be better to wait for this PR to be merged #19930 before starting with this issue
It also needs to be checked if it is needed to sync other changes from other backport workflows or scripts and mage targets used in the workflows. If so, it could be done at the same time.
mrodm commentedon Jul 6, 2026
post-backport-branch.ymlworkflow (to be introduced in #19214) has the same failure mode described here, just via a different trigger. It usespull_request: openedtargetingbackport-*, and non-pull_request_targetevents resolve the workflow definition from a merge of the PR's head and base branches — not frommain. Since the head branch (auto-backport/<package>-<major.minor>-<sha>) is always cut directly from the backport branch, and neither branch touches.github/workflows/, the file effectively has to already exist on the backport branch for GitHub to schedule the workflow at all. Existing active branches predate #19214, so they'd hit the same silent no-op this issue was written to fix forsync-backport-changelog.yml.Same happens once this issue #19686 would be fixed. It would require the scripts and mage targets to be present in the backport branches that were already created.
Given that, I think it would be better to update this issue related to sync scripts, workflows and mage targets instead of filing a separate follow-up issue later. If agreed, I'll broaden the title to something like
backport: deploy backport-branch automation workflows to active backport branchesand update the issue description to includepost-backport-branch.ymlin the migration scope. cc @elastic/ecosystem @bturquetDoing so, this issue would be blocked by #19214 and #19686 .
[-]backport: deploy sync-backport-changelog workflow to active backport branches[/-][+]backport: deploy backport-branch automation workflows to active backport branches[/+]mrodm commentedon Jul 8, 2026
Talked offline with @teresaromero
Updated the title and description to describe that it should also be taken into account the changes in #19214 and #19686 for this sync for the backport branches that are already created. And mark it as blocked.
cc @bturquet
mrodm commentedon Jul 30, 2026
Active backport branches
Generated from
.backports.ymlon 2026-07-30. Includes branches wherearchived: falseandmaintained_untilis null or not yet passed.aws
backport-aws-7.3backport-aws-7.2backport-aws-7.1[backport-aws-7.1] Sync CI configuration with main branch #21150backport-aws-7.0backport-aws-6.x(maintained until 2027-01-16) [backport-aws-6.x] Sync CI configuration with main branch #20414backport-aws-3.17[backport-aws-3.17] Sync CI configuration with main branch #20472backport-aws-3.13[backport-aws-3.13] Sync CI configuration with main branch #21310backport-aws-2.30[backport-aws-2.30] Sync CI configuration with main branch #21316backport-aws-2.25[backport-aws-2.25] Sync CI configuration with main branch #21318backport-aws-2.24[backport-aws-2.24] Sync CI configuration with main branch #21321backport-aws-1.51[backport-aws-1.51] Sync CI configuration with main branch #21323--coverage-formatparameterelastic-package stack shellinitcommandcloud_asset_inventory
backport-cloud_asset_inventory-1.4[backport-cloud_asset_inventory-1.4] Sync CI configuration with main branch #21191backport-cloud_asset_inventory-1.3[backport-cloud_asset_inventory-1.3] Sync CI configuration with main branch #21192backport-cloud_asset_inventory-1.1[backport-cloud_asset_inventory-1.1] Sync CI configuration with main branch #21193cloud_security_posture
backport-cloud_security_posture-3.2[backport-cloud_security_posture-3.2] Sync CI configuration with main branch #20513backport-cloud_security_posture-3.1[backport-cloud_security_posture-3.1] Sync CI configuration with main branch #20514backport-cloud_security_posture-3.0[backport-cloud_security_posture-3.0] Sync CI configuration with main branch #21195backport-cloud_security_posture-2.0[backport-cloud_security_posture-2.0] Sync CI configuration with main branch #21277backport-cloud_security_posture-1.13[backport-cloud_security_posture-1.13] Sync CI configuration with main branch #21276backport-cloud_security_posture-1.10[backport-cloud_security_posture-1.10] Sync CI configuration with main branch #21275backport-cloud_security_posture-1.9[backport-cloud_security_posture-1.9] Sync CI configuration with main branch #21274backport-cloud_security_posture-1.8[backport-cloud_security_posture-1.8] Sync CI configuration with main branch #21273backport-cloud_security_posture-1.7[backport-cloud_security_posture-1.7] Sync CI configuration with main branch #21259--coverage-formatparameterbackport-cloud_security_posture-1.5[backport-cloud_security_posture-1.5] Sync CI configuration with main branch #21245--coverage-formatparameterbackport-cloud_security_posture-1.4[backport-cloud_security_posture-1.4] Sync CI configuration with main branch #21241--coverage-formatparameterelastic-package stack shellinitcommandbackport-cloud_security_posture-1.3[backport-cloud_security_posture-1.3] Sync CI configuration with main branch #21235--coverage-formatparameterelastic-package stack shellinitcommandbackport-cloud_security_posture-1.2[backport-cloud_security_posture-1.2] Sync CI configuration with main branch #21234--coverage-formatparameterelastic-package stack shellinitcommandbackport-cloud_security_posture-1.1[backport-cloud_security_posture-1.1] Sync CI configuration with main branch #21233--coverage-formatparameterelastic-package stack shellinitcommandbackport-cloud_security_posture-1.0[backport-cloud_security_posture-1.0] Sync CI configuration with main branch #21194--coverage-formatparameterelastic-package stack shellinitcommandcrowdstrike
backport-crowdstrike-1.52[backport-crowdstrike-1.52] Sync CI configuration with main branch #21302backport-crowdstrike-1.46[backport-crowdstrike-1.46] Sync CI configuration with main branch #21307elastic_agent
backport-elastic_agent-2.5[backport-elastic_agent-2.5] Sync CI configuration with main branch #21189gcp
backport-gcp-2.22[backport-gcp-2.22] Sync CI configuration with main branch #20555--coverage-formatparameterelastic-package stack shellinitcommandgoogle_workspace
backport-google_workspace-3.0[backport-google_workspace-3.0] Sync CI configuration with main branch #21168kubernetes
backport-kubernetes-1.83[backport-kubernetes-1.83] Sync CI configuration with main branch #20430backport-kubernetes-1.62[backport-kubernetes-1.62] Sync CI configuration with main branch #20434backport-kubernetes-1.39[backport-kubernetes-1.39] Sync CI configuration with main branch #20542--coverage-formatparameterelastic-package stack shellinitcommandsecurity_detection_engine
backport-security_detection_engine-9.4[backport-security_detection_engine-9.4] Sync CI configuration with main branch #20416backport-security_detection_engine-9.3[backport-security_detection_engine-9.3] Sync CI configuration with main branch #20419backport-security_detection_engine-9.2Set as archived [backport_branch]: copy .gitignore and preserve K8S_VERSION/KIND_VERSION #20432backport-security_detection_engine-8.19[backport-security_detection_engine-8.19] Sync CI configuration with main branch #20426sql
backport-sql-0.6[backport-sql-0.6] Sync CI configuration with main branch #21155synthetics
backport-synthetics-1.0[synthetics-1.0] Sync CI configuration with main branch #21171--coverage-formatparameterelastic-package stack shellinitcommandtenable_io
backport-tenable_io-3.10[backport-tenable_io-3.10] Sync CI configuration with main branch #21173ti_abusech
backport-ti_abusech-2.6[backport-ti_abusech-2.6] Sync CI configuration with main branch #21176wiz
backport-wiz-1.8[backport-wiz-1.8] Sync CI configuration with main branch #21188Skipped:
backport-apm-8.15,backport-aws-7.15.0,backport-elastic_package_registry-0.2, and all archivedsecurity_detection_enginebranches (8.6 through 9.1 except 8.19).mrodm commentedon Aug 5, 2026
Created PRs to fix some issues found while deploying files into backport branches:
mrodm commentedon Aug 5, 2026
While syncing the new CI configuration into old backport branches I found several errors caused by mismatch of go versions and failures while running dependencies that were updated.
Trying to find a solution to keep the backport tool as much separated as possible , so it is easy to copy into old backport branches.
mrodm commentedon Aug 5, 2026
Created this PR #20556 that extracts the code necessary for backport automation into its own CLI binary at
cmd/backportwith its own go.mod. That will allow to copy that folder safely to other backport branches, and it will not update thego.modfrom the root of the working copy.mrodm commentedon Aug 7, 2026
To avoid another round of Pull Requests updating backport branches, it would be better to update those backport branches once this issue is closed: #19321
There is a PR already opened for this #20578
mrodm commentedon Aug 7, 2026
Related PR to update the checklist comment #20605 to include more information for developers
mrodm commentedon Sep 7, 2026
Given the current branches that should be updated, there are some of these branches that their packages require to run Terraform for their tests.
One of the latest changes required to fix in elsatic-package was elastic/elastic-package#3876 . The Terraform Dockerfile required to be updated to fix the package names for google-cloud sdk.
This change should be backported to the backport branches that reuqire Terraform:
All the other backport branches would not be easy to use the latest elastic-package version because they are too old and there could be unexpected changes. I'd try if possible to create new patch versions via backport/hotfixes branches.
cc @teresaromero @bturquet
EDIT:
And it would be needed to add the required labels in the terraform resources too.
Example for crowdstrike: #20706
mrodm commentedon Sep 15, 2026
This PR #21243 ensures that the Pull Requests created to keep the changelogs in sync (with the backported versions) have an assignee set.
mrodm commentedon Sep 17, 2026
Backport branches have been updated with all the CI changes to run the backport tool and workflows.
Moreover, the fix related to assigning an user to the sync changelog PR has been also backported to all branches #21243
There is a PR to include the assignment of the user in the Pull Requests created targeting backport branches (
auto-backport.ymlworkflow) #21379As this workflow just runs on main, it should not be needed to backport it to all the backport branches.
Once that last PR #21379 is merged, this issue could be closed.
mrodm commentedon Sep 18, 2026
Closing this issue, since all backport branches updated, and latest fixes found have also been merged into main.