-
Notifications
You must be signed in to change notification settings - Fork 223
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: remove build_config.json #2550
base: dev
Are you sure you want to change the base?
Conversation
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes remove two configuration files used for build and coins settings and update the configuration references. In the code, widget constructors have been streamlined with shorthand syntax and the file path for build configuration data has been updated. Additionally, the asset listing for the build configuration file has been removed from the Flutter assets in the pubspec file. No public entities or exported declarations have been altered. Changes
Sequence Diagram(s)sequenceDiagram
participant Widget as AppVersionNumber Widget
participant Config as _BundledCoinsCommitConfig
participant FS as File System
Widget->>Config: Instantiate using super.key
Config->>FS: loadString(buildConfigPath)
FS-->>Config: Return configuration data
Config-->>Widget: Provide build config data
Suggested reviewers
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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
🧹 Nitpick comments (1)
lib/views/settings/widgets/general_settings/app_version_number.dart (1)
69-78
: Handle potential exceptions from missing configuration file.Since the build configuration file path has changed and you're relying on an external package, it would be a good practice to add proper error handling around the call to
getBundledCoinsCommit()
to gracefully handle the case where the file might not exist or have an unexpected format.Consider updating the error handling in
getBundledCoinsCommit()
to catch potentialPlatformException
when the file doesn't exist:Future<String> getBundledCoinsCommit() async { final buildConfigPath = 'packages/komodo_defi_framework/app_build/build_config.json'; try { final String commit = await rootBundle .loadString(buildConfigPath) .then( (String jsonString) => json.decode(jsonString) as Map<String, dynamic>, ) .then( (Map<String, dynamic> json) => json['coins'] as Map<String, dynamic>, ) .then( (Map<String, dynamic> json) => json['bundled_coins_repo_commit'] as String, ); return commit; } catch (e) { debugPrint('Failed to load build config: $e'); return ''; } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
app_build/BUILD_CONFIG_README.md
(0 hunks)app_build/build_config.json
(0 hunks)lib/views/settings/widgets/general_settings/app_version_number.dart
(3 hunks)pubspec.yaml
(0 hunks)
💤 Files with no reviewable changes (3)
- pubspec.yaml
- app_build/build_config.json
- app_build/BUILD_CONFIG_README.md
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: build_and_preview
- GitHub Check: validate_code_guidelines
🔇 Additional comments (5)
lib/views/settings/widgets/general_settings/app_version_number.dart (5)
12-12
: Good modernization of constructor syntax.Using the
super.key
shorthand syntax is a modern Flutter pattern that makes the code cleaner while maintaining the same functionality.
39-39
: Good modernization of constructor syntax.Using the
super.key
shorthand syntax is a modern Flutter pattern that makes the code cleaner while maintaining the same functionality.
91-91
: Good modernization of constructor syntax.Using the
super.key
shorthand syntax is a modern Flutter pattern that makes the code cleaner while maintaining the same functionality.
81-82
: Implement the SDK getter mentioned in the TODO comment.There's a TODO comment about adding an SDK getter for the updated commit hash. Since you're transitioning to using the SDK for configuration, it would be good to implement this SDK getter if it's available now.
Is there an equivalent SDK method that could be used here instead of the placeholder text?
44-47
:❓ Verification inconclusive
Verify the build configuration file path.
The path for loading the build configuration has been updated to use the SDK version (
packages/komodo_defi_framework/app_build/build_config.json
) instead of the local version. This aligns with removing the localbuild_config.json
file as mentioned in the PR objectives, but ensure the SDK-provided file exists and has the same structure.This change appears to be dependent on PR #35 in the komodo-defi-sdk-flutter repository. Ensure that PR has been merged and the file is properly exposed via assets before merging this PR.
🏁 Script executed:
#!/bin/bash # Verify if the new build config file exists fd "build_config.json" --full-path | grep "komodo_defi_framework"Length of output: 63
Action Required: Manually verify that the SDK build configuration file is present and exposed via assets
- Confirm that the file
packages/komodo_defi_framework/app_build/build_config.json
exists in the repository and adheres to the expected structure.- Ensure that the file, provided by the SDK as per PR Potential problems when building on Windows #35 in the komodo-defi-sdk-flutter repository, is properly exposed as an asset.
- Since the automated check (using
fd
piped throughgrep
) did not yield any output, please perform a manual verification to guarantee that the new file path is valid and that the asset is available before merging.
The SDK now manages asset downloading and builds, so
build_config.json
is no longer necessary in this repository.This depends on build_config.json exposure via assets in #35
Summary by CodeRabbit