Upgrade github.com/hashicorp/consul/api to v2#20351
Conversation
Signed-off-by: Chiman Jain <chimanjain15@gmail.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
There was a problem hiding this comment.
⚠️ Human review recommended
This is a major-version dependency upgrade, and I can’t validate API/behavior compatibility without CI or build/test evidence in this review context.
Pull request overview
Upgrades Vitess’s Consul client dependency to the new Go module major version (github.com/hashicorp/consul/api/v2) and updates internal import paths accordingly so the code continues to build against the v2 module path.
Changes:
- Switched all Consul API imports from
github.com/hashicorp/consul/apitogithub.com/hashicorp/consul/api/v2. - Updated
go.modto requiregithub.com/hashicorp/consul/api/v2 v2.0.0. - Updated
go.sumto reflect the new Consul API and SDK v2 checksums.
File summaries
| File | Description |
|---|---|
| go/vt/vtadmin/cluster/discovery/discovery_consul.go | Updates Consul API import to the v2 module path for vtadmin discovery. |
| go/vt/vtadmin/cluster/discovery/discovery_consul_test.go | Updates Consul API import to the v2 module path for discovery tests. |
| go/vt/topo/consultopo/watch.go | Updates Consul API import to the v2 module path for topo watch functionality. |
| go/vt/topo/consultopo/server.go | Updates Consul API import to the v2 module path for the Consul-backed topo server. |
| go/vt/topo/consultopo/server_flaky_test.go | Updates Consul API import to the v2 module path for consultopo tests. |
| go/vt/topo/consultopo/lock.go | Updates Consul API import to the v2 module path for consul-based locking. |
| go/vt/topo/consultopo/file.go | Updates Consul API import to the v2 module path for consultopo file operations. |
| go/vt/topo/consultopo/election.go | Updates Consul API import to the v2 module path for consul-based leader election. |
| go/cmd/vttestserver/cli/main_test.go | Updates Consul API import to the v2 module path for vttestserver CLI tests. |
| go.mod | Bumps the Consul API dependency to github.com/hashicorp/consul/api/v2 v2.0.0. |
| go.sum | Updates dependency checksums for Consul API v2 (and related Consul SDK v2). |
Copilot's findings
- Files reviewed: 10/11 changed files
- Comments generated: 0
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #20351 +/- ##
===========================================
- Coverage 69.67% 64.44% -5.23%
===========================================
Files 1614 14 -1600
Lines 216793 917 -215876
===========================================
- Hits 151044 591 -150453
+ Misses 65749 326 -65423
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for tackling this @chimanjain! 🎉 I checked our e2e coverage and we do exercise a real Honestly, CI passing on a 4-year-old server is a nice signal that the v2 client still talks to older servers fine, so that's reassuring backward-compat coverage on its own 👍 That said, while we're in here let's also bump
Thanks again! 🙏 |
|
thanks @timvaillancourt for the review and pointing out the outdated consul versions. Can the maintainers please Re-upload the binaries to the Vitess resources mirror and share the sha. I can update it in the PR or if it needs more work in the backend, we can address in another PR. Please share your thoughts. |
Description
github.com/hashicorp/consul/apitov2.Checklist