-
Notifications
You must be signed in to change notification settings - Fork 12
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
base: main
Are you sure you want to change the base?
Conversation
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.
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: |
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.
We could additionally check for a failure of the request 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.
urlopen
will raise an exception if it doesn't get a happy code (like a 2xx)
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.
LGTM
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.
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): |
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.
Do we need to include any sort of testing for this? Or maybe I'm just being paranoid :D
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.
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
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.