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

Feat/sync dev with v1.8.2 #366

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open

Conversation

PavelInjective
Copy link
Contributor

@PavelInjective PavelInjective commented Dec 13, 2024

Summary by CodeRabbit

  • New Features

    • Updated project version to 1.9.0-pre.
    • Introduced new dependency importlib-metadata for improved compatibility.
  • Bug Fixes

    • Enhanced flexibility of the protobuf dependency version.
    • Corrected an identifier in the OFAC list.
  • Documentation

    • Updated changelog to reflect version 1.8.2 and various dependency updates.
  • Chores

    • Updated Python version constraints in workflow configuration.
    • Updated gRPC plugin version in configuration files.

Copy link
Contributor

coderabbitai bot commented Dec 13, 2024

Walkthrough

The changes in this pull request involve updates to several configuration files related to dependency management and versioning. The GitHub Actions workflow for pre-commit has been modified to enforce specific Python version constraints. The changelog has been updated to reflect a new version entry with a change in the protobuf dependency. Additionally, the buf.gen.yaml file has been updated to a new gRPC plugin version, and the pyproject.toml file has seen modifications in project versioning and dependency specifications, including the introduction of a new dependency.

Changes

File Change Summary
.github/workflows/pre-commit.yml Updated python-version parameter to enforce version '>=3.9 <3.12' in Install Python step.
CHANGELOG.md Added version entry 1.8.2 with updated protobuf dependency version for flexibility.
buf.gen.yaml Updated gRPC plugin version from v1.65.4 to v1.65.5, version set to v2, management enabled.
pyproject.toml Updated project version to 1.9.0-pre, changed aiohttp and protobuf dependencies to caret requirements, added importlib-metadata dependency with <5.0 constraint.

Possibly related PRs

  • feat/upgrade_protobuf_version #365: This PR updates the protobuf dependency version to enhance flexibility, which is relevant as the main PR also involves changes to dependency management in pyproject.toml.
  • (fix) Update OFAC JSON #367: This PR modifies an entry in the ofac.json file, which is directly related to the changes made in the main PR that also involves updates to the ofac.json file.

Suggested reviewers

  • aarmoa

🐰 In the garden, I hop with glee,
New versions sprout, as bright as can be!
With Python's range, we dance and play,
Dependencies updated, hip-hip-hooray!
Changelog sings of changes so fine,
In our code, everything will align! 🌼


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bf48b5d and cdcc11a.

📒 Files selected for processing (1)
  • pyinjective/ofac.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • pyinjective/ofac.json

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. (Experiment)
  • @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.

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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 240d229 and bf48b5d.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • .github/workflows/pre-commit.yml (1 hunks)
  • CHANGELOG.md (1 hunks)
  • buf.gen.yaml (1 hunks)
  • pyproject.toml (4 hunks)
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
🔇 Additional comments (5)
.github/workflows/pre-commit.yml (1)

15-16: LGTM! Python version constraint is well-defined.

The version range >=3.9 <3.12 aligns with the project's requirements and provides a good balance between flexibility and stability.

Let's verify compatibility with key dependencies:

✅ Verification successful

Python version constraint is appropriate and consistent

The version constraint >=3.9 <3.12 in the pre-commit workflow aligns perfectly with:

  • Project's base requirement of python = "^3.9" in pyproject.toml
  • Test matrix covering Python 3.9, 3.10, and 3.11
  • Black formatter's target versions: py39, py310, py311
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if any dependencies in pyproject.toml specify Python version constraints
rg -A 1 'python = ".*"' pyproject.toml

# Check if any dependencies have known issues with Python 3.11
rg -l 'python_version.*3\.11' .github/

Length of output: 211


Script:

#!/bin/bash
# Check for any Python version constraints in requirements files
fd -e txt -e in requirements | xargs rg 'python_version|Python'

# Check for any Python version constraints in setup files
fd -e cfg -e py setup | xargs rg 'python_version|requires.*Python'

# Look for any CI/test configurations that might specify Python versions
fd -e yml -e yaml | xargs rg 'python-version|PYTHON_VERSION'

Length of output: 66363


Script:

#!/bin/bash
# Check Python version constraints in pyproject.toml
cat pyproject.toml

# Check for any Python version constraints in CI workflows
fd -e yml -e yaml .github/workflows/ | xargs cat

Length of output: 2947


Script:

#!/bin/bash
# Check Python version constraints in CI workflows with corrected path
fd . '.github/workflows/' -e yml -e yaml | xargs cat

Length of output: 2630

buf.gen.yaml (1)

7-7: LGTM! Minor version update for gRPC plugin.

The update from v1.65.4 to v1.65.5 is a patch version change and should be safe.

Let's verify compatibility with related dependencies:

✅ Verification successful

LGTM! The gRPC plugin update is compatible with dependencies

The project uses flexible version constraints for gRPC dependencies (grpcio = "*", grpcio-tools = "*"), and the protobuf dependency is pinned to ^5.26.1. The update from v1.65.4 to v1.65.5 of the gRPC Python plugin is a patch version change, which is safe and compatible with these dependencies.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check protobuf and grpc dependencies in the project
rg -A 1 'protobuf|grpc' pyproject.toml

# Check for any potential breaking changes in the gRPC plugin
curl -s "https://raw.githubusercontent.com/grpc/grpc/v1.65.5/doc/python/changelog.md" | grep -A 5 "1.65.5"

Length of output: 273

pyproject.toml (3)

25-25: Security-related version constraint change for aiohttp.

The comment indicates this is a security-related dependency. Changing from >=3.9.4 to ^3.9.4 might allow future versions that could reintroduce security issues.

Let's verify the security implications:

✅ Verification successful

Using ^3.9.4 is appropriate for security constraints

The caret (^) constraint in ^3.9.4 allows updates to patch and minor versions while keeping the major version fixed (3.x.x). This is actually safer than >=3.9.4 because:

  1. It prevents updates to version 4.x.x which could introduce breaking changes or new vulnerabilities
  2. It allows security patches within the 3.x series, which is important as shown by recent advisories:
    • 3.10.11 fixes request smuggling and memory leak issues
    • 3.10.2 fixes path traversal in compressed files
    • 3.9.4 fixes DoS and XSS vulnerabilities

The current constraint ^3.9.4 ensures you get these security fixes while maintaining compatibility.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for known security advisories for aiohttp
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: PIP, package: "aiohttp") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'

Length of output: 1618


34-34: Consider implications of relaxing protobuf version constraint.

Changing from =5.26.1 to ^5.26.1 could lead to compatibility issues with the gRPC plugins and generated code.

Let's verify compatibility:

✅ Verification successful

Let me analyze the results and generate a final response.

Relaxing protobuf version constraint appears safe

The codebase heavily uses protobuf for generated code but:

  • No explicit version requirements found in the generated code
  • Uses standard protobuf imports and APIs that are stable across 5.x versions
  • Generated code uses core protobuf features (descriptors, builders, symbol database) that maintain compatibility in minor versions
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any protobuf version requirements in generated code
rg -l 'proto.*5\.26\.1' pyinjective/proto/

# Check for any version-specific imports or features
rg 'from google.protobuf' pyinjective/proto/

Length of output: 68226


54-54: Verify the need for importlib-metadata constraint.

Adding importlib-metadata = "<5.0" with an upper bound suggests potential compatibility issues. Please document the reason for this constraint.

Let's check for related issues:

@@ -1,6 +1,6 @@
[tool.poetry]
name = "injective-py"
version = "1.8.1"
version = "1.9.0-pre"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Version number inconsistent with PR objective.

The PR title suggests syncing with v1.8.1, but the version is being bumped to 1.9.0-pre. This seems inconsistent with the PR's objective.

Please clarify if this version bump is intentional or if it should remain at 1.8.1 to align with the PR's purpose.

@PavelInjective PavelInjective changed the title Feat/sync dev with v1.8.1 Feat/sync dev with v1.8.2 Dec 13, 2024
(cherry picked from commit eb70492)
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