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

Update the snap version of via upstream .go-version #762

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

addyess
Copy link
Contributor

@addyess addyess commented Oct 23, 2024

Overview

The update-components job should check if the go version necessary to build the upstream k8s needs to be updated.

Details

Fetch the upstream .go-version when updating the components for a branch
Update the snapcraft.yaml to reflect any go version changes.

@addyess addyess requested a review from a team as a code owner October 23, 2024 15:44
Copy link
Contributor

@louiseschmidtgen louiseschmidtgen left a comment

Choose a reason for hiding this comment

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

Thanks Adam, little suggestion.

def update_go_version(dry_run: bool):
k8s_version = (COMPONENTS / "kubernetes/version").read_text().strip()
url = f"https://raw.githubusercontent.com/kubernetes/kubernetes/refs/tags/{k8s_version}/.go-version"
with urllib.request.urlopen(url) as response:
Copy link
Contributor

Choose a reason for hiding this comment

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

We could additionally check for a failure of the request here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

urlopen will raise an exception if it doesn't get a happy code (like a 2xx)

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

Copy link
Contributor

@HomayoonAlimohammadi HomayoonAlimohammadi left a comment

Choose a reason for hiding this comment

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

Thanks a lot @addyess! LGTM! Just a minor question.

@@ -134,6 +140,25 @@ def update_component_versions(dry_run: bool):
pull_helm_chart()


def update_go_version(dry_run: bool):
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to include any sort of testing for this? Or maybe I'm just being paranoid :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so, what do you have in mind @HomayoonAlimohammadi ? As far as i see it -- none of this update-component-versions code is tested (nor is it in the product -- its just build script stuff)

I guess we can start testing it (linting/formatting...etc). Maybe need a card and another task for it? I don't see it being critical b/c it doesn't impact the final product

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.

4 participants