Skip to content

Agentic workflow to backport image bumps#10298

Open
cwayne18 wants to merge 4 commits into
rancher:masterfrom
cwayne18:agent-workflow
Open

Agentic workflow to backport image bumps#10298
cwayne18 wants to merge 4 commits into
rancher:masterfrom
cwayne18:agent-workflow

Conversation

@cwayne18

Copy link
Copy Markdown
Member

New github actions to make copilot do backports for simple image bump PRs, triggers whenever a PR gets merged to master

Signed-off-by: Chris Wayne <cwayne18@gmail.com>
@cwayne18 cwayne18 requested a review from a team as a code owner April 29, 2026 17:06
@brandond

brandond commented Apr 29, 2026

Copy link
Copy Markdown
Member

How do I even review this? Its a giant wall of autogenerated text that says DO NOT EDIT.

I guess we're supposed to just assume that none of the weird heredocs, shell execs, or huge base64-encoded blobs are sending secrets out to our AI overlords?

@cwayne18

Copy link
Copy Markdown
Member Author

make copilot review it 😅

the lock file is the result of running gh aw compile on the markdown file, I guess we're just supposed to trust the gh cli 🤷

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds an Agentic Workflows-based automation to backport simple “version/image bump” PRs merged into master onto a set of release branches by dispatching a Copilot-driven backport workflow.

Changes:

  • Introduces a dispatcher workflow that triggers on merged PRs to master and dispatches backport runs for multiple release branches.
  • Adds the agent prompt/spec (.md) describing how to detect version bumps and how to construct a safe backport PR.
  • Adds the compiled/locked Agentic Workflows GitHub Actions workflow (*.lock.yml) that runs the agent with Safe Outputs constraints.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
.github/workflows/version-bump-dispatch.yml New dispatcher workflow that fans out workflow_dispatch calls for selected release branches.
.github/workflows/version-bump-backport.md Agent instructions/spec for determining whether a PR is a version bump and creating a single backport PR.
.github/workflows/version-bump-backport.lock.yml Compiled gh-aw workflow implementation of the backport agent (execution + detection + safe outputs).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/version-bump-backport.md Outdated
Comment thread .github/workflows/version-bump-backport.lock.yml
Comment thread .github/workflows/version-bump-dispatch.yml
Comment thread .github/workflows/version-bump-dispatch.yml Outdated
Comment on lines +20 to +25
if: github.event.pull_request.merged == true
runs-on: ubuntu-slim
strategy:
matrix:
branch: [release-1.33, release-1.34, release-1.35]
fail-fast: false

Copilot AI Apr 29, 2026

Copy link

Choose a reason for hiding this comment

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

This workflow will dispatch backport attempts for every PR merged into master (3 runs per merge based on the matrix), even when the PR is not a version bump (the agent will later noop, but the Actions workload is still incurred). If the intent is to only backport image/version bumps, consider adding an early filter here (e.g., require an updateCLI label / updatecli[bot] author) to avoid unnecessary dispatches.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

This avoids the fork permission issue where GITHUB_TOKEN is read-only
for PRs from forks, which would cause the workflow dispatch to fail.
Instead, we trigger on push to master (which happens on merge) and
resolve the PR number from the merge commit.
@manuelbuil

Copy link
Copy Markdown
Contributor

OMG! That's a lot of lines.... how do you identify or "simple image bump PRs"?

@cwayne18

Copy link
Copy Markdown
Member Author

It basically just looks for any PR from updatecli/dependabot, or PRs that only touch files like build-images, version.sh, or charts version bumps

@cwayne18

cwayne18 commented May 6, 2026

Copy link
Copy Markdown
Member Author

So I tested on my fork,

https://github.com/cwayne18/rke2/pulls

is the result of having merged
cwayne18#56

@manuelbuil manuelbuil 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.

I trust you Copilot

cwayne18 and others added 2 commits May 8, 2026 17:54
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.

5 participants