-
Notifications
You must be signed in to change notification settings - Fork 32
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
chore(ginhelper): bump uuid to v8 #2895
Conversation
WalkthroughThe overall changes involve updating several Go modules to utilize Go version 1.22.1 instead of 1.22 and replacing the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2895 +/- ##
===================================================
+ Coverage 25.38787% 25.67207% +0.28420%
===================================================
Files 785 770 -15
Lines 56527 55500 -1027
Branches 80 80
===================================================
- Hits 14351 14248 -103
+ Misses 40695 39772 -923
+ Partials 1481 1480 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
core/ginhelper/server.go
Outdated
@@ -96,6 +98,8 @@ func newBase() *gin.Engine { | |||
MaxAge: 12 * time.Hour, | |||
})) | |||
|
|||
uuid.SetVersion(8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this a global set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ya
SetVersion(int)
var currentVersion = defaultVersion
// SetVersion sets the version of the application.
//
// It takes an integer value representing the version and returns an error.
func SetVersion(version int) error {
newVersion := Version(version)
if newVersion != Version4 && newVersion != Version7 && newVersion != Version8 {
return ErrInvalidVersion
}
currentVersion = newVersion
return nil
}
then New()
func New() UUID {
switch currentVersion {
case Version4:
return NewV4()
case Version7:
return NewV7()
case Version8:
return NewV8()
default:
return NewV7()
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (11)
agents/go.sum
is excluded by!**/*.sum
contrib/opbot/go.sum
is excluded by!**/*.sum
contrib/promexporter/go.sum
is excluded by!**/*.sum
contrib/screener-api/go.sum
is excluded by!**/*.sum
core/go.sum
is excluded by!**/*.sum
ethergo/go.sum
is excluded by!**/*.sum
services/cctp-relayer/go.sum
is excluded by!**/*.sum
services/explorer/go.sum
is excluded by!**/*.sum
services/omnirpc/go.sum
is excluded by!**/*.sum
services/rfq/go.sum
is excluded by!**/*.sum
services/scribe/go.sum
is excluded by!**/*.sum
Files selected for processing (14)
- agents/go.mod (2 hunks)
- contrib/git-changes-action/go.mod (1 hunks)
- contrib/opbot/go.mod (1 hunks)
- contrib/promexporter/go.mod (2 hunks)
- contrib/screener-api/go.mod (2 hunks)
- core/ginhelper/server.go (2 hunks)
- core/go.mod (2 hunks)
- ethergo/go.mod (2 hunks)
- services/cctp-relayer/go.mod (2 hunks)
- services/explorer/go.mod (2 hunks)
- services/omnirpc/go.mod (2 hunks)
- services/rfq/go.mod (2 hunks)
- services/scribe/go.mod (2 hunks)
- tools/go.mod (1 hunks)
Files skipped from review due to trivial changes (2)
- contrib/git-changes-action/go.mod
- tools/go.mod
Additional context used
GitHub Check: Lint (core)
core/ginhelper/server.go
[failure] 101-101:
Error return value ofuuid.SetVersion
is not checked (errcheck)
Additional comments not posted (22)
core/ginhelper/server.go (1)
7-7
: Import change approved.The import change from
github.com/google/uuid
github.com/samborkent/uuid
is appropriate for the new UUID handling functionality.core/go.mod (2)
3-3
: Go version update approved.The update from
go 1.22
togo 1.22.1
is appropriate and aligns with the project requirements.
38-38
: New dependency addition approved.The addition of
github.com/samborkent/uuid
as a new dependency is appropriate for the new UUID handling functionality.contrib/screener-api/go.mod (2)
3-3
: Go version update approved.The update from
go 1.22
togo 1.22.1
is appropriate and aligns with the project requirements.
141-141
: New dependency addition approved.The addition of
github.com/samborkent/uuid
as a new dependency is appropriate for the new UUID handling functionality.contrib/promexporter/go.mod (2)
3-3
: Go version update approved.The update from
go 1.22
togo 1.22.1
is appropriate and aligns with the project requirements.
183-183
: New dependency addition approved.The addition of
github.com/samborkent/uuid
as a new dependency is appropriate for the new UUID handling functionality.services/omnirpc/go.mod (2)
3-3
: Update Go version.The Go version has been updated from
1.22
to1.22.1
. This is a minor version update and should include bug fixes and minor improvements.
210-210
: Add new indirect dependency.A new indirect dependency on
github.com/samborkent/uuid
has been added. Ensure this new dependency is compatible with the existing codebase and does not introduce any breaking changes.ethergo/go.mod (2)
3-3
: Update Go version.The Go version has been updated from
1.22
to1.22.1
. This is a minor version update and should include bug fixes and minor improvements.
236-236
: Add new indirect dependency.A new indirect dependency on
github.com/samborkent/uuid
has been added. Ensure this new dependency is compatible with the existing codebase and does not introduce any breaking changes.services/explorer/go.mod (2)
3-3
: Update Go version.The Go version has been updated from
1.22
to1.22.1
. This is a minor version update and should include bug fixes and minor improvements.
227-227
: Add new indirect dependency.A new indirect dependency on
github.com/samborkent/uuid
has been added. Ensure this new dependency is compatible with the existing codebase and does not introduce any breaking changes.contrib/opbot/go.mod (1)
217-217
: Verify the necessity and compatibility of the new dependency.The new dependency
github.com/samborkent/uuid
has been added. Ensure that this dependency is necessary and compatible with the existing codebase. Verify that it does not introduce any conflicts or issues.Verification successful
The new dependency
github.com/samborkent/uuid
is necessary and compatible with the existing codebase.The
uuid
dependency is used incore/ginhelper/server.go
for setting the UUID version and generating new UUIDs. This confirms its necessity and compatibility.
core/ginhelper/server.go
: Usesuuid.SetVersion(8)
anduuid.New().String()
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the necessity and compatibility of the new dependency. # Test: Search for the usage of the new dependency in the codebase. Expect: Usage of `github.com/samborkent/uuid`. rg --type go -A 5 'github.com/samborkent/uuid'Length of output: 357
Script:
#!/bin/bash # Description: Verify the usage of the new dependency in the file where it is imported. # Test: Search for the usage of `uuid` in `core/ginhelper/server.go`. Expect: Usage of `uuid` functions or methods. rg --type go 'uuid' core/ginhelper/server.goLength of output: 124
services/scribe/go.mod (2)
3-3
: Go version update approved.The Go version is correctly updated from
1.22
to1.22.1
.
245-245
: New dependency addition approved.The new indirect dependency on
github.com/samborkent/uuid
is correctly added.services/cctp-relayer/go.mod (2)
3-3
: Go version update approved.The Go version is correctly updated from
1.22
to1.22.1
.
225-225
: New dependency addition approved.The new indirect dependency on
github.com/samborkent/uuid
is correctly added.services/rfq/go.mod (2)
3-3
: Go version update approved.The Go version is correctly updated from
1.22
to1.22.1
.
256-256
: New dependency addition approved.The new indirect dependency on
github.com/samborkent/uuid
is correctly added.agents/go.mod (2)
3-3
: Go version update approved.The Go version has been updated from
1.22
to1.22.1
. Ensure that the codebase is compatible with this version.
98-98
: New indirect dependency approved.A new indirect dependency on
github.com/samborkent/uuid
has been added. Ensure that this dependency is necessary and does not introduce any conflicts with existing dependencies.
core/ginhelper/server.go
Outdated
@@ -96,6 +98,8 @@ | |||
MaxAge: 12 * time.Hour, | |||
})) | |||
|
|||
uuid.SetVersion(8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the error return value of uuid.SetVersion
.
The error return value of uuid.SetVersion(8)
is not checked. This could lead to unhandled errors.
- uuid.SetVersion(8)
+ if err := uuid.SetVersion(8); err != nil {
+ // Handle the error appropriately
+ log.Fatalf("Failed to set UUID version: %v", err)
+ }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
uuid.SetVersion(8) | |
uuid.SetVersion(8) | |
if err := uuid.SetVersion(8); err != nil { | |
// Handle the error appropriately | |
log.Fatalf("Failed to set UUID version: %v", err) | |
} |
Tools
GitHub Check: Lint (core)
[failure] 101-101:
Error return value ofuuid.SetVersion
is not checked (errcheck)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- core/ginhelper/server.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- core/ginhelper/server.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
- Bumped UUID library to version 8 across multiple
go.mod
andgo.sum
files. - Updated Go version to 1.22.1 in various modules.
- Added new indirect dependency on
github.com/samborkent/uuid
. - Adjusted import order in
core/ginhelper/server.go
. - Ensure compatibility with the latest Go toolchain and UUID library.
25 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
- Updated UUID library to
github.com/samborkent/uuid
incore/ginhelper/server.go
- Set UUID version to 8 with error suppression in
core/ginhelper/server.go
- No major changes found since last review
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- core/ginhelper/server.go (2 hunks)
- core/go.mod (2 hunks)
Files skipped from review due to trivial changes (1)
- core/go.mod
Files skipped from review as they are similar to previous changes (1)
- core/ginhelper/server.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
- Updated Go version to
1.22.1
incore/go.mod
- Replaced
github.com/google/uuid
withgithub.aaakk.us.kg/samborkent/uuid
incore/ginhelper/server.go
- Enhanced
EndSpanWithErr
function incore/metrics/spanutils.go
for better error reporting - Switched error handling to
go.uber.org/multierr
incore/retry/retry.go
- Added new address to
packages/synapse-interface/public/blacklist.json
9 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
Description
A clear and concise description of the features you're adding in this pull request.
Additional context
Add any other context about the problem you're solving.
Metadata
Summary by CodeRabbit
Chores
Refactor