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

Prepare tests for impending knative/pkg version bump #5145

Merged
merged 2 commits into from
Jul 21, 2022

Conversation

imjasonh
Copy link
Member

@imjasonh imjasonh commented Jul 16, 2022

knative/pkg#2548 changes pkg/changeset.Get to
read VCS information from information embedded by the Go compiler into
built binaries, instead of relying on the convention that a kodata/HEAD
symlink exists pointing to the repo's .git/HEAD, and a kodata/refs
points to .git/refs.

This fails in tests though, since tests don't stamp this information
into the binary where it can be read.

This change removes our tests' usage of changeset.Get and instead
replaces those fake commit SHAs with more obviously placeholder values.
It doesn't seem that the tests cared that it was an actual SHA, let
along the actual current SHA, they just needed any value that looked
like a SHA.

/kind cleanup

/assign @vdemeester
/assign @abayer
/release-note-none
cc @dprotaso

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

PR friction log:

Sorry, something went wrong.

Unverified

The signing certificate or its chain could not be verified.
knative/pkg#2548 changes pkg/changeset.Get to
read VCS information from information embedded by the Go compiler into
built binaries, instead of relying on the convention that a kodata/HEAD
symlink exists pointing to the repo's .git/HEAD, and a kodata/refs
points to .git/refs.

This fails in tests though, since tests don't stamp this information
into the binary where it can be read.

This change removes our tests' usage of changeset.Get and instead
replaces those fake commit SHAs with more obviously placeholder values.
It doesn't seem that the tests cared that it was an actual SHA, let
along the actual current SHA, they just needed any value that looked
like a SHA.
@tekton-robot tekton-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 16, 2022

Unverified

The signing certificate or its chain could not be verified.
@imjasonh imjasonh added release-note-none Denotes a PR that doesnt merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jul 16, 2022
@imjasonh
Copy link
Member Author

@imjasonh
Copy link
Member Author

Flake

/test pull-tekton-pipeline-alpha-integration-tests

@abayer
Copy link
Contributor

abayer commented Jul 16, 2022

Flake
…and I have a fix for that damned flake at #5134, btw. =)

@dprotaso
Copy link
Contributor

You'll want to bump go.mod's go version to go1.18 the vcs sha embedding happens in that version

@dprotaso
Copy link
Contributor

/lgtm

@tekton-robot
Copy link
Collaborator

@dprotaso: changing LGTM is restricted to collaborators

In response to this:

/lgtm

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.

@imjasonh
Copy link
Member Author

You'll want to bump go.mod's go version to go1.18 the vcs sha embedding happens in that version

The version in go.mod only controls what module semantics are used, not the version of the compiler that's used.

Our release process seems to already be using an image based on Go 1.18, here:

image: gcr.io/tekton-releases/dogfooding/ko@sha256:aafcfa5c22281f9e882664c3e5f234a2069a0050674c0c8d9908ccae6f0e8457

The Go inside that image is Go 1.18.1, which should work just fine for this change.

(That's not to say updating the go version in go.mod is a bad idea, just that it won't control whether we get the necessary build info embedded in our binaries, we should have those already)

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 18, 2022
@abayer
Copy link
Contributor

abayer commented Jul 19, 2022

Our release process seems to already be using an image based on Go 1.18

Will this have any implications for running tests, ko, etc, with Go 1.17? If we do need to move to building with Go 1.18 everywhere to pick up this change, I'd definitely prefer if we bumped go.mod too - I know the go 1.17 line is just specifying module semantics, but it's the best shorthand I know of to tell devs "you need to use this version of Go".

Also, we've got Go 1.17.x on a bunch of our images, such as here in test-runner: https://github.com/tektoncd/plumbing/blob/main/tekton/images/test-runner/Dockerfile#L151-L156

...which I'd assume we'll need to bump to Go 1.18.x as well?

@imjasonh
Copy link
Member Author

To reiterate, the version in go.mod does not matter when we build; it only affects the semantics of dealing with modules when we go mod tidy, go get, etc.

The only version of Go that matters when we build is the version of the go tool we use when we build (or that ko invokes), which is already Go 1.18 in our CI and release process.

The test-runner image and anything else using 1.17 should be updated soon -- Go 1.19 will be out soon, which means 1.17 will no longer be supported.

@abayer
Copy link
Contributor

abayer commented Jul 19, 2022

The only version of Go that matters when we build is the version of the go tool we use when we build (or that ko invokes), which is already Go 1.18 in our CI and release process.

Gotcha, so we should be upgrading test-runner and anywhere else to 1.18, then.

@lbernick
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 21, 2022
@tekton-robot tekton-robot merged commit 10a5ae6 into tektoncd:main Jul 21, 2022
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants