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

Update to newest protos #422

Merged
merged 3 commits into from
Jan 27, 2025
Merged

Update to newest protos #422

merged 3 commits into from
Jan 27, 2025

Conversation

mkysel
Copy link
Collaborator

@mkysel mkysel commented Jan 23, 2025

Summary by CodeRabbit

  • Chores

    • Updated code generation tool from version 2.44.1 to 2.50.0 across multiple mock files.
    • Removed some mock methods in validation-related files.
  • Refactor

    • Modified mock JWT verifier to return additional uint32 value.
    • Updated envelope creation utility functions to replace LastSeen with DependsOn.
    • Removed some Git mappings from project configuration.

@mkysel mkysel requested a review from a team as a code owner January 23, 2025 21:31
Copy link

coderabbitai bot commented Jan 23, 2025

Warning

Rate limit exceeded

@mkysel has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 53 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 96555f8 and 5fc31dd.

📒 Files selected for processing (1)
  • pkg/interceptors/server/auth_test.go (4 hunks)

Walkthrough

This pull request involves multiple updates across various mock files and a test utility file. The primary changes include updating the code generation tool version from v2.44.1 to v2.50.0 in several mock files, modifying method signatures in the MockJWTVerifier, removing ValidateInboxIds and ValidateKeyPackages methods from the MockValidationApiClient, and updating the envelopes.go test utility to replace the LastSeen field with DependsOn. Additionally, the .idea/vcs.xml file had several Git version control mappings removed.

Changes

File Change Summary
.idea/vcs.xml Removed multiple Git version control mappings for contract library directories
pkg/mocks/authn/mock_JWTVerifier.go Updated method signatures to return (uint32, error) instead of just error
pkg/mocks/blockchain/mock_ChainClient.go Updated mockery version from v2.44.1 to v2.50.0
pkg/mocks/blockchain/mock_IBlockchainPublisher.go Updated mockery version from v2.44.1 to v2.50.0
pkg/mocks/indexer/mock_IBlockTracker.go Updated mockery version from v2.44.1 to v2.50.0
pkg/mocks/mls_validationv1/mock_ValidationApiClient.go Removed ValidateInboxIds and ValidateKeyPackages methods
pkg/mocks/mlsvalidate/mock_MLSValidationService.go Updated mockery version from v2.44.1 to v2.50.0
pkg/mocks/registry/mock_NodeRegistry.go Updated mockery version from v2.44.1 to v2.50.0 and modified comments
pkg/mocks/registry/mock_NodesContract.go Updated mockery version from v2.44.1 to v2.50.0
pkg/mocks/storer/mock_LogStorer.go Updated mockery version from v2.44.1 to v2.50.0
pkg/testutils/envelopes/envelopes.go Replaced LastSeen field with DependsOn in envelope creation functions
pkg/api/message/publish_test.go Updated tests to reflect changes in the AuthenticatedData structure
pkg/envelopes/envelopes_test.go Updated buildAad function to replace LastSeen with DependsOn
pkg/server/server_test.go Updated test functions to use DependsOn instead of LastSeen in AuthenticatedData

Possibly related PRs

Suggested reviewers

  • richardhuaaa

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a281f4a and 5662b73.

⛔ Files ignored due to path filters (5)
  • pkg/proto/mls_validation/v1/service.pb.go is excluded by !**/*.pb.go, !pkg/proto/**
  • pkg/proto/mls_validation/v1/service_grpc.pb.go is excluded by !**/*.pb.go, !pkg/proto/**
  • pkg/proto/openapi/mls_validation/v1/service.swagger.json is excluded by !pkg/proto/**
  • pkg/proto/openapi/xmtpv4/payer_api/payer_api.swagger.json is excluded by !pkg/proto/**
  • pkg/proto/xmtpv4/envelopes/envelopes.pb.go is excluded by !**/*.pb.go, !pkg/proto/**
📒 Files selected for processing (11)
  • .idea/vcs.xml (0 hunks)
  • pkg/mocks/authn/mock_JWTVerifier.go (3 hunks)
  • pkg/mocks/blockchain/mock_ChainClient.go (1 hunks)
  • pkg/mocks/blockchain/mock_IBlockchainPublisher.go (1 hunks)
  • pkg/mocks/indexer/mock_IBlockTracker.go (2 hunks)
  • pkg/mocks/mls_validationv1/mock_ValidationApiClient.go (1 hunks)
  • pkg/mocks/mlsvalidate/mock_MLSValidationService.go (1 hunks)
  • pkg/mocks/registry/mock_NodeRegistry.go (5 hunks)
  • pkg/mocks/registry/mock_NodesContract.go (1 hunks)
  • pkg/mocks/storer/mock_LogStorer.go (1 hunks)
  • pkg/testutils/envelopes/envelopes.go (2 hunks)
💤 Files with no reviewable changes (1)
  • .idea/vcs.xml
✅ Files skipped from review due to trivial changes (7)
  • pkg/mocks/storer/mock_LogStorer.go
  • pkg/mocks/indexer/mock_IBlockTracker.go
  • pkg/mocks/blockchain/mock_IBlockchainPublisher.go
  • pkg/mocks/registry/mock_NodesContract.go
  • pkg/mocks/blockchain/mock_ChainClient.go
  • pkg/mocks/mlsvalidate/mock_MLSValidationService.go
  • pkg/mocks/registry/mock_NodeRegistry.go
🔇 Additional comments (3)
pkg/mocks/authn/mock_JWTVerifier.go (1)

66-69: LGTM! Return type changes are properly implemented.

The mock's Return and RunAndReturn methods correctly handle the new (uint32, error) signature.

Also applies to: 71-74

pkg/testutils/envelopes/envelopes.go (1)

33-33: Verify the consistency of DependsOn initialization.

The DependsOn field is initialized differently in these functions:

  • CreateClientEnvelope: new empty Cursor
  • CreateOriginatorEnvelopeWithTopic: nil

Please verify if this difference is intentional based on the test requirements.

Also applies to: 133-133

✅ Verification successful

Different DependsOn initializations are intentionally testing both nil and non-nil cases

The proto definition confirms DependsOn as an optional field, making both nil and non-nil initializations valid. The different initializations in test utilities appear to be intentional to ensure test coverage for both scenarios.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other DependsOn field initializations
rg 'DependsOn.*:' --type go

Length of output: 339

pkg/mocks/mls_validationv1/mock_ValidationApiClient.go (1)

1-1: Verify impact of removed validation methods.

The ValidateInboxIds and ValidateKeyPackages methods have been removed from the mock. Please ensure that no tests depend on these removed methods.

@@ -1,4 +1,4 @@
// Code generated by mockery v2.44.1. DO NOT EDIT.
// Code generated by mockery v2.50.0. DO NOT EDIT.
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Test files need to be updated to handle the new Verify method signature

The production code correctly handles both return values, but test files need updates:

  • pkg/interceptors/server/auth_test.go: Mock expectations should return (uint32, error) instead of just error
  • pkg/authn/verifier_test.go and pkg/authn/claims_test.go: Tests should verify the returned nodeId value
🔗 Analysis chain

Verify that all callers handle the new return value from Verify method.

The JWT verification now returns an additional uint32 value. Ensure all calling code is updated to handle both return values correctly.

Also applies to: 28-45

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for direct calls to Verify method
rg -A 2 '\.Verify\(' --type go

Length of output: 3561

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: 1

🧹 Nitpick comments (1)
pkg/server/server_test.go (1)

Line range hint 110-110: Document the architectural implications of switching from LastSeen to DependsOn.

The change from LastSeen to DependsOn appears to be a significant architectural shift in how envelope dependencies are tracked. Consider:

  1. Adding documentation explaining the rationale behind this change
  2. Describing how this affects message ordering and dependencies
  3. Providing migration guidelines for existing implementations

Also applies to: 125-125, 164-164, 159-159, 173-173, 260-260

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5662b73 and 96555f8.

📒 Files selected for processing (3)
  • pkg/api/message/publish_test.go (2 hunks)
  • pkg/envelopes/envelopes_test.go (1 hunks)
  • pkg/server/server_test.go (3 hunks)
🔇 Additional comments (2)
pkg/envelopes/envelopes_test.go (1)

110-110: Verify backward compatibility with existing clients.

The change from LastSeen to DependsOn in the AuthenticatedData structure might impact existing clients. Please ensure this change is backward compatible or that appropriate migration steps are documented.

✅ Verification successful

Backward compatibility is properly maintained

The codebase shows proper handling of the LastSeen field with null checks and default initializations in the service code. The change from LastSeen to DependsOn appears to be test-specific and doesn't impact the actual service implementation.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining usages of LastSeen in the codebase
echo "Checking for remaining LastSeen references in proto definitions..."
rg -l "LastSeen" --type proto

echo "Checking for LastSeen references in Go files..."
rg -l "LastSeen" --type go

Length of output: 576


Script:

#!/bin/bash
# Check the context of LastSeen usage in the files
echo "Checking LastSeen usage context in Go files..."
rg "LastSeen" -B 2 -A 2 --type go

echo -e "\nChecking for proto files with .proto extension..."
fd -e proto

echo -e "\nChecking content of proto files if found..."
fd -e proto -x cat {}

Length of output: 10336

pkg/api/message/publish_test.go (1)

125-125: LGTM! Test coverage looks good.

The changes correctly update the test cases to use DependsOn instead of LastSeen, maintaining test coverage for both successful and failed key package validation scenarios.

Also applies to: 164-164

pkg/server/server_test.go Show resolved Hide resolved
@mkysel mkysel requested a review from neekolas January 23, 2025 21:46
@mkysel mkysel enabled auto-merge (squash) January 23, 2025 21:59
@mkysel mkysel merged commit 879b270 into main Jan 27, 2025
7 checks passed
@mkysel mkysel deleted the mkysel/update-protos branch January 27, 2025 16:59
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