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

Tml 12 #75

Merged
merged 15 commits into from
May 9, 2024
Merged

Tml 12 #75

merged 15 commits into from
May 9, 2024

Conversation

ducpq
Copy link
Contributor

@ducpq ducpq commented May 6, 2024

Summary by CodeRabbit

  • New Features

    • Updated coverage script in melos.yaml to include HTML report generation.
    • Introduced task configurations for Dart projects in .moon/tasks/dart.yml.
    • Configured mobile app development commands and file groups in apps/mobile/moon.yml.
    • Added new configurations for Flutter tasks in scripts/mobile.toml.
    • Updated Dockerfile for the web app to use Node 20 image.
  • Bug Fixes

    • Corrected spacing in assertions for request and response properties in http_client tests.
  • Chores

    • Updated uuid dependency to version 4.4.0 in apps/mobile/pubspec.yaml.
    • Removed FLUTTER_VERSION environment variable from CI configuration.
    • Added and updated code owners in .github/CODEOWNERS.
    • Removed make test.unit.run command from .husky/pre-push script.
  • Documentation

    • No user-facing documentation changes noted.
  • Refactor

    • Simplified path patterns and standardized branch definitions in CI configuration for mobile app.
  • Style

    • Added new lines at the end of script files in .moon/hooks.
  • Tests

    • Changed test dependency to flutter_test in http_client and logger packages.

@ducpq ducpq requested a review from yusaki0998 as a code owner May 6, 2024 15:39
Copy link

linear bot commented May 6, 2024

Copy link
Contributor

coderabbitai bot commented May 6, 2024

Warning

Rate Limit Exceeded

@harrytran998 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 21 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 2719253 and b764a8f.

Walkthrough

The changes encompass optimizations in mobile development workflows, refining GitHub Actions, adjusting dependencies, and enhancing testing setups. These updates streamline triggers, introduce new scripts for Dart and mobile management, enhance dependency declarations for improved testing support, and standardize workflow paths.

Changes

Files Summary of Changes
.github/workflows/ci.mobile.yml, apps/mobile/melos.yaml, apps/mobile/packages/http_client/pubspec.yaml, .github/CODEOWNERS Updated workflow triggers, added new scripts and dependencies, and adjusted code ownership.
apps/mobile/packages/http_client/test/extensions/base_request_test.dart, apps/mobile/packages/http_client/test/extensions/base_response_test.dart Adjusted test file assertions and formatting.
.moon/hooks/commit-msg.sh, .moon/hooks/pre-push.sh, Makefile.toml Added/removed scripts/commands, updated Rust project automation configuration.
scripts/dart.yml, scripts/mobile.toml, scripts/tool.toml Introduced new configurations for Dart projects, mobile builds, and TypeScript linting.

🐇✨
Hopping through the code, with a tweak and a fix,
New scripts in place, our builds now quick.
Dependencies aligned, tests finely tuned,
A rabbit's work, under the moonlight, concluded!
🌙🚀


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 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
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 05db9b1 and 0c6a20b.
Files selected for processing (7)
  • .github/workflow/ci.mobile.yml (1 hunks)
  • apps/mobile/melos.yaml (1 hunks)
  • apps/mobile/packages/http_client/pubspec.yaml (1 hunks)
  • apps/mobile/packages/http_client/test/extensions/base_request_test.dart (1 hunks)
  • apps/mobile/packages/http_client/test/extensions/base_response_test.dart (1 hunks)
  • apps/mobile/packages/logger/pubspec.yaml (1 hunks)
  • apps/mobile/pubspec.yaml (1 hunks)
Files skipped from review due to trivial changes (4)
  • .github/workflow/ci.mobile.yml
  • apps/mobile/packages/http_client/pubspec.yaml
  • apps/mobile/packages/http_client/test/extensions/base_request_test.dart
  • apps/mobile/packages/logger/pubspec.yaml
Additional comments not posted (3)
apps/mobile/melos.yaml (1)

19-24: Enhanced coverage reporting setup looks good.

apps/mobile/packages/http_client/test/extensions/base_response_test.dart (1)

17-21: Refined assertions enhance test precision and readability.

Verification successful

The verification confirms that there is a dedicated test group for the BaseResponse.copy functionality in base_response_test.dart, which suggests comprehensive testing of this feature. No further action is required.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify if there are comprehensive tests covering the copy functionality.

# Test: Search for additional tests related to the copy functionality.
rg --type dart $'BaseResponse.copy'

Length of output: 234

apps/mobile/pubspec.yaml (1)

47-47: Update to uuid package version is noted. Ensure compatibility with existing code.

Verification successful

The update to uuid version 4.4.0 appears to be compatible with the existing usage in the codebase, specifically in user_repository.dart where the Uuid().v4() method is used to generate UUIDs. This method is a standard feature and is unlikely to have undergone significant changes in a minor version update. However, it is advisable to review the release notes of uuid version 4.4.0 to ensure there are no unexpected changes that might affect its behavior.

  • File: apps/mobile/lib/features/users/domain/repo/src/user_repository.dart
    • Usage: Uuid().v4() method to generate UUIDs.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the compatibility of the new `uuid` version with existing code.

# Test: Search for usage of the `uuid` package in the codebase.
rg --type dart $'uuid'

Length of output: 122



Script:

#!/bin/bash
# Description: Extract the usage details of the `uuid` package in user_repository.dart

# Test: Search for specific methods from the `uuid` package being used in user_repository.dart
rg --type dart -C 5 'Uuid().' apps/mobile/lib/features/users/domain/repo/src/user_repository.dart

Length of output: 297

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 05db9b1 and a33a572.
Files selected for processing (6)
  • apps/mobile/melos.yaml (1 hunks)
  • apps/mobile/packages/http_client/pubspec.yaml (1 hunks)
  • apps/mobile/packages/http_client/test/extensions/base_request_test.dart (1 hunks)
  • apps/mobile/packages/http_client/test/extensions/base_response_test.dart (1 hunks)
  • apps/mobile/packages/logger/pubspec.yaml (1 hunks)
  • apps/mobile/pubspec.yaml (1 hunks)
Files skipped from review as they are similar to previous changes (6)
  • apps/mobile/melos.yaml
  • apps/mobile/packages/http_client/pubspec.yaml
  • apps/mobile/packages/http_client/test/extensions/base_request_test.dart
  • apps/mobile/packages/http_client/test/extensions/base_response_test.dart
  • apps/mobile/packages/logger/pubspec.yaml
  • apps/mobile/pubspec.yaml

@ducpq ducpq force-pushed the TML-12 branch 2 times, most recently from cde871a to 30d4297 Compare May 6, 2024 16:01
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 a33a572 and 1f30790.
Files selected for processing (1)
  • .github/workflows/ci.mobile.yml (1 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/ci.mobile.yml

@ducpq ducpq requested a review from harrytran998 as a code owner May 7, 2024 00:23
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 1f30790 and f21c49c.
Files selected for processing (8)
  • .github/CODEOWNERS (1 hunks)
  • .github/workflows/ci.mobile.yml (3 hunks)
  • .moon/hooks/commit-msg.sh (1 hunks)
  • .moon/hooks/pre-commit.sh (1 hunks)
  • .moon/hooks/pre-push.sh (1 hunks)
  • .moon/hooks/prepare-commit-msg.sh (1 hunks)
  • .moon/tasks/dart.yml (1 hunks)
  • apps/mobile/moon.yml (1 hunks)
Files skipped from review due to trivial changes (7)
  • .github/CODEOWNERS
  • .moon/hooks/commit-msg.sh
  • .moon/hooks/pre-commit.sh
  • .moon/hooks/pre-push.sh
  • .moon/hooks/prepare-commit-msg.sh
  • .moon/tasks/dart.yml
  • apps/mobile/moon.yml
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.mobile.yml

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 f21c49c and ed4e66f.
Files selected for processing (1)
  • .github/workflows/ci.mobile.yml (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.mobile.yml

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 ed4e66f and f77582b.
Files selected for processing (7)
  • .husky/pre-push (1 hunks)
  • .moon/tasks/dart.yml (1 hunks)
  • Makefile.toml (1 hunks)
  • scripts/generate.toml (1 hunks)
  • scripts/git.toml (1 hunks)
  • scripts/mobile.toml (1 hunks)
  • scripts/tool.toml (1 hunks)
Files skipped from review due to trivial changes (3)
  • .husky/pre-push
  • Makefile.toml
  • scripts/git.toml
Files skipped from review as they are similar to previous changes (1)
  • .moon/tasks/dart.yml
Additional comments not posted (10)
scripts/generate.toml (1)

1-5: The task definition for model generation is correctly set up and uses appropriate scripting conventions.

scripts/mobile.toml (4)

1-8: The pub_get task is well-defined, correctly navigating directories and managing dependencies.


10-16: The flutter-build-ios task is correctly set up for building iOS applications with necessary flags for debugging and obfuscation.


18-24: The flutter-build-android task is appropriately configured for building Android applications with detailed build options.


26-28: The flutter-build task effectively combines both iOS and Android build tasks for streamlined operations.

scripts/tool.toml (5)

1-5: The lint.ts.format task is correctly set up for TypeScript formatting using the biome tool.


7-11: Please verify the lint.ts.circular task's script, as it appears to be a duplicate of the format task. Ensure it performs the intended operation.


13-17: Please verify the lint.ts.typecheck task's script, as it appears to be a duplicate of the format task. Ensure it performs the intended operation.


19-23: Please verify the lint.ts.useless task's script, as it appears to be a duplicate of the format task. Ensure it performs the intended operation.


25-32: The lint.ts task effectively combines all TypeScript linting tasks for streamlined operations.

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

Out of diff range and nitpick comments (2)
apps/web/Dockerfile (2)

Line range hint 1-19: Optimize file copying by using a .dockerignore file.

Consider adding a .dockerignore file to exclude unnecessary files (like local development configs) from being copied into the Docker image. This can reduce build time and image size.


Line range hint 21-35: Clarify user and group creation in the Dockerfile.

The commands for creating a user and group are embedded in a single RUN instruction with multiple commands. For better readability and maintainability, consider splitting these into separate RUN instructions or adding comments to explain each step.

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between f77582b and 6eaae7c.
Files selected for processing (2)
  • apps/web/.dockerignore (1 hunks)
  • apps/web/Dockerfile (3 hunks)
Files skipped from review due to trivial changes (1)
  • apps/web/.dockerignore

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

Out of diff range and nitpick comments (2)
apps/mobile/README.md (2)

90-90: Remove the trailing space at the end of this line.


Line range hint 54-54: Improve sentence structure for clarity.

- Dependency Injection is a great design pattern that allows us to eliminate rigid dependencies between elements and it makes the application more flexible, easy to expand scales and maintain.
+ Dependency Injection is a great design pattern that eliminates rigid dependencies between elements, making the application more flexible, easy to expand, and maintain.

This change improves the readability and clarity of the sentence by using a comma to separate independent clauses.

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 6eaae7c and 15f36fe.
Files selected for processing (6)
  • .vscode/settings.json (2 hunks)
  • apps/mobile/README.md (1 hunks)
  • apps/mobile/moon.yml (1 hunks)
  • apps/mobile/packages/ddd_core/pubspec.yaml (2 hunks)
  • apps/mobile/packages/logger/pubspec.yaml (1 hunks)
  • apps/mobile/packages/ui/pubspec.yaml (1 hunks)
Files skipped from review due to trivial changes (3)
  • .vscode/settings.json
  • apps/mobile/packages/ddd_core/pubspec.yaml
  • apps/mobile/packages/ui/pubspec.yaml
Files skipped from review as they are similar to previous changes (2)
  • apps/mobile/moon.yml
  • apps/mobile/packages/logger/pubspec.yaml
Additional Context Used
LanguageTool (6)
apps/mobile/README.md (6)

Near line 17: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...(might want to change it later on) - We want to adhere to SOLID principles since we are...


Near line 18: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...we are using OOP for this project. - We want to ensure that UI layers do not care what ...


Near line 19: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...is going on at the data layer at all. - We might want to separate each layer into ...


Near line 54: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...nate rigid dependencies between elements and it makes the application more flexible,...


Near line 54: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...in injectable and get_it to implement DI and we have also defined classes so you can...


Near line 65: Did you mean “you're” (short for ‘you are’)?
Context: ...the generation of required files for 🚀 your onboarding! 8. Localization Using t...

Comment on lines +78 to +86
# A version manager for all your favorite languages and tools. A unified toolchain.
curl -fsSL https://moonrepo.dev/install/proto.sh | bash
proto install bun
proto install rust
proto plugin add buf "source:https://raw.githubusercontent.com/stk0vrfl0w/proto-toml-plugins/main/plugins/buf.toml"
proto install buf
proto plugin add moon "source:https://raw.githubusercontent.com/moonrepo/moon/master/proto-plugin.toml"
proto install moon
flutter pub get
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider handling potential errors in the installation script.

- curl -fsSL https://moonrepo.dev/install/proto.sh | bash
+ curl -fsSL https://moonrepo.dev/install/proto.sh | bash || { echo "Installation failed"; exit 1; }

This modification ensures that the script stops execution and provides a clear error message if the curl command fails.


Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
# A version manager for all your favorite languages and tools. A unified toolchain.
curl -fsSL https://moonrepo.dev/install/proto.sh | bash
proto install bun
proto install rust
proto plugin add buf "source:https://raw.githubusercontent.com/stk0vrfl0w/proto-toml-plugins/main/plugins/buf.toml"
proto install buf
proto plugin add moon "source:https://raw.githubusercontent.com/moonrepo/moon/master/proto-plugin.toml"
proto install moon
flutter pub get
# A version manager for all your favorite languages and tools. A unified toolchain.
curl -fsSL https://moonrepo.dev/install/proto.sh | bash || { echo "Installation failed"; exit 1; }
proto install bun
proto install rust
proto plugin add buf "source:https://raw.githubusercontent.com/stk0vrfl0w/proto-toml-plugins/main/plugins/buf.toml"
proto install buf
proto plugin add moon "source:https://raw.githubusercontent.com/moonrepo/moon/master/proto-plugin.toml"
proto install moon
flutter pub get

Comment on lines +70 to +73

##- How to run project


Copy link
Contributor

Choose a reason for hiding this comment

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

Correct formatting issues related to blank lines and headings.

- 70~
- 71~
+ 70~ ## How to run project
- 73~

This change corrects the heading format and reduces multiple consecutive blank lines to a single blank line, adhering to Markdown best practices.


Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
##- How to run project
## How to run project


```bash
moon run :test --query "language=dart" # Run test
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure the file ends with a single newline character.

+ 

This change ensures that the file adheres to the POSIX standard, which requires files to end with a newline.


Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
```

</details>
<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->

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 15f36fe and 2719253.
Files selected for processing (2)
  • .github/workflows/ci.mobile.yml (3 hunks)
  • .vscode/settings.json (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/ci.mobile.yml
  • .vscode/settings.json

@harrytran998 harrytran998 merged commit 6a0b02d into dev May 9, 2024
3 of 4 checks passed
@harrytran998 harrytran998 deleted the TML-12 branch May 9, 2024 11:16
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