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

Chore/core upgrades #463

Merged
merged 5 commits into from
Jan 19, 2024
Merged

Chore/core upgrades #463

merged 5 commits into from
Jan 19, 2024

Conversation

amimart
Copy link
Member

@amimart amimart commented Jan 18, 2024

Refresh core dependencies following new okp4d version.

Details

Cosmwasm dependencies have been upgraded to the latest available version, making the possibilities to switch the rust version to 1.75.

Because of changes in Cosmos SDK genesis commands, some recipes used to manage a localnet in the makefile have been updated to work with okp4d v6.0.0.

Caveats

It's maybe due to these changes, or not, contracts are growing and the produced cognitarium wasm is too heavy to be stored on-chain with the default wasm module settings. We could gain a lot regarding this by using the rust-optimizer to build released artefacts, I'll open an issue for that and propose this merge this PR as is.

Summary by CodeRabbit

  • Documentation

    • Updated the minimum required version of Rust to 1.75 in the README.
  • New Features

    • Introduced a new plan_builder module for improved query planning.
  • Refactor

    • Updated GitHub Actions to use Rust version 1.75.
    • Enhanced data normalization logic for more reliable first-element retrieval.

@amimart amimart self-assigned this Jan 18, 2024
Copy link

coderabbitai bot commented Jan 18, 2024

Walkthrough

The project has undergone a toolchain upgrade, with the Rust version advancing from 1.69 to 1.75. This update impacts the GitHub Actions workflows and the minimum Rust version requirement noted in the documentation. Additionally, there's been a refactoring in the okp4-cognitarium package, switching out the plan module for plan_builder in the public interface, suggesting a new approach to functionality access. In the okp4-rdf package, a minor logic enhancement has been made by using first() instead of get(0) for safer element retrieval.

Changes

File(s) Change Summary
.github/workflows/.../build.yml,
.github/workflows/.../lint.yml,
.github/workflows/.../release.yml,
.github/workflows/.../test.yml
Updated Rust toolchain version from 1.69 to 1.75.
README.md Updated the minimum required version of Rust to 1.75.
contracts/.../src/querier/mod.rs Removed plan module from public exports; added plan_builder module.
packages/.../src/normalize.rs Changed get(0) to first() method call within the map function.

🐇✨
A leap in the toolchain, a hop to new code,
From .69 to .75, the Rust version strode.
Farewell to plan, hello builder delight,
With first() leading safely, through the coder's night. 🌙
🎉🐾

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

codecov bot commented Jan 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1b3a03e) 96.80% compared to head (c116b82) 97.15%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #463      +/-   ##
==========================================
+ Coverage   96.80%   97.15%   +0.35%     
==========================================
  Files          51       44       -7     
  Lines       10578    10590      +12     
==========================================
+ Hits        10240    10289      +49     
+ Misses        338      301      -37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bot-anik
Copy link
Member

bot-anik commented Jan 18, 2024

size-limit report 📦

Path Size
target/wasm32-unknown-unknown/release/okp4_objectarium.wasm 438.71 KB (+2.66% 🔺)
target/wasm32-unknown-unknown/release/okp4_law_stone.wasm 656.83 KB (+4.42% 🔺)
target/wasm32-unknown-unknown/release/okp4_cognitarium.wasm 809.71 KB (+1.11% 🔺)
target/wasm32-unknown-unknown/release/okp4_dataverse.wasm 226.24 KB (+7.61% 🔺)

@amimart amimart requested a review from ccamel January 19, 2024 11:03
@amimart amimart marked this pull request as ready for review January 19, 2024 11:04
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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 049e28a and c116b82.
Files ignored due to path filters (7)
  • Cargo.lock is excluded by: !**/*.lock
  • Cargo.toml is excluded by: !**/*.toml
  • Makefile.toml is excluded by: !**/*.toml
  • contracts/okp4-cognitarium/Cargo.toml is excluded by: !**/*.toml
  • contracts/okp4-dataverse/Cargo.toml is excluded by: !**/*.toml
  • contracts/okp4-law-stone/Cargo.toml is excluded by: !**/*.toml
  • contracts/okp4-objectarium/Cargo.toml is excluded by: !**/*.toml
Files selected for processing (7)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/lint.yml (8 hunks)
  • .github/workflows/release.yml (1 hunks)
  • .github/workflows/test.yml (1 hunks)
  • README.md (1 hunks)
  • contracts/okp4-cognitarium/src/querier/mod.rs (1 hunks)
  • packages/okp4-rdf/src/normalize.rs (1 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/lint.yml
Additional comments: 6
contracts/okp4-cognitarium/src/querier/mod.rs (1)
  • 5-8: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-7]

The plan module has been removed from the public exports, and the plan_builder module has been added. This change in the module's public API should be verified to ensure that it does not break any existing functionality that depends on the plan module.

Verification successful

The search for external usage of the plan module outside the querier directory did not yield any results. This suggests that the plan module is not used outside of the querier directory, and its removal from public exports is unlikely to affect other parts of the codebase.

Given this information, it appears that the change in the module's public API, specifically the removal of the plan module from public exports and the addition of the plan_builder module, does not break any existing functionality outside of the okp4-cognitarium contract.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for usage of the `plan` module in the codebase to ensure no breaking changes.
rg --type rust "plan::"
# Search for the `plan_builder` module to ensure it is being used correctly.
rg --type rust "plan_builder::"

Length of output: 358



Script:

#!/bin/bash
# Search for external usage of the `plan` module outside the `querier` directory to ensure no breaking changes.
rg --type rust --glob '!contracts/okp4-cognitarium/src/querier/*' "plan::"

Length of output: 74

.github/workflows/build.yml (1)
  • 37-37: The Rust toolchain version has been updated to 1.75. This change is consistent with the PR objectives and should not pose any issues as long as all Rust code in the project is compatible with the new version.
.github/workflows/test.yml (1)
  • 37-37: The Rust toolchain version has been updated to 1.75 in the test workflow. This change is consistent with the PR objectives and should not pose any issues as long as all Rust code in the project is compatible with the new version.
.github/workflows/release.yml (1)
  • 49-49: The Rust toolchain version has been updated to 1.75 in the release workflow. This change is consistent with the PR objectives and should not pose any issues as long as all Rust code in the project is compatible with the new version.
README.md (1)
  • 204-204: The minimum required version of Rust has been updated to 1.75 in the README. This change is consistent with the PR objectives and should not pose any issues as long as it is communicated to developers who may need to update their local Rust installations.
packages/okp4-rdf/src/normalize.rs (1)
  • 114-114: The get(0) method call has been replaced with first() within the map function. This is a more idiomatic way to access the first element of a collection in Rust and should not change the logic as both methods are functionally equivalent in this context.

Copy link
Member

@ccamel ccamel left a comment

Choose a reason for hiding this comment

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

Great! 😌

@amimart amimart merged commit 91f6f65 into main Jan 19, 2024
17 of 18 checks passed
@amimart amimart deleted the chore/core-upgrades branch January 19, 2024 11:21
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.

3 participants