-
Notifications
You must be signed in to change notification settings - Fork 14
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
base: main
Are you sure you want to change the base?
Conversation
* get latest stable or pre-release * get all tags * get obsolete pre-releases
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
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
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
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
ea5541f
to
c5f5a1c
Compare
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
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
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
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
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
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
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
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
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
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.
c5f5a1c
to
f81a49d
Compare
Instead of continuously adding/removing branches such as |
There was a problem hiding this 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?
for outstandingPreRelease in `python3 ./build-scripts/k8s_releases.py get_obsolete_prereleases`; do | ||
branch="autoupdate/${outstandingPreRelease}" | ||
if git branch -r | grep "origin/$branch"; then | ||
echo "Cleaning up obsolete pre-release branch: $branch" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are doing the cleanup here, then what is this for: https://github.com/canonical/canonical-kubernetes-release-ci/pull/18/files#diff-ce5e51b2f5af159f9e18385b27ee73318dad2d035680225b48298aba83cd60e2R90
I'd leave the branch creation and deletion to the ci repo and only perform the version update here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workflow currently handles git branches, the other one manages launchpad recipes.
run: | | ||
echo ${{ steps.determine.outputs.preRelease }} > ./build-scripts/components/kubernetes/version | ||
git add ./build-scripts/components/kubernetes/version | ||
git commit -m "Update k8s version to ${{ steps.determine.outputs.preRelease }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move all of those steps into a script, similar to
#!/usr/bin/env python3 |
@@ -0,0 +1,87 @@ | |||
#!/usr/bin/env python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to add all of this here (see my comment above).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand what you mean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. You mean moving the pre-release checks to the "update-components.yaml" script and the branch management to the other project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One problem is that update-components.yaml
will simply create a PR that updates the component
versions. However, we also need to sync the changes from the main
branch of k8s-snap, which is why the new job currently does a force push.
@petrutlucian94 regarding your comment
We don't need |
I see. Do we keep the alpha and beta branches once the rc comes out? |
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 However, we also need to sync the k8s-snap changes from the |
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.
The new workflow will be executed nightly and whenever a patch merges on main.