Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically manage pre-release branches #916

Merged
merged 3 commits into from
Jan 9, 2025

Conversation

petrutlucian94
Copy link
Contributor

@petrutlucian94 petrutlucian94 commented Dec 18, 2024

We need to automatically create k8s-snap branches for upstream pre-releases such as v1.33.0-alpha.1.
For v1.33.0-alpha.1, we'll generate a branch called autoupdate/v1.33.0-alpha. This pre-release branch will be automatically deleted once the upstream stable release is published (e.g. 1.33.0).

Note that these branches are used by the Launchpad recipes to produce and publish k8s-snap builds.

The new workflow will be executed nightly and whenever a patch merges on main, keeping the pre-release branches in sync with the main branch.

* get latest stable or pre-release
* get all tags
* get obsolete pre-releases
@petrutlucian94 petrutlucian94 requested a review from a team as a code owner December 18, 2024 16:35
petrutlucian94 added a commit to canonical/canonical-kubernetes-release-ci that referenced this pull request Dec 19, 2024
A k8s-snap PR automatically creates and cleans up git branches
for upstream k8s pre-releases:
canonical/k8s-snap#916

Here we're adding an almost identical job that picks up these
git branches and prepares launchpad recipes.

TODOs:
* clean up obsolete pre-releases that were superseeded by a new
  pre-release or stable release
* promote beta and rc pre-releases to the corresponding snap
  risk level
petrutlucian94 added a commit to canonical/canonical-kubernetes-release-ci that referenced this pull request Dec 19, 2024
A k8s-snap PR automatically creates and cleans up git branches
for upstream k8s pre-releases:
canonical/k8s-snap#916

Here we're adding an almost identical job that picks up these
git branches and prepares launchpad recipes.

TODOs:
* clean up obsolete pre-releases that were superseeded by a new
  pre-release or stable release
* promote beta and rc pre-releases to the corresponding snap
  risk level
petrutlucian94 added a commit to canonical/canonical-kubernetes-release-ci that referenced this pull request Dec 19, 2024
A k8s-snap PR automatically creates and cleans up git branches
for upstream k8s pre-releases:
canonical/k8s-snap#916

Here we're adding an almost identical job that picks up these
git branches and prepares launchpad recipes.

TODOs:
* clean up obsolete pre-releases that were superseeded by a new
  pre-release or stable release
* promote beta and rc pre-releases to the corresponding snap
  risk level
petrutlucian94 added a commit to canonical/canonical-kubernetes-release-ci that referenced this pull request Dec 19, 2024
A k8s-snap PR automatically creates and cleans up git branches
for upstream k8s pre-releases:
canonical/k8s-snap#916

Here we're adding an almost identical job that picks up these
git branches and prepares launchpad recipes.

TODOs:
* clean up obsolete pre-releases that were superseeded by a new
  pre-release or stable release
* promote beta and rc pre-releases to the corresponding snap
  risk level
@petrutlucian94 petrutlucian94 force-pushed the lpetrut/auto-pre-release branch from ea5541f to c5f5a1c Compare December 19, 2024 07:20
petrutlucian94 added a commit to canonical/canonical-kubernetes-release-ci that referenced this pull request Dec 19, 2024
A k8s-snap PR automatically creates and cleans up git branches
for upstream k8s pre-releases:
canonical/k8s-snap#916

Here we're adding an almost identical job that picks up these
git branches and prepares launchpad recipes.

TODOs:
* clean up obsolete pre-releases that were superseeded by a new
  pre-release or stable release
* promote beta and rc pre-releases to the corresponding snap
  risk level
petrutlucian94 added a commit to canonical/canonical-kubernetes-release-ci that referenced this pull request Dec 19, 2024
A k8s-snap PR automatically creates and cleans up git branches
for upstream k8s pre-releases:
canonical/k8s-snap#916

Here we're adding an almost identical job that picks up these
git branches and prepares launchpad recipes.

TODOs:
* clean up obsolete pre-releases that were superseeded by a new
  pre-release or stable release
* promote beta and rc pre-releases to the corresponding snap
  risk level
petrutlucian94 added a commit to canonical/canonical-kubernetes-release-ci that referenced this pull request Dec 19, 2024
A k8s-snap PR automatically creates and cleans up git branches
for upstream k8s pre-releases:
canonical/k8s-snap#916

Here we're adding an almost identical job that picks up these
git branches and prepares launchpad recipes.

TODOs:
* clean up obsolete pre-releases that were superseeded by a new
  pre-release or stable release
* promote beta and rc pre-releases to the corresponding snap
  risk level
petrutlucian94 added a commit to canonical/canonical-kubernetes-release-ci that referenced this pull request Dec 19, 2024
A k8s-snap PR automatically creates and cleans up git branches
for upstream k8s pre-releases:
canonical/k8s-snap#916

Here we're adding an almost identical job that picks up these
git branches and prepares launchpad recipes.

TODOs:
* clean up obsolete pre-releases that were superseeded by a new
  pre-release or stable release
* promote beta and rc pre-releases to the corresponding snap
  risk level
petrutlucian94 added a commit to canonical/canonical-kubernetes-release-ci that referenced this pull request Dec 19, 2024
A k8s-snap PR automatically creates and cleans up git branches
for upstream k8s pre-releases:
canonical/k8s-snap#916

Here we're adding an almost identical job that picks up these
git branches and prepares launchpad recipes.

TODOs:
* clean up obsolete pre-releases that were superseeded by a new
  pre-release or stable release
* promote beta and rc pre-releases to the corresponding snap
  risk level
petrutlucian94 added a commit to canonical/canonical-kubernetes-release-ci that referenced this pull request Dec 19, 2024
A k8s-snap PR automatically creates and cleans up git branches
for upstream k8s pre-releases:
canonical/k8s-snap#916

Here we're adding an almost identical job that picks up these
git branches and prepares launchpad recipes.

TODOs:
* clean up obsolete pre-releases that were superseeded by a new
  pre-release or stable release
* promote beta and rc pre-releases to the corresponding snap
  risk level
petrutlucian94 added a commit to canonical/canonical-kubernetes-release-ci that referenced this pull request Dec 19, 2024
A k8s-snap PR automatically creates and cleans up git branches
for upstream k8s pre-releases:
canonical/k8s-snap#916

Here we're adding an almost identical job that picks up these
git branches and prepares launchpad recipes.

TODOs:
* clean up obsolete pre-releases that were superseeded by a new
  pre-release or stable release
* promote beta and rc pre-releases to the corresponding snap
  risk level
petrutlucian94 added a commit to canonical/canonical-kubernetes-release-ci that referenced this pull request Dec 19, 2024
A k8s-snap PR automatically creates and cleans up git branches
for upstream k8s pre-releases:
canonical/k8s-snap#916

Here we're adding an almost identical job that picks up these
git branches and prepares launchpad recipes.

TODOs:
* clean up obsolete pre-releases that were superseeded by a new
  pre-release or stable release
* promote beta and rc pre-releases to the corresponding snap
  risk level
petrutlucian94 added a commit to canonical/canonical-kubernetes-release-ci that referenced this pull request Dec 19, 2024
A k8s-snap PR automatically creates and cleans up git branches
for upstream k8s pre-releases:
canonical/k8s-snap#916

Here we're adding an almost identical job that picks up these
git branches and prepares launchpad recipes.

TODOs:
* clean up obsolete pre-releases that were superseeded by a new
  pre-release or stable release
* promote beta and rc pre-releases to the corresponding snap
  risk level
petrutlucian94 added a commit to canonical/canonical-kubernetes-release-ci that referenced this pull request Dec 19, 2024
A k8s-snap PR automatically creates and cleans up git branches
for upstream k8s pre-releases:
canonical/k8s-snap#916

Here we're adding an almost identical job that picks up these
git branches and prepares launchpad recipes.

TODOs:
* clean up obsolete pre-releases that were superseeded by a new
  pre-release or stable release
* promote beta and rc pre-releases to the corresponding snap
  risk level
We need to automatically create k8s-snap branches for upstream
pre-releases such as v1.33.0-alpha.1.

Whenever a new pre-release or stable release comes out, the old
pre-release branches become obsolete and are automatically
removed.

Note that these branches are used by the Launchpad recipes to
produce and publish k8s-snap builds.
@petrutlucian94 petrutlucian94 force-pushed the lpetrut/auto-pre-release branch from c5f5a1c to f81a49d Compare December 19, 2024 13:00
@petrutlucian94
Copy link
Contributor Author

petrutlucian94 commented Dec 19, 2024

Instead of continuously adding/removing branches such as autoupdate/v1.33.0-alpha.0 -> autoupdate/v1.33.0-beta.0, we may also consider having a single branch called autoupdate/v1.33-prerelease.

Copy link
Contributor

@bschimke95 bschimke95 left a comment

Choose a reason for hiding this comment

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

I think we are doing two separate things here, branch management and version updates.

Let's reuse the existing update-components scripts and CI. I believe we don't need to create a separate workflow for this.

We only need to update the logic in the upgrade scripts to correctly determine the version if this is a pre-release version. The rest should be similar to the upgrade-components workflow, no?

.github/workflows/update-pre-release-branches.yaml Outdated Show resolved Hide resolved
.github/workflows/update-pre-release-branches.yaml Outdated Show resolved Hide resolved
build-scripts/k8s_releases.py Outdated Show resolved Hide resolved
@bschimke95
Copy link
Contributor

@petrutlucian94 regarding your comment


Instead of continuously adding/removing branches such as autoupdate/v1.33.0-alpha.0 -> autoupdate/v1.33.0-beta.0, we may also consider having a single branch called autoupdate/v1.33-prerelease.

We don't need autoupdate/v1.33.0-alpha.0 but autoupdate/v1.33.0-alpha.
utoupdate/v1.33.0-prerelease does not work as we need to populate alpha to edge, beta to beta and release candidate to candiate branches so we need to maintain all 3 branches.

@petrutlucian94
Copy link
Contributor Author

We don't need autoupdate/v1.33.0-alpha.0 but autoupdate/v1.33.0-alpha.
utoupdate/v1.33.0-prerelease does not work as we need to populate alpha to edge, beta to beta and release candidate to candiate branches so we need to maintain all 3 branches.

I see. Do we keep the alpha and beta branches once the rc comes out?

@petrutlucian94
Copy link
Contributor Author

petrutlucian94 commented Dec 30, 2024

Let's reuse the existing update-components scripts and CI. I believe we don't need to create a separate workflow for this.

We only need to update the logic in the upgrade scripts to correctly determine the version if this is a pre-release version. The rest should be similar to the upgrade-components workflow, no?

That script fetches the latest stable k8s version, we could add a parameter to get pre-releases instead and maybe have a separate step in update-components.yaml for pre-releases.

However, we also need to sync the k8s-snap changes from the main branch. Having a separate job might be easier after all.

@petrutlucian94 petrutlucian94 force-pushed the lpetrut/auto-pre-release branch from d4a2b14 to 5a9f249 Compare January 8, 2025 14:06
Copy link
Contributor

@bschimke95 bschimke95 left a comment

Choose a reason for hiding this comment

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

LGTM

* use a single branch for all pre-releases of a given risk level
  v1.33.0-alpha.0 -> autoupdate/v1.33.0-alpha
* move workflow logic to k8s_release.py
@petrutlucian94 petrutlucian94 force-pushed the lpetrut/auto-pre-release branch from 5a9f249 to 64b3864 Compare January 9, 2025 10:38
@petrutlucian94 petrutlucian94 merged commit fc6016b into main Jan 9, 2025
13 checks passed
@petrutlucian94 petrutlucian94 deleted the lpetrut/auto-pre-release branch January 9, 2025 10:39
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.

2 participants