From c46735aa51f23af1be9454aa7736f86db2b486c2 Mon Sep 17 00:00:00 2001 From: mvlassis Date: Tue, 24 Mar 2026 17:40:01 +0200 Subject: [PATCH 1/4] 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..41ae51c --- /dev/null +++ b/.github/automatic_backport_tracks.yaml @@ -0,0 +1,2 @@ +automatic_backport_tracks: + - track/2.0 diff --git a/.github/workflows/on_pull_request.yaml b/.github/workflows/on_pull_request.yaml index a59378a..e55eba9 100644 --- a/.github/workflows/on_pull_request.yaml +++ b/.github/workflows/on_pull_request.yaml @@ -8,6 +8,15 @@ on: pull_request: 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 " build-charm: name: Build charm runs-on: ubuntu-24.04 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 f770c326ebb11babe610ed39caa67987c5797773 Mon Sep 17 00:00:00 2001 From: mvlassis Date: Mon, 30 Mar 2026 14:19:06 +0300 Subject: [PATCH 2/4] chore: sync PR workflow comments with admission-webhook-operator --- .github/workflows/on_pull_request.yaml | 30 +------------------ .github/workflows/on_pull_request_closed.yaml | 7 ++++- 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/.github/workflows/on_pull_request.yaml b/.github/workflows/on_pull_request.yaml index e55eba9..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 @@ -17,43 +18,14 @@ jobs: with: track_file_path: ".github/automatic_backport_tracks.yaml" label_prefix: "backport " - build-charm: - name: Build charm - runs-on: ubuntu-24.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup LXD - uses: canonical/setup-lxd@main - with: - channel: 5.21/stable - - - name: Install charmcraft - run: sudo snap install charmcraft --classic - - - name: Build charm under test - run: charmcraft pack --verbose - - - name: Archive charm - uses: actions/upload-artifact@v4 - with: - name: built-charm - path: "*.charm" - retention-days: 5 tests: name: Run Tests - needs: - - build-charm uses: ./.github/workflows/integrate.yaml secrets: inherit # publish runs in parallel with tests, as we always publish in this situation publish-charm: name: Publish Charm - needs: - - build-charm uses: ./.github/workflows/publish.yaml secrets: inherit - 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 From f0ee77ebc87ee7ca1a97247edc35fecaf9612bf7 Mon Sep 17 00:00:00 2001 From: mvlassis Date: Thu, 2 Apr 2026 20:18:59 +0300 Subject: [PATCH 3/4] Revert "chore: sync PR workflow comments with admission-webhook-operator" This reverts commit f770c326ebb11babe610ed39caa67987c5797773. --- .github/workflows/on_pull_request.yaml | 30 ++++++++++++++++++- .github/workflows/on_pull_request_closed.yaml | 7 +---- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/.github/workflows/on_pull_request.yaml b/.github/workflows/on_pull_request.yaml index d5477af..e55eba9 100644 --- a/.github/workflows/on_pull_request.yaml +++ b/.github/workflows/on_pull_request.yaml @@ -1,7 +1,6 @@ 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 @@ -18,14 +17,43 @@ jobs: with: track_file_path: ".github/automatic_backport_tracks.yaml" label_prefix: "backport " + build-charm: + name: Build charm + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup LXD + uses: canonical/setup-lxd@main + with: + channel: 5.21/stable + + - name: Install charmcraft + run: sudo snap install charmcraft --classic + + - name: Build charm under test + run: charmcraft pack --verbose + + - name: Archive charm + uses: actions/upload-artifact@v4 + with: + name: built-charm + path: "*.charm" + retention-days: 5 tests: name: Run Tests + needs: + - build-charm uses: ./.github/workflows/integrate.yaml secrets: inherit # publish runs in parallel with tests, as we always publish in this situation publish-charm: name: Publish Charm + needs: + - build-charm uses: ./.github/workflows/publish.yaml secrets: inherit + diff --git a/.github/workflows/on_pull_request_closed.yaml b/.github/workflows/on_pull_request_closed.yaml index bf4c1de..c2ec251 100644 --- a/.github/workflows/on_pull_request_closed.yaml +++ b/.github/workflows/on_pull_request_closed.yaml @@ -1,21 +1,16 @@ 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 From 2ff1c7e58e8536a8d2483e440e04d02cc3093e16 Mon Sep 17 00:00:00 2001 From: Dario Faccin Date: Mon, 25 May 2026 13:21:16 +0200 Subject: [PATCH 4/4] use correct track --- .github/automatic_backport_tracks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/automatic_backport_tracks.yaml b/.github/automatic_backport_tracks.yaml index 41ae51c..d2b3fde 100644 --- a/.github/automatic_backport_tracks.yaml +++ b/.github/automatic_backport_tracks.yaml @@ -1,2 +1,2 @@ automatic_backport_tracks: - - track/2.0 + - track/1.9 \ No newline at end of file