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

fix(test): pin version not latest which just introduced to use go 1.22 #934

Merged
merged 3 commits into from
Mar 22, 2024

Conversation

zdtsw
Copy link
Member

@zdtsw zdtsw commented Mar 22, 2024

GH unit-test failing with error:

mkdir -p /home/runner/work/opendatahub-operator/opendatahub-operator/bin
test -s /home/runner/work/opendatahub-operator/opendatahub-operator/bin/setup-envtest || GOBIN=/home/runner/work/opendatahub-operator/opendatahub-operator/bin go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
go: downloading sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-2024032210[5](https://github.com/opendatahub-io/opendatahub-operator/actions/runs/8390354373/job/22978408816?pr=933#step:4:6)421-affb9[6](https://github.com/opendatahub-io/opendatahub-operator/actions/runs/8390354373/job/22978408816?pr=933#step:4:7)[7](https://github.com/opendatahub-io/opendatahub-operator/actions/runs/8390354373/job/22978408816?pr=933#step:4:8)08000
go: downloading sigs.k8s.io/controller-runtime v0.17.2
go: sigs.k[8](https://github.com/opendatahub-io/opendatahub-operator/actions/runs/8390354373/job/22978408816?pr=933#step:4:9)s.io/controller-runtime/tools/setup-envtest@latest (in sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20240322105421-affb[9](https://github.com/opendatahub-io/opendatahub-operator/actions/runs/8390354373/job/22978408816?pr=933#step:4:10)6708000): go.mod:3: invalid go version '1.22.0': must match format 1.23
make: *** [Makefile:353: /home/runner/work/opendatahub-operator/opendatahub-operator/bin/setup-envtest] Error 1

Description

How Has This Been Tested?

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@openshift-ci openshift-ci bot requested review from gmfrasca and israel-hdez March 22, 2024 12:52
@zdtsw zdtsw requested review from bartoszmajsak, VaishnaviHire and ykaliuta and removed request for israel-hdez and gmfrasca March 22, 2024 12:53
Makefile Outdated
@@ -350,7 +350,7 @@ TEST_SRC=./controllers/... ./tests/integration/... ./pkg/...
.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20240320141353-395cfc7486e6
Copy link
Contributor

@ykaliuta ykaliuta Mar 22, 2024

Choose a reason for hiding this comment

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

May be put the version in a variable somewhere on top? UPD: (Tool Versions? And it's controller-runtime version?)

Copy link
Contributor

Choose a reason for hiding this comment

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

About this... I was thinking, not as part of this PR, but how about putting such variables next to their respective install targets? For me it's somewhat easier to navigate this way.

Copy link
Contributor

Choose a reason for hiding this comment

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

About this... I was thinking, not as part of this PR, but how about putting such variables next to their respective install targets? For me it's somewhat easier to navigate this way.

My way of thinking is opposite. To change the variable then you should find the place where the install target is. Instead of having them in one visible place on top.

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm label Mar 22, 2024
@openshift-ci openshift-ci bot added the lgtm label Mar 22, 2024
@zdtsw zdtsw enabled auto-merge (squash) March 22, 2024 13:08
Copy link
Contributor

@bartoszmajsak bartoszmajsak left a comment

Choose a reason for hiding this comment

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

one little nit, otherwise LGTM

Makefile Outdated Show resolved Hide resolved
Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
@openshift-ci openshift-ci bot removed the lgtm label Mar 22, 2024
@@ -350,7 +351,7 @@ TEST_SRC=./controllers/... ./tests/integration/... ./pkg/...
.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
test -s $(ENVTEST) || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@$(ENVTEST_PACKAGE_VERSION)
Copy link
Contributor

@ykaliuta ykaliuta Mar 22, 2024

Choose a reason for hiding this comment

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

The proposal is correct (except the test is redundant, we discussed it in another PR already, the dependency itself checks the existence:

sh-5.2$ git diff
diff --git a/Makefile b/Makefile
index ceb8880c1844..1cde16c3a294 100644
--- a/Makefile
+++ b/Makefile
@@ -351,7 +351,7 @@ TEST_SRC=./controllers/... ./tests/integration/... ./pkg/...
 .PHONY: envtest
 envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
 $(ENVTEST): $(LOCALBIN)
-       test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@$(ENVTEST_PACKAGE_VERSION)
+       GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@$(ENVTEST_PACKAGE_VERSION)
 
 .PHONY: test
 test: unit-test e2e-test
sh-5.2$ make envtest
GOBIN=/home/ykaliuta/work/RHODS/opendatahub-operator/bin go install sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20240320141353-395cfc7486e6
sh-5.2$ make envtest
make: Nothing to be done for 'envtest'.

but unrelated to the PR (deserves some clean up one)
Just 2c, not blocking :)

BTW, I can understand why it was done: since it depends on the directory without | it makes the dependency unsatisfied any time something is updated inside $(LOCALBIN). But @bartoszmajsak promised to fix it ;)

@openshift-ci openshift-ci bot added the lgtm label Mar 22, 2024
Copy link

openshift-ci bot commented Mar 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bartoszmajsak, ykaliuta

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

@zdtsw zdtsw merged commit 96096cb into opendatahub-io:incubation Mar 22, 2024
7 of 8 checks passed
zdtsw referenced this pull request in zdtsw-forking/rhods-operator Mar 25, 2024
red-hat-data-services#934)

* fix(test): pin version not latest which just introduced to use go 1.22

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* update: code review

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
zdtsw referenced this pull request in red-hat-data-services/rhods-operator Mar 25, 2024
* feat(gh-action): ensures generated files are up-to-date in PR (#917)

* RHOAIENG-4433 Update readme/config files

* rework gh action based on comments

* feat(gh-action): ensures generated files are up-to-date in PR

* fix review comments

* reuse cmd

* fix(gen): upgrades to crd-ref-doc generator to latest version (#920)

fix(gen): upgrades to crd-ref-doc to latest version

- add "diff" in the failed GH action to help understand problem
- update: api doc

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: Enable annotations using golangci-lint(gh action) (#919)

* fix: Enable annotations using golangci-lint(gh action)

* update versions

* fix(make): cleans linter cache on clean (#922)

When juggling between branches golangci linter cache can have leftovers from the code that does not exist in the other branch.

This can lead to errors while running `make lint` as the linter tries to check cached sources first.

This change cleans the linter cache as part of the clean target to ensure consistency.

Here's an example of an invalid cache state leading to error:

```
WARN [runner] Can't process result by autogenerated_exclude processor: can't filter issue result.Issue{FromLinter:"ireturn", Text:"Entry returns interface (github.com/opendatahub-io/opendatahub-operator/v2/pkg/feature.DataProvider)", Severity:"", SourceLines:[]string(nil), Replacement:(*result.Replacement)(nil), Pkg:(*packages.Package)(0xc001343e00), LineRange:(*result.Range)(nil), Pos:token.Position{Filename:"/home/bartek/code/rhods/opendatahub-operator/incubation/pkg/feature/data_provider.go", Offset:1382, Line:45, Column:1}, HunkPos:0, ExpectNoLint:false, ExpectedNoLintLinter:""}: failed to get doc of file
```

* chore(Github): update issue template re-direct user for jira (#838)

* chore(Github): update issue template re-direct user for jira

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* Update .github/ISSUE_TEMPLATE/feature_request.md

Co-authored-by: Ajay Jaganathan <36824134+AjayJagan@users.noreply.github.com>

* Update .github/ISSUE_TEMPLATE/bug_report.md

Co-authored-by: Ajay Jaganathan <36824134+AjayJagan@users.noreply.github.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Co-authored-by: Ajay Jaganathan <36824134+AjayJagan@users.noreply.github.com>

* chore: Small Makefile fixes (#928)

* Go back to using `IMG ?=` rather than forcing the value with `IMG =`. This makes it easier to override the value of `IMG` for development, and it also aligns it to how `BUNDLE_IMG` is assigned.
* Add `prepare` as dependency of the `undeploy` target. This is just for convenience, although when looking at the other targets, `prepare` may simply be a missing dependency in `undeploy`.

Signed-off-by: Edgar Hernández <23639005+israel-hdez@users.noreply.github.com>

* fix(test): pin version not latest which just introduced to use go 1.22 (#934)

* fix(test): pin version not latest which just introduced to use go 1.22

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* update: code review

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Edgar Hernández <23639005+israel-hdez@users.noreply.github.com>
Co-authored-by: Ajay Jaganathan <36824134+AjayJagan@users.noreply.github.com>
Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
Co-authored-by: Edgar Hernández <ehernand@redhat.com>
@bartoszmajsak bartoszmajsak mentioned this pull request Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants