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

Strip out pbjson since we don't need it #310

Merged
merged 1 commit into from
May 24, 2024
Merged

Strip out pbjson since we don't need it #310

merged 1 commit into from
May 24, 2024

Conversation

sporkmonger
Copy link
Contributor

@sporkmonger sporkmonger commented May 24, 2024

We removed most of the JSON stuff for protobufs, but didn't remove the pbjson dependency. This removes it.

Summary by CodeRabbit

  • New Features

    • Improved protobuf compilation settings for better performance and compatibility.
  • Chores

    • Updated and streamlined dependencies for more efficient builds.
  • Refactor

    • Removed unnecessary configurations to simplify build processes.
    • Added code quality attribute to enhance maintainability.

@sporkmonger sporkmonger added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. dependencies Pull requests that update a dependency file. rust Pull requests that update Rust code labels May 24, 2024
@sporkmonger sporkmonger added this to the Release 0.6.0 milestone May 24, 2024
Copy link
Contributor

coderabbitai bot commented May 24, 2024

Walkthrough

The recent updates to the ext-processor crate involve adjustments to dependencies and protobuf compilation settings. Specifically, prost-types was added while pbjson, pbjson-types, and pbjson-build were removed. Additionally, tonic-build was upgraded. The build.rs file saw the removal of certain protobuf configurations, and a Clippy lint attribute was added to the protobuf.rs file to allow large enum variants.

Changes

File Change Summary
crates/ext-processor/Cargo.toml Added prost-types dependency, removed pbjson, pbjson-types, and pbjson-build dependencies. Updated tonic-build to 0.9.2.
crates/ext-processor/build.rs Removed .compile_well_known_types(true) and .extern_path(".google.protobuf", "::pbjson_types") configurations.
crates/ext-processor/src/protobuf.rs Added #[allow(clippy::large_enum_variant)] attribute in v3 module under ext_authz module.

🐇 In lines of code, we weave and twine,
Dependencies shift, a dance so fine.
Protobufs align, enums grow,
With each new step, our crate will glow.
A rabbit's touch, light as air,
Brings harmony to code with care.

Tip

New Features and Improvements

Review Settings

Introduced new personality profiles for code reviews. Users can now select between "Chill" and "Assertive" review tones to tailor feedback styles according to their preferences. The "Assertive" profile posts more comments and nitpicks the code more aggressively, while the "Chill" profile is more relaxed and posts fewer comments.

AST-based Instructions

CodeRabbit offers customizing reviews based on the Abstract Syntax Tree (AST) pattern matching. Read more about AST-based instructions in the documentation.

Community-driven AST-based Rules

We are kicking off a community-driven initiative to create and share AST-based rules. Users can now contribute their AST-based rules to detect security vulnerabilities, code smells, and anti-patterns. Please see the ast-grep-essentials repository for more information.

New Static Analysis Tools

We are continually expanding our support for static analysis tools. We have added support for biome, hadolint, and ast-grep. Update the settings in your .coderabbit.yaml file or head over to the settings page to enable or disable the tools you want to use.

Tone Settings

Users can now customize CodeRabbit to review code in the style of their favorite characters or personalities. Here are some of our favorite examples:

  • Mr. T: "You must talk like Mr. T in all your code reviews. I pity the fool who doesn't!"
  • Pirate: "Arr, matey! Ye must talk like a pirate in all yer code reviews. Yarrr!"
  • Snarky: "You must be snarky in all your code reviews. Snark, snark, snark!"

Revamped Settings Page

We have redesigned the settings page for a more intuitive layout, enabling users to find and adjust settings quickly. This change was long overdue; it not only improves the user experience but also allows our development team to add more settings in the future with ease. Going forward, the changes to .coderabbit.yaml will be reflected in the settings page, and vice versa.

Miscellaneous

  • Turn off free summarization: You can switch off free summarization of PRs opened by users not on a paid plan using the enable_free_tier setting.
  • Knowledge-base scope: You can now set the scope of the knowledge base to either the repository (local) or the organization (global) level using the knowledge_base setting. In addition, you can specify Jira project keys and Linear team keys to limit the knowledge base scope for those integrations.
  • High-level summary placement: You can now customize the location of the high-level summary in the PR description using the high_level_summary_placeholder setting (default @coderabbitai summary).
  • Revamped request changes workflow: You can now configure CodeRabbit to auto-approve or request changes on PRs based on the review feedback using the request_changes_workflow setting.

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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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

dryrunsecurity bot commented May 24, 2024

Hi there 👋, @DryRunSecurity here, below is a summary of our analysis and findings.

DryRun Security Status Findings
Configured Codepaths Analyzer 0 findings
Secrets Analyzer 0 findings
Authn/Authz Analyzer 0 findings
AppSec Analyzer 0 findings
Sensitive Files Analyzer 0 findings

Note

🟢 Risk threshold not exceeded.

Change Summary (click to expand)

The following is a summary of changes in this pull request made by me, your security buddy 🤖. Note that this summary is auto-generated and not meant to be a definitive list of security issues but rather a helpful summary from a security perspective.

Summary:

The code changes in this pull request primarily involve updates to dependencies and build configurations related to the Envoy proxy project's ext-processor crate. The changes do not appear to introduce any obvious security vulnerabilities, but there are a few areas that warrant closer review from an application security perspective.

The key changes include:

  1. Removal of the pbjson and pbjson-types dependencies and the addition of the prost-types dependency, suggesting a change in the protobuf implementation used by the project.
  2. Removal of the compile_well_known_types and extern_path options in the build.rs file, which were previously used to handle the compilation of well-known protobuf types.
  3. Updates to the base64, prost, and prost-types crates, which is a positive security practice to keep dependencies up-to-date.

While these changes do not directly introduce security vulnerabilities, it's important to review the impact of the protobuf implementation change and ensure that the new implementation does not introduce any compatibility issues or security concerns. Additionally, the overall build process and the generated Rust code should be reviewed to verify that input validation, authorization, error handling, and other security-critical aspects are properly implemented.

Files Changed:

  1. crates/ext-processor/src/protobuf.rs: The changes in this file add a #[allow(clippy::large_enum_variant)] attribute to the v3 module of the envoy.extensions.filters.http.ext_authz module. This is a common practice when working with protobuf-generated code to suppress a Clippy linter warning.
  2. crates/ext-processor/Cargo.toml: The changes in this file involve the removal of the pbjson and pbjson-types dependencies and the addition of the prost-types dependency, suggesting a change in the protobuf implementation used by the project.
  3. crates/ext-processor/build.rs: The changes in this file remove the compile_well_known_types and extern_path options, which were previously used to handle the compilation of well-known protobuf types.
  4. Cargo.lock: This file has been updated to reflect the dependency changes, including the update to the base64 crate and the removal of the pbjson, pbjson-build, and pbjson-types crates.

Powered by DryRun Security

Copy link
Contributor

@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 7ae1cd5 and cfb4fe7.
Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
Files selected for processing (3)
  • crates/ext-processor/Cargo.toml (1 hunks)
  • crates/ext-processor/build.rs (1 hunks)
  • crates/ext-processor/src/protobuf.rs (1 hunks)
Files skipped from review due to trivial changes (2)
  • crates/ext-processor/build.rs
  • crates/ext-processor/src/protobuf.rs
Additional comments not posted (2)
crates/ext-processor/Cargo.toml (2)

37-37: Added prost-types dependency.

Ensure that this new dependency integrates well with the existing system and does not introduce any conflicts.


37-37: Updated tonic-build to version 0.9.2.

Verification successful

The verification process did not reveal any explicit compatibility issues or conflicts related to tonic-build version 0.9.2 in the Cargo.toml files. The search results primarily listed various dependencies but did not indicate any specific problems.

  • crates/ext-processor/Cargo.toml: tonic-build = "0.9.2"
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify compatibility of `tonic-build` version `0.9.2` with other dependencies.

# Test: Check for any known issues with `tonic-build` version `0.9.2`.
rg --type toml $'tonic-build = "0.9.2"' --files-with-matches | xargs cat | grep -i "known issues"

Length of output: 98



Script:

#!/bin/bash
# Description: Verify the presence of `tonic-build` version `0.9.2` in Cargo.toml files and check for compatibility issues.

# Search for `tonic-build` in Cargo.toml files
rg --type toml 'tonic-build = "0.9.2"'

# Check for compatibility issues with other dependencies
rg --type toml 'tonic-build' | xargs -I {} sh -c 'cat {} && echo "----"' | grep -i -E 'conflict|incompatible|error|issue'

Length of output: 591



Script:

#!/bin/bash
# Description: Verify the presence of `tonic-build` version `0.9.2` in Cargo.toml files and check for compatibility issues.

# Search for `tonic-build` in Cargo.toml files
rg --type toml 'tonic-build = "0.9.2"'

# Check for compatibility issues with other dependencies
rg --type toml 'tonic-build' --files-with-matches | xargs cat | grep -i -E 'conflict|incompatible|error|issue'

Length of output: 838

@sporkmonger sporkmonger merged commit 63fecee into main May 24, 2024
14 checks passed
@sporkmonger sporkmonger deleted the eject-pbjson branch May 24, 2024 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant