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

Add update script to fetch new kn version and update formulas #138

Merged
merged 7 commits into from
Mar 7, 2024

Conversation

dsimansk
Copy link
Contributor

@dsimansk dsimansk commented Feb 29, 2024

I've done a bit of overhaul on the script we have for manual update.

My idea is to drive the execution through GH actions primarily, although it's runable locally in current format. Create one GH action with manual run dispatch trigger. And periodical trigger on a day after patch release job is executed, give or take simply put once per week.

The logic of fetching version is taken from client and usual git parsing tag approach.

Then generating the file based on template. Also old file is always generated to get rid of sed shenanigans. :)

It can update to current patch version release and bump to new 1.y.z minor every release cycle.

It can't update previous patch versions though. I could add a logic to always check and reconcile N-2 version. But seemed like a corner case to me.

Superseding: https://github.com/knative/homebrew-client/blob/main/hack/update-versions.sh

/cc @rhuss

@knative-prow knative-prow bot requested a review from rhuss February 29, 2024 19:22
@knative-prow knative-prow bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 29, 2024
@dsimansk
Copy link
Contributor Author

dsimansk commented Mar 1, 2024

The update action showcase on my fork: dsimansk#1

@dsimansk
Copy link
Contributor Author

dsimansk commented Mar 1, 2024

Failed CI check is unrelated to this changes, being addressed by #137.

Copy link
Contributor

@rhuss rhuss left a comment

Choose a reason for hiding this comment

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

Thanks, looks great! Some minor nits inline, as usual ;-)

.github/workflows/knative-update-release.yaml Outdated Show resolved Hide resolved
hack/update-codegen.sh Outdated Show resolved Hide resolved
hack/update-codegen.sh Outdated Show resolved Hide resolved
hack/update-codegen.sh Outdated Show resolved Hide resolved
hack/update-codegen.sh Outdated Show resolved Hide resolved
hack/update-codegen.sh Outdated Show resolved Hide resolved
@dsimansk
Copy link
Contributor Author

dsimansk commented Mar 6, 2024

@rhuss updated per review suggestions. Thanks! 46a5bed


# Generate file based on the inlined HEREDOC template.
function generate_tap_file() {
out=$1
Copy link
Contributor

Choose a reason for hiding this comment

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

you could mark all those variables as local

Copy link
Contributor Author

@dsimansk dsimansk Mar 6, 2024

Choose a reason for hiding this comment

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

Well, I had that though, but then shellcheck wanted me to split declaration and I was too lazy to do it. :)

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 change it NP.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

strange, wonder what the reasoning of shellcheck is for insisting of having declaration and initialization in two statements and why it doesn't complain about global variables ;-)

Copy link
Contributor

@rhuss rhuss left a comment

Choose a reason for hiding this comment

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

Looks good to me with one minor nit, but I don't insist on that :-)

/approve
/lgtm
/hold

@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 6, 2024
@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Mar 6, 2024
@knative-prow knative-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 6, 2024
@dsimansk
Copy link
Contributor Author

dsimansk commented Mar 6, 2024

@rhuss updated with local. I've seen that coming from miles away, anyway. :)

/unhold

@knative-prow knative-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 6, 2024
@rhuss
Copy link
Contributor

rhuss commented Mar 7, 2024

/approve
/lgtm

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Mar 7, 2024
Copy link

knative-prow bot commented Mar 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dsimansk, rhuss

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

@rhuss
Copy link
Contributor

rhuss commented Mar 7, 2024

Thanks again for taking care!

@knative-prow knative-prow bot merged commit 550050e into knative:main Mar 7, 2024
4 checks passed
@dsimansk dsimansk deleted the pr/update-kn branch March 7, 2024 17:08
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. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants