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 go1.21 #1351

Merged
merged 13 commits into from
Dec 11, 2023
Merged

Update to go1.21 #1351

merged 13 commits into from
Dec 11, 2023

Conversation

timvaillancourt
Copy link
Collaborator

@timvaillancourt timvaillancourt commented Dec 9, 2023

Description

This PR updates the builds from go1.17->go1.21 (current stable). Also:

  • the golang docker images are based on bullseye instead of stretch
  • the golangci-lint version was updated to v1.54.2 to support go1.21
    • Some files were updated to remove new linter complaints for deprecated io/ioutil
  • ran go mod tidy and go mod vendor

Finally, GitHub Actions were updated to ubuntu-latest, except the replica tests which had problems with MySQL 5.7 and linked libraries - I'm working on a new PR to fix this

In case this PR introduced Go code changes:

  • contributed code is using same conventions as original code
  • script/cibuild returns with no formatting errors, build errors or unit test errors.

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
@timvaillancourt timvaillancourt marked this pull request as ready for review December 9, 2023 01:06
with:
go-version: 1.17
go-version-file: go.mod
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This lets the action use go.mod to find a version. Less things to update 🚀

PREFERRED_GO_VERSION=go1.17.11
SUPPORTED_GO_VERSIONS='go1.1[567]'
PREFERRED_GO_VERSION=go1.21.5
SUPPORTED_GO_VERSIONS='go1.[1-2][1789]'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This sucks. But it will allow go1.21 and go1.17-.19 to pass through

PREFERRED_GO_VERSION=go1.17.11
SUPPORTED_GO_VERSIONS='go1.1[567]'
PREFERRED_GO_VERSION=go1.21.5
SUPPORTED_GO_VERSIONS='go1.[1-2][01789]'
Copy link
Collaborator Author

@timvaillancourt timvaillancourt Dec 9, 2023

Choose a reason for hiding this comment

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

This is horrible, but it will allow go1.20-.21 and go1.17-.19 to passthrough

Soon we should only allow go1.2[0-2]

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

RUN apt-get update
RUN apt-get install -y ruby ruby-dev rubygems build-essential
RUN gem install --no-ri --no-rdoc fpm
RUN gem install fpm
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

--no-ri and --no-rdoc flags don't exist on bullseye's gem 🤷

@timvaillancourt timvaillancourt changed the title Update to go go1.21 Update to go1.21 Dec 9, 2023
@meiji163
Copy link
Contributor

Because of GitHub's "hack" to upload gh-ost binaries internally, we have to change "stretch" to "bullseye" in this line

focal_tarball_name=$(echo $(basename "${tarball}") | sed s/-stretch-/-focal-/)

timvaillancourt and others added 2 commits December 11, 2023 23:53
Signed-off-by: Tim Vaillancourt <tvaillancourt@slack-corp.com>
@timvaillancourt
Copy link
Collaborator Author

Because of GitHub's "hack" to upload gh-ost binaries internally, we have to change "stretch" to "bullseye" in this line

focal_tarball_name=$(echo $(basename "${tarball}") | sed s/-stretch-/-focal-/)

@meiji163 makes sense. Updated 👍

@timvaillancourt timvaillancourt merged commit 462930f into github:master Dec 11, 2023
7 checks passed
@timvaillancourt timvaillancourt deleted the go1.21 branch December 11, 2023 23:14
RainbowDashy pushed a commit to bytebase/gh-ost that referenced this pull request Jan 2, 2024
* go1.21 + bullseye

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* go1.21 + bullseye pt 2

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* checkout before setup-go

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* go fmt

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* Use golangci-lint 1.54.2 to support go1.21

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* stop using io/ioutil to make linter happy

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* Fix typo

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* Lint

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* revert replica-tests CI to ubuntu 20 due to linker errors

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* Update ensure-go-installed

* use `ubuntu-latest` for `ci` job

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* stretch -> bullseye

Signed-off-by: Tim Vaillancourt <tvaillancourt@slack-corp.com>

---------

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tvaillancourt@slack-corp.com>
d-bytebase pushed a commit to bytebase/gh-ost that referenced this pull request Jan 2, 2024
* Add `focal` build

* upgrade codeQL action to v2

* Pin docker image to stretch (github#1324)

* pin stretch image

* update stretch repo

* Update Dockerfile.test

* parse binlog timestamp in UTC (github#1322)

* upgrade standard library deps (github#1332)

* fix: typo (github#1331)

Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com>

* Remove stale RELEASE_VERSION file (github#1349)

Signed-off-by: Tim Vaillancourt <tvaillancourt@slack-corp.com>

* Force index in unique key range queries (github#1237)

* WIP

* Pass entire sql.UniqueKey

* newline for limit

* Rename var

---------

Co-authored-by: meiji163 <meiji163@github.com>

* Include git commit in version (github#1347)

* Include git commit in version

Signed-off-by: Tim Vaillancourt <tvaillancourt@slack-corp.com>

* Make --version output change less-breaking

---------

Signed-off-by: Tim Vaillancourt <tvaillancourt@slack-corp.com>

* Fix tokens in inspector logging (github#1226)

* Cleanup whitespace and comments in SQL query text (github#1246)

* Cleanup whitespace in SQL query text

* cleanup

* Add indent

* Update unit tests

* Update unit tests, pt 2

* Fix tweaks

* Fix merge conflict resolution

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

---------

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* Fix `--version` output (github#1352)

* Fix `--version` output

Signed-off-by: Tim Vaillancourt <tvaillancourt@slack-corp.com>

* Always fallback version/commit if undef

Signed-off-by: Tim Vaillancourt <tvaillancourt@slack-corp.com>

---------

Signed-off-by: Tim Vaillancourt <tvaillancourt@slack-corp.com>

* Update to `go1.21` (github#1351)

* go1.21 + bullseye

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* go1.21 + bullseye pt 2

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* checkout before setup-go

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* go fmt

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* Use golangci-lint 1.54.2 to support go1.21

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* stop using io/ioutil to make linter happy

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* Fix typo

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* Lint

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* revert replica-tests CI to ubuntu 20 due to linker errors

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* Update ensure-go-installed

* use `ubuntu-latest` for `ci` job

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* stretch -> bullseye

Signed-off-by: Tim Vaillancourt <tvaillancourt@slack-corp.com>

---------

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tvaillancourt@slack-corp.com>

* Replace deprecated `github.com/satori/go.uuid` lib (github#1354)

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* Add `CODEOWNERS` file to auto-request reviews (github#1350)

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* go mod tidy

* update test

* fix lint

---------

Signed-off-by: Tim Vaillancourt <tvaillancourt@slack-corp.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Co-authored-by: Rashiq <rashiq@users.noreply.github.com>
Co-authored-by: meiji163 <meiji163@github.com>
Co-authored-by: guangwu <guoguangwu@magic-shield.com>
Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants