-
Notifications
You must be signed in to change notification settings - Fork 182
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
fix(sozo): ensure overlays can support any resource type #2169
Conversation
WalkthroughThe recent changes in Changes
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this 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
Outside diff range and nitpick comments (1)
crates/sozo/ops/src/migration/auto_auth.rs (1)
61-67
: Refactor resource type handling for clarity.The current logic for determining
resource_type
can be simplified for readability.- let resource_type = if tag_with_prefix.contains(':') { - tag_with_prefix.to_string() - } else { - // Default to model if no prefix was given. - format!("m:{}", tag_with_prefix) - }; + let resource_type = match tag_with_prefix.contains(':') { + true => tag_with_prefix.to_string(), + false => format!("m:{}", tag_with_prefix), + };
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- crates/sozo/ops/src/migration/auto_auth.rs (3 hunks)
Additional comments not posted (2)
crates/sozo/ops/src/migration/auto_auth.rs (2)
13-13
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
auto_authorize
are updated if the signature has changed.
46-51
: Verify the existence of contracts.Ensure that the
expect
statement correctly handles cases where the contract might not exist. Consider adding more context to the error message for easier debugging.- .expect("we know this contract exists"); + .expect("Contract with the specified tag not found in local manifest");
There was a problem hiding this 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
Files selected for processing (1)
- crates/sozo/ops/src/migration/auto_auth.rs (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- crates/sozo/ops/src/migration/auto_auth.rs
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2169 +/- ##
=======================================
Coverage 68.00% 68.00%
=======================================
Files 331 331
Lines 42697 42728 +31
=======================================
+ Hits 29035 29057 +22
- Misses 13662 13671 +9 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this 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
Files selected for processing (1)
- crates/sozo/ops/src/migration/auto_auth.rs (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- crates/sozo/ops/src/migration/auto_auth.rs
This PR enables the use of any resource type into the overlays, to follow the scheme used by
sozo auth
command.Summary by CodeRabbit
Refactor
Bug Fixes