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

feature: update deps and buf #62

Merged
merged 6 commits into from
Jun 25, 2024
Merged

feature: update deps and buf #62

merged 6 commits into from
Jun 25, 2024

Conversation

rustatian
Copy link
Member

@rustatian rustatian commented Jun 24, 2024

Reason for This PR

ref: roadrunner-php/jobs#66

Description of Changes

  • Update buf to v2.
  • Update temporal api to v1.34.0
  • Add NackWithOption method to the jobs v4.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT license.

PR Checklist

[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]

  • All commits in this PR are signed (git commit -s).
  • The reason for this PR is clearly provided (issue no. or explanation).
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • Any user-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.

Summary by CodeRabbit

  • New Features

    • Introduced interfaces for job management, including job queue operations, acknowledgments, requeueing, and metadata handling.
  • Bug Fixes

    • Updated go_package options in various .proto files for improved Go code generation alignment.
  • Chores

    • Updated multiple dependencies to their latest versions in go.mod.
    • Configured buf.gen.yaml and buf.yaml to use version v2.
  • Refactor

    • Standardized the package paths and versioning in protobuf files to reflect the repository's structure.

Signed-off-by: Valery Piashchynski <[email protected]>
Signed-off-by: Valery Piashchynski <[email protected]>
@rustatian rustatian added the C-enhancement Category: enhancement. Meaning improvements of current module, transport, etc.. label Jun 24, 2024
@rustatian rustatian requested a review from wolfy-j June 24, 2024 17:08
@rustatian rustatian self-assigned this Jun 24, 2024
Copy link

coderabbitai bot commented Jun 24, 2024

Warning

Review failed

The pull request is closed.

Walkthrough

These updates collectively advance the roadrunner-server repository, incorporating enhanced version management, dependency updates, and new interface definitions. The buf configuration files are updated to streamline module pathing and plugin versions. go.mod reflects dependency modernizations aligned with Go 1.22.4. New job management interfaces in the plugins/v4/jobs package introduce robust queueing mechanisms. Proto files' Go package paths are refined for better structure. Dependencies in third_party/api are also updated for consistency.

Changes

File(s) / Section Summary
buf.gen.yaml Updated version and plugins' configuration, transitioning from v1 to v2.
buf.yaml Transitioned from v1 to v2 with added lint rules and modules.
go.mod Updated Go version to 1.22.4 and refreshed dependencies.
plugins/v4/jobs/driver.go Introduced Driver, Commander, and Constructor interfaces for job management.
plugins/v4/jobs/job.go Defined interfaces for queue management and job handling.
plugins/v4/jobs/state.go Added constants, types, and structs for job states.
plugins/v4/priority_queue/priority_queue.go Introduced Item interface for priority queue items management.
proto/.../*.proto Updated go_package options to refined paths, affecting package declarations in Go code.
third_party/api Updated subproject commit hash for dependencies.

Poem

🐇
In the field of code where packets relay,
We've moved to v2 without delay.
Jobs and queues with fervor gleam,
Enhancing the Roadrunner's dream.
Modules, paths, and versions align,
In the repository's grand design.
Here’s to progress, both swift and true,
With every byte, a future in view.
🐇


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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 UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 21d8e3b and ea54c93.

Files ignored due to path filters (65)
  • buf.lock is excluded by !**/*.lock
  • build/applogger/v1/applogger.pb.go is excluded by !**/*.pb.go
  • build/centrifugo/api/v1/api.pb.go is excluded by !**/*.pb.go
  • build/centrifugo/api/v1/api_grpc.pb.go is excluded by !**/*.pb.go
  • build/centrifugo/proxy/v1/proxy.pb.go is excluded by !**/*.pb.go
  • build/centrifugo/proxy/v1/proxy_grpc.pb.go is excluded by !**/*.pb.go
  • build/common/v1/grpc_status.pb.go is excluded by !**/*.pb.go
  • build/google/api/annotations.pb.go is excluded by !**/*.pb.go
  • build/google/api/http.pb.go is excluded by !**/*.pb.go
  • build/google/protobuf/any.pb.go is excluded by !**/*.pb.go
  • build/google/protobuf/descriptor.pb.go is excluded by !**/*.pb.go
  • build/google/protobuf/duration.pb.go is excluded by !**/*.pb.go
  • build/google/protobuf/empty.pb.go is excluded by !**/*.pb.go
  • build/google/protobuf/struct.pb.go is excluded by !**/*.pb.go
  • build/google/protobuf/timestamp.pb.go is excluded by !**/*.pb.go
  • build/google/protobuf/wrappers.pb.go is excluded by !**/*.pb.go
  • build/http/v1/http.pb.go is excluded by !**/*.pb.go
  • build/jobs/v1/jobs.pb.go is excluded by !**/*.pb.go
  • build/kv/v1/kv.pb.go is excluded by !**/*.pb.go
  • build/lock/v1beta1/lock.pb.go is excluded by !**/*.pb.go
  • build/service/v1/service.pb.go is excluded by !**/*.pb.go
  • build/status/v1/status.pb.go is excluded by !**/*.pb.go
  • build/status/v1beta1/status.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/batch/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/command/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/common/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/enums/v1/batch_operation.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/enums/v1/command_type.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/enums/v1/common.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/enums/v1/event_type.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/enums/v1/failed_cause.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/enums/v1/namespace.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/enums/v1/query.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/enums/v1/reset.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/enums/v1/schedule.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/enums/v1/task_queue.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/enums/v1/update.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/enums/v1/workflow.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/errordetails/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/export/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/failure/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/filter/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/history/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/namespace/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/nexus/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/operatorservice/v1/request_response.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/operatorservice/v1/service.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/operatorservice/v1/service_grpc.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/protocol/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/query/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/replication/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/schedule/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/sdk/v1/task_complete_metadata.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/sdk/v1/user_metadata.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/sdk/v1/workflow_metadata.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/taskqueue/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/update/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/version/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/workflow/v1/message.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/workflowservice/v1/request_response.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/workflowservice/v1/service.pb.go is excluded by !**/*.pb.go
  • build/temporal/api/workflowservice/v1/service_grpc.pb.go is excluded by !**/*.pb.go
  • build/temporal/v1/temporal.pb.go is excluded by !**/*.pb.go
  • build/websockets/v1/websockets.pb.go is excluded by !**/*.pb.go
  • go.sum is excluded by !**/*.sum
Files selected for processing (19)
  • buf.gen.yaml (1 hunks)
  • buf.yaml (1 hunks)
  • go.mod (1 hunks)
  • plugins/v4/jobs/driver.go (1 hunks)
  • plugins/v4/jobs/job.go (1 hunks)
  • plugins/v4/jobs/state.go (1 hunks)
  • plugins/v4/priority_queue/priority_queue.go (1 hunks)
  • proto/applogger/v1/applogger.proto (1 hunks)
  • proto/common/v1/grpc_status.proto (1 hunks)
  • proto/http/v1/http.proto (1 hunks)
  • proto/jobs/v1/jobs.proto (1 hunks)
  • proto/kv/v1/kv.proto (1 hunks)
  • proto/lock/v1beta1/lock.proto (1 hunks)
  • proto/service/v1/service.proto (1 hunks)
  • proto/status/v1/status.proto (1 hunks)
  • proto/status/v1beta1/status.proto (1 hunks)
  • proto/temporal/v1/temporal.proto (1 hunks)
  • proto/websockets/v1/websockets.proto (1 hunks)
  • third_party/api (1 hunks)
Files skipped from review due to trivial changes (9)
  • buf.yaml
  • plugins/v4/priority_queue/priority_queue.go
  • proto/applogger/v1/applogger.proto
  • proto/lock/v1beta1/lock.proto
  • proto/service/v1/service.proto
  • proto/status/v1beta1/status.proto
  • proto/temporal/v1/temporal.proto
  • proto/websockets/v1/websockets.proto
  • third_party/api
Additional comments not posted (18)
buf.gen.yaml (3)

1-1: Version update approved.

The upgrade to version: v2 is consistent with the PR objectives and the AI-generated summary.


3-5: Check the plugin version and options.

The update to buf.build/protocolbuffers/go:v1.34.2 with out: build and opt: paths=source_relative aligns with the latest standards and should facilitate better source management.


6-10: Review new plugin configuration.

The buf.build/grpc/go:v1.4.0 plugin configuration includes options for paths and server requirements. This is a positive change, ensuring better compatibility and control over generated code.

proto/status/v1/status.proto (1)

5-5: Updated Go package path approved.

The change in go_package to "github.com/roadrunner-server/api/v4/build/status/v1;statusV1" reflects the new project structure and should help in maintaining clear package management.

proto/kv/v1/kv.proto (1)

5-5: Updated Go package path approved.

The update to go_package to "github.com/roadrunner-server/api/v4/build/kv/v1;kvV1" is consistent with the restructuring of the project's directories and namespaces.

go.mod (3)

3-3: Go version update approved.

Upgrading the Go version to 1.22.4 should provide the latest features and security patches.


6-10: Dependencies update approved.

The updates to go.temporal.io/api, google.golang.org/grpc, and google.golang.org/protobuf are crucial for keeping the project up-to-date with the latest improvements and security features.


15-18: Indirect dependencies update approved.

Updating indirect dependencies such as golang.org/x/net and google.golang.org/genproto/googleapis/rpc ensures compatibility and the latest patches are applied.

proto/http/v1/http.proto (1)

7-7: Updated Go package path.

The go_package option has been updated to reflect the new package structure. Please ensure that the new path is correctly integrated and recognized in the Go project.

proto/common/v1/grpc_status.proto (1)

7-7: Updated Go package path.

The go_package option has been updated to align with the new package structure. Please verify that this change does not introduce any issues with protobuf compilation or package resolution.

Verification successful

Updated Go package path verified.

The go_package option has been correctly updated to the new package structure, and no references to the old package path were found.

  • proto/common/v1/grpc_status.proto: The new go_package path is consistent.
  • No remaining references to the old package path detected.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the new Go package path is correctly recognized.

# Test: Compile the protobuf files. Expect: No errors.
protoc --proto_path=./ --go_out=./ ./proto/common/v1/grpc_status.proto

Length of output: 146



Script:

#!/bin/bash
# Check for consistency of the new go_package path
echo "Checking for new go_package path consistency..."
rg 'github.com/roadrunner-server/api/v4/build/common/v1;commonV1'

# Check for any remaining references to the old go_package path
echo "Checking for old go_package path references..."
rg 'github.com/roadrunner-server/api/v4/common/v1;commonV1'

Length of output: 455

plugins/v4/jobs/state.go (1)

1-40: Introduced constants, Command type, and State struct.

The additions include well-defined constants for job message packing, a new Command type, and a State struct representing various job states. Please ensure these new types and constants are used consistently and correctly across the application.

plugins/v4/jobs/driver.go (1)

1-39: Introduced Driver, Commander, and Constructor interfaces.

These interfaces provide structured methods for job management. Ensure that they are implemented correctly and integrated smoothly with the rest of the application.

proto/jobs/v1/jobs.proto (1)

5-5: Updated go_package path approved.

The change in the go_package path aligns with standard practices for managing Go packages, especially in larger projects that require structured versioning and modularization.

plugins/v4/jobs/job.go (5)

7-17: Queue interface structure is appropriate for job management.

The methods defined in the Queue interface (Remove, Insert, ExtractMin, Len) are standard and well-suited for managing a job queue within the Jobs plugin.


19-36: Addition of NackWithOptions method enhances job handling flexibility.

The Job interface is well-structured and the addition of NackWithOptions method is a valuable enhancement, providing more options for handling job failures, such as requeuing with a delay.


38-55: Message interface effectively encapsulates job metadata and operations.

The structure of the Message interface, integrating KafkaOptions, is well-designed for handling job-related data, especially in systems utilizing Kafka. The methods provide essential job metadata and operations, making it robust for various job handling scenarios.


57-67: KafkaOptions interface is appropriately designed for Kafka-specific job properties.

The methods in the KafkaOptions interface (Offset, Partition, Topic, Metadata) are specific and relevant for managing Kafka-related job properties. This design ensures that Kafka-specific functionalities are cleanly abstracted and managed.


69-91: Pipeline interface provides comprehensive methods for pipeline configuration and management.

The Pipeline interface, with its methods for setting, retrieving, and checking pipeline-specific settings, is crucial for the flexible and effective management of job pipelines. This interface is well-designed to handle various configurations and metadata associated with job pipelines.

Signed-off-by: Valery Piashchynski <[email protected]>
Copy link

@coderabbitai coderabbitai bot left a 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 UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ea54c93 and 6252f1d.

Files selected for processing (1)
  • plugins/v4/jobs/job.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • plugins/v4/jobs/job.go

Signed-off-by: Valery Piashchynski <[email protected]>
Copy link

@coderabbitai coderabbitai bot left a 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 UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6252f1d and 3c1f0b7.

Files selected for processing (1)
  • plugins/v4/jobs/job.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • plugins/v4/jobs/job.go

Signed-off-by: Valery Piashchynski <[email protected]>
Copy link

@coderabbitai coderabbitai bot left a 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 UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3c1f0b7 and 36eb454.

Files selected for processing (1)
  • plugins/v4/jobs/job.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • plugins/v4/jobs/job.go

Signed-off-by: Valery Piashchynski <[email protected]>
@rustatian rustatian merged commit 35b1e26 into master Jun 25, 2024
@rustatian rustatian deleted the feature/update-jobs-api branch June 25, 2024 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: enhancement. Meaning improvements of current module, transport, etc..
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

1 participant