From 624391406e4abdcb3e438ffa8c60c8ba74691bcc Mon Sep 17 00:00:00 2001 From: mvlassis Date: Tue, 24 Mar 2026 17:38:33 +0200 Subject: [PATCH 1/2] feat: add automated backport support with latest track --- .github/automatic_backport_tracks.yaml | 2 ++ .github/workflows/on_pull_request.yaml | 9 +++++++++ .github/workflows/on_pull_request_closed.yaml | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 .github/automatic_backport_tracks.yaml create mode 100644 .github/workflows/on_pull_request_closed.yaml diff --git a/.github/automatic_backport_tracks.yaml b/.github/automatic_backport_tracks.yaml new file mode 100644 index 0000000..b2c35e3 --- /dev/null +++ b/.github/automatic_backport_tracks.yaml @@ -0,0 +1,2 @@ +automatic_backport_tracks: + - track/ckf-1.10 diff --git a/.github/workflows/on_pull_request.yaml b/.github/workflows/on_pull_request.yaml index 3d7eef1..73a469a 100644 --- a/.github/workflows/on_pull_request.yaml +++ b/.github/workflows/on_pull_request.yaml @@ -9,6 +9,15 @@ on: jobs: + populate-labels: + name: Populate labels + if: github.base_ref == 'main' && (github.event.action == 'opened' || github.event.action == 'reopened') + uses: canonical/charmed-kubeflow-workflows/.github/workflows/populate-labels.yaml@main + secrets: inherit + with: + track_file_path: ".github/automatic_backport_tracks.yaml" + label_prefix: "backport " + tests: name: Run Tests uses: ./.github/workflows/integrate.yaml diff --git a/.github/workflows/on_pull_request_closed.yaml b/.github/workflows/on_pull_request_closed.yaml new file mode 100644 index 0000000..c2ec251 --- /dev/null +++ b/.github/workflows/on_pull_request_closed.yaml @@ -0,0 +1,18 @@ +name: On Pull Request Closed + +on: + pull_request_target: + types: [closed] + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + backport: + name: Backport pull request + if: github.event.pull_request.merged + uses: canonical/charmed-kubeflow-workflows/.github/workflows/backport-pr.yaml@main + secrets: inherit From 2ea77ea38080d0d0989a82eb09507bc2eea4ac92 Mon Sep 17 00:00:00 2001 From: mvlassis Date: Mon, 30 Mar 2026 14:18:59 +0300 Subject: [PATCH 2/2] chore: sync PR workflow comments with admission-webhook-operator --- .github/workflows/on_pull_request.yaml | 1 + .github/workflows/on_pull_request_closed.yaml | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/on_pull_request.yaml b/.github/workflows/on_pull_request.yaml index 73a469a..d5477af 100644 --- a/.github/workflows/on_pull_request.yaml +++ b/.github/workflows/on_pull_request.yaml @@ -1,6 +1,7 @@ name: On Pull Request # On pull_request, we: +# * create backport labels if it is against main, only when the PR is opened/reopened # * always publish to charmhub at latest/edge/branchname # * always run tests diff --git a/.github/workflows/on_pull_request_closed.yaml b/.github/workflows/on_pull_request_closed.yaml index c2ec251..bf4c1de 100644 --- a/.github/workflows/on_pull_request_closed.yaml +++ b/.github/workflows/on_pull_request_closed.yaml @@ -1,16 +1,21 @@ name: On Pull Request Closed +# When a pull request is pushed on the main branch, automatically +# create backport PRs according to the labels on the pull request. +# If there are conflicts, create a PR but leave it as draft. + on: pull_request_target: types: [closed] branches: - - main + - main permissions: contents: write pull-requests: write jobs: + backport: name: Backport pull request if: github.event.pull_request.merged