Skip to content

Conversation

@knative-prow-robot
Copy link

This is an automated cherry-pick of #436

Automatically sets the GOTOOLCHAIN=auto for knative.dev/toolbox tools

This commit introduces a new shell helper function, `resolve_dep_version`,
which retrieves the version of a specified Go module from the project's
`go.mod` file.

As part of this change:
- All usages of `knative.dev/toolbox/...@latest` have been pinned to a
  specific commit (`@bc7e152`) to ensure reproducible builds and prevent
  unexpected failures due to upstream changes.
- The shell script test harness has been improved to more reliably locate
  the `go` executable, making the tests more robust across different
  environments.
The `go_run` helper function is updated to set `GOTOOLCHAIN=auto`
when executing toolbox tools.
This change corrects the logic to set `GOTOOLCHAIN=auto` for any package within the `knative.dev/toolbox` module.
This commit makes two corrections to the test suite in `sharedlib_test.go`:

1.  In the main test runner, the `errOut` variable (which captures stderr) was incorrectly being checked against the `outputTypeStdout` constant. This has been corrected to `outputTypeStderr` to ensure test failure messages accurately reflect the stream being checked.

2.  Potential errors from `io.ReadAll` when capturing stdout and stderr in the `goRunHelpPrefetcher` were being ignored. Assertions have been added to ensure that any errors during these reads are caught, making the test more robust.
@knative-prow knative-prow bot requested review from cardil and upodroid October 16, 2025 12:28
@knative-prow knative-prow bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 16, 2025
Copy link
Contributor

@cardil cardil left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2025
@knative-prow
Copy link

knative-prow bot commented Oct 16, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cardil, knative-prow-robot

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 16, 2025
@knative-prow knative-prow bot merged commit f2be520 into knative:release-1.19 Oct 16, 2025
2 checks passed
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