chore: update to go 1.26 and fix vitess build#3925
Conversation
There was a problem hiding this comment.
Pull request overview
This PR upgrades the repository to Go 1.26, updates Vitess (and related dependencies) for Go 1.26 compatibility, and migrates existing terminal table rendering to the github.com/olekukonko/tablewriter v1.x API while aligning CI, Docker, and workflows to the new Go version.
Changes:
- Bump Go version to 1.26 across
go.mod, Dockerfile, and GitHub Actions workflows. - Upgrade dependencies including
vitess.io/vitess(0.22.1 → 0.23.3) and migrate Glamour tocharm.land/glamour/v2. - Update table output code to tablewriter v1.x (
NewTable,twoptions, renderer changes).
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/service/tools/tools.go | Switch Glamour import to v2 module path and update renderer option usage. |
| pkg/service/replay/utils.go | Migrate failure summary table to tablewriter v1.x API with tw configuration. |
| pkg/service/contract/consumer/consumer.go | Migrate summary table to tablewriter v1.x, including vertical cell merge config. |
| pkg/matcher/utils.go | Migrate multiple diff/schema table renderers to tablewriter v1.x (tw + renderer). |
| go.mod | Set Go version to 1.26 and update dependency versions (Vitess, tablewriter, viper, etc.). |
| go.sum | Refresh module checksums to match upgraded dependencies. |
| Dockerfile | Update build image to golang:1.26. |
| .github/workflows/schema_match_linux.yml | Run schema match workflow on Go 1.26. |
| .github/workflows/sample-run.yml | Require Go >= 1.26 for sample run pipeline. |
| .github/workflows/release.yml | Require Go >= 1.26 for release pipeline. |
| .github/workflows/main.yml | Require Go >= 1.26 for main CI workflow. |
| .github/workflows/grpc_linux.yml | Update gRPC linux workflows to Go 1.26. |
| .github/workflows/golangci-lint.yml | Require Go >= 1.26 for golangci-lint workflow. |
| .github/workflows/golang_linux.yml | Update linux build/record jobs to Go 1.26. |
| .github/workflows/go_windows.yml | Require Go >= 1.26 for Windows workflow. |
| .github/workflows/go_macos.yaml | Require Go >= 1.26 for macOS workflow. |
| .github/workflows/go.yml | Require Go >= 1.26 for general Go workflow. |
| .github/workflows/go-test.yaml | Update test workflow Go version to 1.26. |
| .github/workflows/fuzzer_linux.yml | Require Go >= 1.26 across fuzzer jobs. |
| .github/workflows/docker-publish.yml | Require Go >= 1.26 for docker publish pipeline. |
| .github/actions/setup-private-parsers/action.yaml | Require Go >= 1.26 in shared composite action. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pkg/matcher/utils.go
Outdated
| table.Header([]string{initalPart + midPartpaint + endPaint}) | ||
| table.Append([]string{initalPart + midPartpaint + endPaint}) | ||
| } |
pkg/matcher/utils.go
Outdated
| table.Header([]string{initalPart + midPartpaint + endPaint}) | ||
| table.Append([]string{initalPart + midPartpaint + endPaint}) |
| var opts []tablewriter.Option | ||
| opts = append(opts, tablewriter.WithRowAutoWrap(0)) | ||
| if !models.IsAnsiDisabled { | ||
| table.SetHeaderColor( | ||
| tablewriter.Colors{tablewriter.FgHiRedColor}, | ||
| tablewriter.Colors{tablewriter.FgHiGreenColor}, | ||
| tablewriter.Colors{tablewriter.FgHiRedColor}, | ||
| ) | ||
| opts = append(opts, tablewriter.WithRenderer(renderer.NewColorized(renderer.ColorizedConfig{ | ||
| Header: renderer.Tint{FG: renderer.Colors{color.FgHiRed}}, | ||
| }))) | ||
| } | ||
| table.SetAlignment(tablewriter.ALIGN_LEFT) | ||
| opts = append(opts, tablewriter.WithRowAlignment(tw.AlignLeft)) | ||
| table := tablewriter.NewTable(s.out, opts...) | ||
| table.Header([]string{"Schema Check Failed", "Expected", "Actual"}) |
There was a problem hiding this comment.
Pull request overview
Updates the repository’s Go/tooling baseline to Go 1.26 and refreshes key dependencies (Vitess, Glamour, Tablewriter) to restore/build compatibility and align CLI output formatting with upstream breaking changes.
Changes:
- Bumped Go version to 1.26 across
go.mod, Dockerfile, and GitHub Actions workflows. - Upgraded dependencies including
vitess.io/vitess(for Go 1.26 compatibility) and migratedglamourtocharm.land/glamour/v2. - Migrated
github.com/olekukonko/tablewriterusage to the v1.1.0 API across matcher/replay/consumer outputs.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
go.mod |
Sets module Go version to 1.26.0 and updates dependency versions (Vitess, Tablewriter, Glamour, etc.). |
go.sum |
Updates checksums for the dependency upgrades. |
Dockerfile |
Builds with golang:1.26 base image. |
pkg/service/tools/tools.go |
Switches Glamour import path to v2 and updates renderer options. |
pkg/service/replay/utils.go |
Updates failure-summary table rendering to the new Tablewriter API. |
pkg/service/contract/consumer/consumer.go |
Updates contract summary table rendering to the new Tablewriter API. |
pkg/models/const.go |
Fixes variadic formatting for highlight helpers (fmt.Sprint(a...)). |
pkg/matcher/utils.go |
Updates diff/schema table rendering to the new Tablewriter API and new color renderer. |
.github/workflows/schema_match_linux.yml |
Uses Go 1.26.x in CI. |
.github/workflows/sample-run.yml |
Raises minimum Go version to >=1.26. |
.github/workflows/release.yml |
Raises minimum Go version to >=1.26. |
.github/workflows/main.yml |
Raises minimum Go version to >=1.26. |
.github/workflows/grpc_linux.yml |
Uses Go 1.26.x in CI matrix jobs. |
.github/workflows/golangci-lint.yml |
Raises minimum Go version to >=1.26. |
.github/workflows/golang_linux.yml |
Uses Go 1.26.x across Linux CI jobs. |
.github/workflows/go_windows.yml |
Raises minimum Go version to >=1.26. |
.github/workflows/go_macos.yaml |
Raises minimum Go version to >=1.26. |
.github/workflows/go.yml |
Raises minimum Go version to >=1.26. |
.github/workflows/go-test.yaml |
Sets Go version to 1.26 for tests workflow. |
.github/workflows/fuzzer_linux.yml |
Raises minimum Go version to >=1.26 across fuzzer jobs. |
.github/workflows/docker-publish.yml |
Raises minimum Go version to >=1.26. |
.github/actions/setup-private-parsers/action.yaml |
Raises minimum Go version to >=1.26 for the composite action. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ing in SchemaDiffPrinter
There was a problem hiding this comment.
Pull request overview
Updates the repository toolchain and key dependencies to build and run cleanly on Go 1.26, including upstream dependency changes that required API migrations (notably tablewriter and glamour).
Changes:
- Bumped Go version/toolchain to 1.26 across
go.mod, Docker image, and GitHub Actions workflows. - Upgraded dependencies (e.g.,
vitess,glamourmodule path,tablewriterv1.x) and migrated call sites to new APIs. - Adjusted terminal/table rendering output code paths to compile with updated libraries.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/service/tools/tools.go | Switches to charm.land/glamour/v2 and updates renderer options. |
| pkg/service/replay/utils.go | Migrates mocks mismatch summary table to tablewriter v1.x API. |
| pkg/service/contract/consumer/consumer.go | Migrates contract summary table to tablewriter v1.x API. |
| pkg/models/const.go | Fixes varargs forwarding for highlight formatting helpers. |
| pkg/matcher/utils.go | Migrates diff/schema table rendering to tablewriter v1.x API + color renderer. |
| go.mod | Updates Go version/toolchain and bumps dependencies (vitess, tablewriter, glamour v2, etc.). |
| go.sum | Refreshes module checksums after dependency upgrades. |
| Dockerfile | Updates build stage base image to Go 1.26. |
| .github/workflows/schema_match_linux.yml | Updates CI Go version to 1.26.x. |
| .github/workflows/sample-run.yml | Updates CI Go version constraint to >=1.26. |
| .github/workflows/release.yml | Updates CI Go version constraint to >=1.26. |
| .github/workflows/main.yml | Updates CI Go version constraint to >=1.26. |
| .github/workflows/grpc_linux.yml | Updates CI Go versions to 1.26.x. |
| .github/workflows/golangci-lint.yml | Updates CI Go version constraint to >=1.26. |
| .github/workflows/golang_linux.yml | Updates CI Go versions to 1.26.x. |
| .github/workflows/go_windows.yml | Updates CI Go version constraint to >=1.26. |
| .github/workflows/go_macos.yaml | Updates CI Go version constraint to >=1.26. |
| .github/workflows/go.yml | Updates CI Go version constraint to >=1.26. |
| .github/workflows/go-test.yaml | Updates CI Go version to 1.26 (but still uses setup-go@v4). |
| .github/workflows/fuzzer_linux.yml | Updates CI Go version constraint to >=1.26. |
| .github/workflows/docker-publish.yml | Updates CI Go version constraint to >=1.26. |
| .github/actions/setup-private-parsers/action.yaml | Updates composite action Go version constraint to >=1.26. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ng in DiffsPrinter and SchemaDiffPrinter
…iffPrinter for better alignment and spacing
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: ">=1.24" | ||
| go-version: ">=1.26" |
There was a problem hiding this comment.
I would strongly recommend upgrading to v6 and using the toolchain as defined in go.mod:
uses: actions/setup-go@v6
with:
go-version-file: go.modThat way you have Go toolchain version defined in only one place, making further upgrades easier and it behaves same as in local developer's environment.
That applies to all workflows with setup-go step.
The only "downside" with this approach is that you need to upgrade every minor version to use it instead of having it defined as minimum using ">=1.xx" pattern, which can also be considered good, giving you exact control.
There was a problem hiding this comment.
Agreed, Thanks for the suggestion!
Let me implement it
…nter for improved consistency
… to use go.mod across all workflows
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: ">=1.24" | ||
| go-version-file: go.mod |
There was a problem hiding this comment.
It seems that in custom action this needs to be handled slightly different (as an input?)
There was a problem hiding this comment.
...or there may be some other reason for error https://github.com/keploy/keploy/actions/runs/23081831066/job/67052369131?pr=3925 ?
There was a problem hiding this comment.
Ah, it seems that
should also be upgraded to use https://github.com/webfactory/ssh-agent/releases/tag/v0.10.0
There was a problem hiding this comment.
Thanks for the suggestion!
made the changes
the problem was our macos runner was on an older version. I have updated it to 2.332.0.
https://github.com/actions/setup-go/blob/v6/README.md#v6-changes
…for improved functionality
| steps: | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v6 | ||
| uses: actions/setup-go@v5 |
There was a problem hiding this comment.
v5 does not properly support toolchain selection, because
was released in v6.
There was a problem hiding this comment.
Thanks! made the changes
Signed-off-by: Shubham Jain <shubhamkjain@outlook.com>
Describe the changes that are made
vitess.io/vitessfrom v0.22.1 to v0.23.3 to fix Go 1.26 compatibility (swissmap build constraint issue)charm.land/glamourfrom v0.6.0 (github.com/charmbracelet/glamour) to v2.0.0 (module moved to charm.land/glamour/v2)github.com/olekukonko/tablewriterusage from v0.0.5 API to v1.1.0 API (breaking changes pulled in by vitess v0.23.3)pkg/matcher/utils.go,pkg/service/replay/utils.go, andpkg/service/contract/consumer/consumer.goto use new tablewriter API (NewTable,Header(),Options(),tw.AlignCenter, colorized renderer, etc.)Links & References
Closes: #3922
🔗 Related PRs
🐞 Related Issues
📄 Related Documents
What type of PR is this? (check all applicable)
Added e2e test pipeline?
Added comments for hard-to-understand areas?
Added to documentation?
Are there any sample code or steps to test the changes?
Self Review done?
Any relevant screenshots, recordings or logs?
🧠 Semantics for PR Title & Branch Name
Please ensure your PR title and branch name follow the Keploy semantics:
📌 PR Semantics Guide
📌 Branch Semantics Guide
Examples:
fix: patch MongoDB document update bugfeat/#1-login-flow(You may skip mentioning the issue number in the branch name if the change is small and the PR description clearly explains it.)Additional checklist: