Skip to content

Conversation

justinsb
Copy link
Contributor

@justinsb justinsb commented Aug 28, 2025

Documenting our branches and branch "philosophy"


NONE

@k8s-ci-robot k8s-ci-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Aug 28, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 28, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 28, 2025
Copy link

netlify bot commented Aug 28, 2025

Deploy Preview for kubernetes-sigs-cluster-api-gcp ready!

Name Link
🔨 Latest commit d3daa95
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-cluster-api-gcp/deploys/68b0ca226d21ba0008ca392b
😎 Deploy Preview https://deploy-preview-1515--kubernetes-sigs-cluster-api-gcp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Aug 28, 2025
@justinsb
Copy link
Contributor Author

This has come up a few times now, I figure I would write down a strawman.

cc @cpanato

Feature development happens on the `main` branch, and [nightlies](nightlies.md) are released from the `main` branch also.
While we aim to keep the `main` branch healthy, it is intended for development and testing, and should not be used in production.

As such, we will aim to keep the main branch up to date with the latest versions of all dependencies (go toolchain, CAPI, other go module dependencies).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is right, we should basically auto-bump everything on main

Copy link
Member

Choose a reason for hiding this comment

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

I think we mostly already do with the dependabot setup we have. Of course we have some constraints as CAPI is normally couple with one specific k8s version and one specific go version, and we try and keep that the same in CAPI providers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, I'm hoping we can write down our intent and then use it for automation - both on doing the bumps and perhaps on reviewing PRs. It comes up in particular on go version bumps: I think that on the main branch we should bump go toolchains automatically, to the latest, even if that puts us onto a new minor or ahead of CAPI. Sometimes there will be e.g. new go vet primitives and the PR won't merge without other changes, sometimes we might find a go regression (in theory).

I can see an alternative strategy where we bump main to the latest patch versions within a minor, matching CAPI on the minor. (And for any libraries which aren't in CAPI, like say a GCP library we do bump minors). I think that would work as well: CAPI is pretty prompt at bumping.

Copy link
Member

Choose a reason for hiding this comment

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

I think I covered this in #1515 (comment)

I'd personally strive to follow CAPI as close as possible.

Also I am happy with

strategy where we bump main to the latest patch versions within a minor, matching CAPI on the minor. (And for any libraries which aren't in CAPI, like say a GCP library we do bump minors). I think that would work as well: CAPI is pretty prompt at bumping

Copy link
Member

@chrischdi chrischdi Sep 5, 2025

Choose a reason for hiding this comment

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

CAPI ~ follows its k8s dependency regarding to the go version. This does not mean a provider has to.

Note: If the Go minor version of one of our supported branches goes out of support, we should consider bumping to a newer Go minor version according to our backport policy. Usually this is done after k/k bumps the Go version in their release branches.

The right Go minor version for a Cluster API branch can be looked up as follows (based on an example):

Cluster API v1.10 has Kubernetes v1.32 as a dependency: https://github.com/kubernetes-sigs/cluster-api/blob/v1.10.0/go.mod
Kubernetes v1.32 uses Go 1.23.8 (can be seen by checking the corresponding kubekins image in https://github.com/kubernetes/test-infra/blob/1a5662a/images/kubekins-e2e-v2/variants.yaml#L19)
=> Cluster API v1.10 can be bumped to Go 1.23

source: https://github.com/kubernetes-sigs/cluster-api/tree/main/docs/release/role-handbooks/release-lead#continuously-bump-the-go-version

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the detail @chrischdi
Good to know it is not a mandatory requirement 😄
I'd still like to see them going hand in hand with respect to that, to avoid unwanted incompatibilities and surprises 😬


As such, we will aim to keep the main branch up to date with the latest versions of all dependencies (go toolchain, CAPI, other go module dependencies).

Release branches lock to a particular minor version of CAPI, but will update other dependencies on these branches while they are supported.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It sounds like we have not updated go versions on existing branches, but I think we should

Copy link
Member

Choose a reason for hiding this comment

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

You mean patch level Go version bumps right?

Copy link
Contributor Author

@justinsb justinsb Aug 29, 2025

Choose a reason for hiding this comment

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

So I think it is something we should decide. I think we want to be running a supported version of golang at all times, and I think we want to bump minors if our minor is no longer supported.

Should we say something like "for the go toolchain, we will bump to the latest supported patch within the same minor; we will bump to the latest minor if our minor goes unsupported.

(I've realized I can also say "particular minor version of CAPI - and thus of kubernetes dependencies including controller-runtime")

It might be that we've simply relied on CAPI bumping go toolchain versions in the past, and we want to continue to do that. If that's our intent - if we just want to follow CAPI versions - then I can document that instead...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Edited the above to fix incomplete thought!)

Copy link
Member

@damdo damdo Aug 29, 2025

Choose a reason for hiding this comment

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

I think this could quickly expand to a wider discussion on how many releases we support and what is our release cadence :) (which we might want to have at some point, maybe in a CAPG Community call)

I am happy either way

  1. with us bumping the go toolchain xx directive and keep that up to date with the latest supported patch release, as long as we don't touch the go xx directive, as that's the minimum required version that can be used to build the project and I wouldn't want that to change
  2. Follow what core CAPI does

My personal preference would be to follow core CAPI as closely as possible. They spent already a significant about of time oiling and perfecting the cadence and process and I think they are now at a point where folks are happy with it and it ties in well with the Go and the K8s processes. Also I think that's what the community expects anyway, and also that means we are always well compatible with that.

Copy link
Member

Choose a reason for hiding this comment

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

In core CAPI we use trivy & govulncheck (via github action) to get notified on CVE's for the release branches and bump these (if required and viable) on CVE's to include the fixes in (potential) patch releases :-)

Copy link
Member

Choose a reason for hiding this comment

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

We could think about doing that here too yeah.
I think we need to understand how that overlaps with dependabot.
Also we might be able to configure dependabot in a way so it bumps the go toolchain versions to higher patch versions when needed but without touching the main go directive.. 🤔 I know @cpanato is an expert on these things

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd also be in favor of following core CAPI. I think it makes the project easier to maintain long term as we implement a process that has been proved to work and don't have to focus on describing (and applying) our own.

It also means that future developers/maintainers that are new to CAPG but have experience in the CAPI ecosystem will have an easier time figuring out the intricacies of the project.

@@ -63,6 +63,23 @@ Example versions:
- Patch release: `v0.1.1`
- Major release: `v1.0.0`

The major and minor versions mirror the version of Cluster-API. Thus CAPG 1.11.x releases will use CAPI versions 1.11

The patch version is incremented for each release. Thus the first release of CAPG using CAPI 1.11 will 1.11.0, the second will be 1.11.1, etc
Copy link
Member

Choose a reason for hiding this comment

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

That has been true for now, but there might come a time where we need to release CAPG minor versions more frequently than CAPI minor releases.

This what many of the main CAPI providers out there already do. For example, to my knowledge, CAPA, CAPV, CAPZ don't have this CAPI to CAPI Provider minor version roping, and can and may release multiple provider versions in between core CAPI minor releases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll try to find some wording that makes it clear that we have this property today, but that we might not always have it in future. (It's a really human friendly property IMO, not having to constantly remember the translation factor!)

Copy link
Member

Choose a reason for hiding this comment

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

SGTM thanks Justin!

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we've been able to follow this until now because we haven't released that often, which meant we could just wait for a CAPI bump to create a new minor release. As we get more people involved with the project, I'd vote for increasing our release cadence. In this case, it will eventually force us to separate CAPG minor versions from CAPI's.

Copy link
Member

Choose a reason for hiding this comment

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

We discussed this also in the office hours and we are leaning towards giving us more flexibility for the future and not commit to strict numbering going forward. cc. @cpanato too

Copy link
Member

@chrischdi chrischdi Sep 5, 2025

Choose a reason for hiding this comment

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

Note: I just want to share some knowledge, no hard opinions on what to do for CAPG :-)

Note: CAPV today also ~ follows CAPI release versions, but nowadays with an offset of 3 minors, and it always uses the .1 CAPI release to include compatibility to the next k8s release.

IMHO it makes sense to follow the CAPI release cadence, which helps for planning but of course its not set in stone and sometimes a project wants to have an additional minor due to reasons.

Following CAPI's release cadence might be challenging though and could require to test early for the next release.

At the end CAPI's release cadence (of x.x.1 relases) follows k8s release cadence.

@justinsb justinsb mentioned this pull request Aug 29, 2025
Copy link
Contributor

@salasberryfin salasberryfin left a comment

Choose a reason for hiding this comment

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

Thanks @justinsb!

@@ -63,6 +63,23 @@ Example versions:
- Patch release: `v0.1.1`
- Major release: `v1.0.0`

The major and minor versions mirror the version of Cluster-API. Thus CAPG 1.11.x releases will use CAPI versions 1.11

The patch version is incremented for each release. Thus the first release of CAPG using CAPI 1.11 will 1.11.0, the second will be 1.11.1, etc
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we've been able to follow this until now because we haven't released that often, which meant we could just wait for a CAPI bump to create a new minor release. As we get more people involved with the project, I'd vote for increasing our release cadence. In this case, it will eventually force us to separate CAPG minor versions from CAPI's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants