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

Added editions 2023 support with hybrid protobuf api #206

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

abjeni
Copy link
Collaborator

@abjeni abjeni commented Jan 29, 2025

  • added editions support and updated storage example to edition2023
    Editions 2024 is still experimental, protoc has support but it is unclear if protoc-gen-go has support for it.

  • moving hybrid protobuf api
    The hybrid API allows for use of both the open and opaque protobuf api methods, and struct fields.

  • ** Changes **
    This may not have any effect for the users of gorums, i consider testing the opaque api on relab/raft.
    The gorums generated files have not changed.
    The example worked both before and after being updated to the opaque API

Copy link
Contributor

deepsource-io bot commented Jan 29, 2025

Here's the code health analysis summary for commits 4107d6e..cace224. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Go LogoGo✅ SuccessView Check ↗
DeepSource Shell LogoShell✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@abjeni
Copy link
Collaborator Author

abjeni commented Jan 30, 2025

benchmark/qspec.go line 61 is wrong.

Copy link
Member

@meling meling left a comment

Choose a reason for hiding this comment

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

Very nicely done! Please fix the minor comments, and we can merge this.

One question I have is whether or not to update some or all the .proto files in tests and internal/testprotos, etc., to use editions. We can do it in a separate PR if this makes sense to do.

@@ -16,7 +16,7 @@ func runClient(addresses []string) {
}

// init gorums manager
mgr := proto.NewManager(
mgr := pb.NewManager(
gorums.WithDialTimeout(1*time.Second),
Copy link
Member

Choose a reason for hiding this comment

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

I think we removed this WithDialTimeout option in the previous PR.

@@ -29,13 +30,17 @@ $(static_file): $(static_files)
@protoc-gen-gorums --bundle=$(static_file)

%.pb.go : %.proto
@protoc -I=$(proto_path) --go_out=paths=source_relative:. $^
@protoc -I=$(proto_path) \
--go_opt=default_api_level=API_HYBRID \
Copy link
Member

Choose a reason for hiding this comment

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

Nit: looks like an extra tab character on this line.

resp.TotalOps /= uint64(len(replies))
resp.TotalTime /= int64(len(replies))
resp.Throughput /= float64(len(replies))
resp.SetLatencyVar(resp.GetLatencyVar()/float64(resp.GetTotalOps()) - float64(len(replies)))
Copy link
Member

Choose a reason for hiding this comment

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

Referring to your comment related to this line. I think it should be like this:

resp.SetLatencyVar(resp.GetLatencyVar() / (float64(resp.GetTotalOps()) - float64(len(replies))))

@meling
Copy link
Member

meling commented Jan 30, 2025

We would also need to merge master into this and resolve the merge conflicts, and we should fix the DeepSource issues as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants