Skip to content

Conversation

@xrstf
Copy link
Contributor

@xrstf xrstf commented Oct 31, 2025

Summary

This resurrects #3431, but better.

The main issue I could not solve in the previous PR was @embik's wish to have checksums being checked when downloading a tool. It would have been trivial to just record the checksum for the host's specific OS/arch combo, because that's the binary we just downloaded, BUT trouble arises when anyone wants to update a tool like golangci-lint: If all I can do is update the checksum for my own OS/arch combo, then everyone on other machines will suddenly run into issues.

To solve this, the download script now doesn't get the full, final URL passed as an arg, but instead a URL pattern (with placeholders like {GOOS}). This enables the script to construct the URLs for any other OS/arch combo, download those, calculate the checksums and update all golangci-lint checksums in one go.

Since I want to use the same approach in my private projects, I worked on this on my own time and therefore created the repo at Codeberg.

Using it

Unless you want to update a tool, nothing changes for you. make lint will still just download golangci-lint and use it.

If you want to update a tool, you have to

  • bump the version in the Makefile (as before)
  • run the make command to download the tool (make imports would also, for example, work for refreshing golangci-lint) with the env variable UGET_UPDATE=true. This will instruct µget to not install the binary for you, but re-download and re-checksum all variants of the tool that is knows from the checksum file. I.e. UGET_UPDATE=true make lint will update all golangci-lint checksums hack/tools.checksums. Afterwards make lint just works as expected.

What Type of PR Is This?

/kind cleanup

Release Notes

NONE

@kcp-ci-bot kcp-ci-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the DCO. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Oct 31, 2025
@kcp-ci-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kcp-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from xrstf. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@kcp-ci-bot kcp-ci-bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 31, 2025
@xrstf
Copy link
Contributor Author

xrstf commented Oct 31, 2025

/test all

@xrstf
Copy link
Contributor Author

xrstf commented Oct 31, 2025

/test pull-kcp-lint

1 similar comment
@xrstf
Copy link
Contributor Author

xrstf commented Oct 31, 2025

/test pull-kcp-lint

@xrstf
Copy link
Contributor Author

xrstf commented Oct 31, 2025

/test pull-kcp-lint

@xrstf
Copy link
Contributor Author

xrstf commented Oct 31, 2025

/test pull-kcp-lint

@xrstf
Copy link
Contributor Author

xrstf commented Oct 31, 2025

/test all

@xrstf
Copy link
Contributor Author

xrstf commented Oct 31, 2025

/test all

@xrstf
Copy link
Contributor Author

xrstf commented Nov 1, 2025

/retest

1 similar comment
@xrstf
Copy link
Contributor Author

xrstf commented Nov 1, 2025

/retest

@xrstf
Copy link
Contributor Author

xrstf commented Nov 3, 2025

/test all

@xrstf
Copy link
Contributor Author

xrstf commented Nov 3, 2025

/test all

@xrstf xrstf marked this pull request as ready for review November 3, 2025 13:29
@kcp-ci-bot kcp-ci-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 3, 2025
@mjudeikis
Copy link
Contributor

If you want to update a tool, you have to
bump the version in the Makefile (as before)
run the make command to download the tool (make imports would also, for example, work for refreshing golangci-lint) with the env variable UGET_UPDATE=true. This will instruct µget to not install the binary for you, but re-download and re-checksum all variants of the tool that is knows from the checksum file. I.e. UGET_UPDATE=true make lint will update all golangci-lint checksums hack/tools.checksums. Afterwards make lint just works as expected.

I dont quite get this.

  1. Update version in make file
  2. run make codegen or whatever you just updated
  3. I got new binary but no update
  4. I run GET_UPDATE=true make codegen and still no update.

I Im a bit lost on how to update the checksums now?

@mjudeikis
Copy link
Contributor

/retest

@xrstf
Copy link
Contributor Author

xrstf commented Nov 5, 2025

controller-gen accidentally was left in a superposition where it was a Go module (those are not checksummed), but it still had checksums in the checksum file from my previous testing. I have now corrected it and now the checksums will be updated as described.

@kcp-ci-bot
Copy link
Contributor

@xrstf: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kcp-test-e2e-multiple-runs cee7843 link true /test pull-kcp-test-e2e-multiple-runs

Full PR test history

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants