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

Update to Go 1.16 #1434

Merged
merged 8 commits into from
Nov 3, 2021
Merged

Update to Go 1.16 #1434

merged 8 commits into from
Nov 3, 2021

Conversation

szh
Copy link
Contributor

@szh szh commented Oct 28, 2021

Fixes build failing due to goconvey dependency change. Depends on cyberark/go-mssqldb#30

Desired Outcome

Jenkins builds of Docker images do NOT fail with errors such as the following:

[2021-10-26T21:50:18.036Z] #21 1.547 package embed: unrecognized import path "embed": import path does not begin with hostname
[2021-10-26T21:50:26.134Z] #21 8.793 package io/fs: unrecognized import path "io/fs": import path does not begin with hostname
[2021-10-26T21:50:32.671Z] #21 ERROR: executor failed running [/bin/sh -c go get -u github.com/jstemmer/go-junit-report &&     go get github.com/smartystreets/goconvey]: exit code: 1

Implemented Changes

  • The version of Go used in our Docker containers and specified in go.mod is upgraded from Go v1.15 to Go v1.16.
  • go env -w GOFLAGS=-mod=mod is run in containers to fix this module issue in go1.16
  • Update K8S packages and run go mod tidy to fix build breaking due to this issue
    • k8s.io/api v0.22.3
    • k8s.io/apiextensions-apiserver v0.22.3
    • k8s.io/apimachinery v0.22.3
    • k8s.io/client-go v0.22.3
  • Update arguments to K8S package functions
    • Satisfy new function signatures after K8S package updates.
  • Fixes bin/codegen script
    • Updates Dockerfile.codegen to use correct upsteam kubernetes/code-generator repo tag matching K8S packages
    • Fix permission denied deleting temp dirs by deleting within Docker context
  • Include autogenerated files after fixing codegen script
  • Use go1.16 in GHA macOS runner
  • Loosen codeclimate rules for autogenerated code and golang context.TODO() false positives
  • Use latest cyberark/go-mssqldb

Connected Issue/Story

Incidentally resolves #1387

Definition of Done

  • Jenkins builds run with no errors.

Changelog

  • The CHANGELOG has been updated, or
  • This PR does not include user-facing changes and doesn't require a
    CHANGELOG update

Test coverage

  • This PR includes new unit and integration tests to go with the code
    changes, or
  • The changes in this PR do not require tests

Documentation

  • Docs (e.g. READMEs) were updated in this PR
  • A follow-up issue to update official docs has been filed here: insert issue ID
  • This PR does not require updating any documentation

Behavior

  • This PR changes product behavior and has been reviewed by a PO, or
  • These changes are part of a larger initiative that will be reviewed later, or
  • No behavior was changed with this PR

Security

  • Security architect has reviewed the changes in this PR,
  • These changes are part of a larger initiative with a separate security review, or
  • There are no security aspects to these changes

@szh szh force-pushed the fix-ci-go-errors branch from 8f53413 to 5dd92cd Compare October 28, 2021 14:27
@szh szh marked this pull request as ready for review October 28, 2021 14:28
@szh szh requested a review from a team as a code owner October 28, 2021 14:28
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@szh szh force-pushed the fix-ci-go-errors branch 2 times, most recently from cbf34bf to 4b5b2f3 Compare October 28, 2021 14:36
CHANGELOG.md Outdated Show resolved Hide resolved
@szh szh self-assigned this Oct 28, 2021
@szh szh force-pushed the fix-ci-go-errors branch 3 times, most recently from d0f88ca to 82604ba Compare October 29, 2021 16:05
@szh
Copy link
Contributor Author

szh commented Nov 1, 2021

I'm changing this PR to a draft until cyberark/go-mssqldb#30 is merged in, because I'll have to update the submodule ref.

@szh szh marked this pull request as draft November 1, 2021 13:08
@szh szh force-pushed the fix-ci-go-errors branch from 82604ba to 64b6603 Compare November 1, 2021 13:10
@szh szh marked this pull request as ready for review November 1, 2021 13:37
@szh szh force-pushed the fix-ci-go-errors branch from 64b6603 to efe2578 Compare November 1, 2021 14:45
@szh
Copy link
Contributor Author

szh commented Nov 1, 2021

Builds failing. Appears to be a Red Hat issue.
From Jenkins:

[2021-11-01T15:20:36.580Z] Step 24/37 : FROM registry.access.redhat.com/ubi8/ubi as secretless-broker-redhat

[2021-11-01T15:21:57.956Z] received unexpected HTTP status: 503 Service Unavailable

and Github Actions:

Step 24/37 : FROM registry.access.redhat.com/ubi8/ubi as secretless-broker-redhat
received unexpected HTTP status: 504 Gateway Time-out

Copy link
Contributor

@diverdane diverdane 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, thanks for taking care of this!
One comment about including an entry in the CHANGELOG.md.

CHANGELOG.md Outdated Show resolved Hide resolved
@szh szh force-pushed the fix-ci-go-errors branch 2 times, most recently from 12434e8 to bea1f4e Compare November 1, 2021 19:06
Fixes build failing due to goconvey dependency change
@szh
Copy link
Contributor Author

szh commented Nov 1, 2021

Builds seem to have been broken by go mod tidy in go-mssqldb. Rolling that back in cyberark/go-mssqldb#31

@imheresamir imheresamir force-pushed the fix-ci-go-errors branch 4 times, most recently from f6950a2 to 86a828b Compare November 2, 2021 20:19
@imheresamir imheresamir marked this pull request as draft November 2, 2021 20:28
@imheresamir imheresamir marked this pull request as ready for review November 2, 2021 20:45
@szh szh requested a review from a team as a code owner November 2, 2021 21:08
@imheresamir imheresamir marked this pull request as draft November 2, 2021 21:08
@imheresamir imheresamir force-pushed the fix-ci-go-errors branch 2 times, most recently from 495a847 to 2cb9dcc Compare November 2, 2021 21:48
@imheresamir imheresamir marked this pull request as ready for review November 2, 2021 21:50
@imheresamir imheresamir linked an issue Nov 2, 2021 that may be closed by this pull request
k8s.io/api v0.22.3
k8s.io/apiextensions-apiserver v0.22.3
k8s.io/apimachinery v0.22.3
k8s.io/client-go v0.22.3
Satisfy new function signatures after K8S package updates.
* Fixes `bin/codegen` script
  * Updates `Dockerfile.codegen` to use correct upsteam `kubernetes/code-generator` repo tag matching K8S packages
  * Fix permission denied deleting temp dirs by deleting within Docker context
@codeclimate
Copy link

codeclimate bot commented Nov 3, 2021

Code Climate has analyzed commit 2e520e3 and detected 53 issues on this pull request.

Here's the issue category breakdown:

Category Count
Style 53

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 54.8% (0.0% change).

View more on Code Climate.

@imheresamir
Copy link
Contributor

Note to merger: Don't squash commits when merging - "Rebase and merge"

Copy link
Contributor

@diverdane diverdane left a comment

Choose a reason for hiding this comment

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

LGTM!!! Thank you so much for taking care of this!

@szh szh merged commit 71c3de2 into main Nov 3, 2021
@szh szh deleted the fix-ci-go-errors branch November 3, 2021 19:46
@imheresamir imheresamir linked an issue Nov 3, 2021 that may be closed by this pull request
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants