Skip to content

Automate Fleet release against Rancher#4796

Merged
thardeck merged 5 commits intomainfrom
small_improvements
Mar 13, 2026
Merged

Automate Fleet release against Rancher#4796
thardeck merged 5 commits intomainfrom
small_improvements

Conversation

@thardeck
Copy link
Collaborator

@thardeck thardeck commented Mar 11, 2026

Reduces the "release Fleet against rancher/rancher" workflow to a single dropdown input by computing Fleet/chart versions and the Rancher target branch from the rancher/charts dev branch via the GitHub API, removing the need to look up four values manually.

  • compute-rancher-versions.sh: new script that derives new_fleet, new_chart, and rancher_ref from the latest chart directory in the dev-v2.X branch of rancher/charts; falls back to main when the Rancher release branch does not exist yet
  • release-against-rancher.sh: removes unused Dockerfile fallback; adds explicit build.yaml guard; detects whether to bump the Fleet API by checking for a pkg/apis/v<version> tag in the fleet repo and derives the commit hash from that same tag, avoiding a mismatch with the root v<version> tag; uses explicit go.mod/go.sum paths instead of wildcards; errors out when the target or a newer version is already present in build.yaml
  • release-against-rancher.yml: replaces four manual text inputs with a single fleet_branch choice input; all other values flow from the compute step

Successful run

@thardeck thardeck self-assigned this Mar 11, 2026
@thardeck thardeck requested a review from a team as a code owner March 11, 2026 15:16
Copilot AI review requested due to automatic review settings March 11, 2026 15:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR streamlines the “release Fleet against rancher/rancher” automation by removing manual version inputs and deriving the target Rancher ref + Fleet/Chart versions programmatically, while also updating Renovate to cover the new release branch.

Changes:

  • Simplified the workflow dispatch inputs to a fleet_branch choice and added a “compute versions” step to derive rancher_ref, new_fleet, new_chart, and whether to bump API.
  • Hardened release-against-rancher.sh (stricter bash flags, version guard checks, and Go version derived from Rancher’s go.mod in the workflow).
  • Extended Renovate configuration to include release/v0.15.

Reviewed changes

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

File Description
.github/workflows/release-against-rancher.yml Switches to computed versions and uses Rancher’s go.mod for Go setup
.github/scripts/release-against-rancher.sh Adds guard logic and refactors API bump behavior
.github/scripts/compute-rancher-versions.sh New script to compute Fleet/Chart versions and target Rancher branch
.github/renovate.json Adds release/v0.15 branch support and matching Renovate preset

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

@thardeck thardeck force-pushed the small_improvements branch from af949d5 to 5912839 Compare March 11, 2026 15:46
@thardeck thardeck added this to Fleet Mar 11, 2026
@thardeck thardeck moved this to 👀 In review in Fleet Mar 11, 2026
@thardeck thardeck force-pushed the small_improvements branch 3 times, most recently from 3a7d70e to dbad465 Compare March 12, 2026 06:00
Compute Fleet and Rancher versions, target branch, and API bump flag from
rancher/charts dev branch versions via GitHub API. User selects only the
Fleet release branch from a dropdown; removes four text inputs.

- compute-rancher-versions.sh: derives new_fleet, new_chart, rancher_ref
  (selected Rancher release branch or main on 404)
- release-against-rancher.sh: remove Dockerfile fallback (unused); add
  build.yaml existence and field guard; detect API bump from presence of
  pkg/apis/v<version> tag in the fleet repo and derive the commit from
  that same tag; use explicit go.mod/go.sum paths instead of wildcards
- release-against-rancher.yml: single fleet_branch choice input, compute
  all versions, check out rancher at computed ref
@thardeck thardeck force-pushed the small_improvements branch from dbad465 to cd8f469 Compare March 12, 2026 06:45
@thardeck thardeck requested review from sbulage and removed request for a team March 12, 2026 15:30
@sbulage sbulage requested a review from mmartin24 March 12, 2026 16:04
new_chart="${latest_chart%%+*}"

# Target the Rancher release branch when it exists; fall back to main.
rancher_ref="release/v2.${rancher_minor}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know we are far away but given this is hardcoded maybe add a note to be changed once we are in 3.x versioin?

Copy link
Collaborator Author

@thardeck thardeck Mar 12, 2026

Choose a reason for hiding this comment

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

Good point, but where should I add it?
I guess when we switch to Rancher 3.x or Fleet 1.x we will have quite some places to adapt.
The calculation is at the moment Minor Fleet Version - 1 = Rancher Minor Version - that als would most likely not work anymore in both cases.

Trying to cover a wider variety of future cases would make the script significant more complicated I think, and there still can be changes which require us to fix things, like branch or repo changes and so on.

But the good thing is that we can not really break something here, worst case we'll get a weird pull request that we can close.

Copy link
Collaborator Author

@thardeck thardeck Mar 13, 2026

Choose a reason for hiding this comment

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

I have added a comment. The drop-down list for the workflow is static, that we have to change every ~4 month (for every new Fleet minor release).
But since we manually have to branch it off anyway, I thought it is ok in combination with the convenience and higher reliability that the person releasing does not have to enter an exact or minor Fleet version themselves.

Copy link
Contributor

@sbulage sbulage left a comment

Choose a reason for hiding this comment

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

LGTM from my side 👍 but some comments from @mmartin24 to consider.

@thardeck thardeck merged commit 06b6c73 into main Mar 13, 2026
22 checks passed
@thardeck thardeck deleted the small_improvements branch March 13, 2026 06:20
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Fleet Mar 13, 2026

# Chart directory names follow the pattern <chart-version>+up<fleet-version>,
# e.g. 110.0.1+up0.15.1.
new_fleet="${latest_chart##*+up}"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a set of existing Fleet and chart versions, isn't it? Wouldn't we then overwrite an existing chart?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

5 participants