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: moon check single package(and it's deps) #416

Merged
merged 5 commits into from
Oct 28, 2024
Merged

Conversation

Young-Flash
Copy link
Collaborator

No description provided.

Copy link

peter-jerry-ye-code-review bot commented Oct 23, 2024

Identified Issues and Suggestions

  1. Potential Bug: Unused Variable check_opt in run_check_internal

    • In the run_check_internal function, the check_opt variable is assigned but never used directly within the function. This could indicate that the intended functionality related to check_opt is not being executed or tested.
    • Suggestion: Ensure that all options specified in CheckOpt are being utilized appropriately within the function. This might involve adding logic to handle the package_path, patch_file, and no_mi options effectively.
  2. Potential Bug: Incorrect Error Message in debug_flag_test

    • The error message displayed in the debug_flag_test function seems to incorrectly indicate the usage of the check command. The message suggests that the command is moon check --release but the actual usage should be moon check --release [PACKAGE_PATH] as per the updated command structure.
    • Suggestion: Update the expected error message in the test to correctly reflect the current usage of the check command, including the optional PACKAGE_PATH argument.
  3. Documentation Update: Command Usage for moon check

    • The documentation for the moon check command in both English (docs/manual/src/commands.md) and Chinese (docs/manual-zh/src/commands.md) versions should be updated to include the new PACKAGE_PATH argument and the associated options (--patch-file and --no-mi).
    • Suggestion: Update the usage section of the moon check command to include the PACKAGE_PATH argument and clearly describe the conditions under which --patch-file and --no-mi options are valid.

Additional Observations

  • Code Duplication: There is noticeable duplication in the handling of patch_file and no_mi options across different functions (pkg_to_check_item, pkg_with_wbtest_to_check_item, pkg_with_test_to_check_item). This could be refactored to reduce redundancy.
  • Incomplete Implementation: The functionality to filter packages based on package_path in gen_check seems partially implemented. The logic to handle patch_file and no_mi options for specific packages needs to be thoroughly tested and possibly refined.

Conclusion

The provided diff shows several additions and modifications related to enhancing the check command functionality, particularly around specifying packages for checking and handling patch files. However, there are areas where the implementation and documentation need to be aligned to ensure that the new features are fully functional and clearly understood by users. Addressing the identified issues and suggestions will help in improving the robustness and clarity of the code and documentation.

@Young-Flash Young-Flash requested a review from lijunchen October 23, 2024 09:51
@Young-Flash Young-Flash force-pushed the check_patch branch 2 times, most recently from 1d78674 to 2f4976e Compare October 24, 2024 07:01
crates/moon/src/cli/check.rs Show resolved Hide resolved
crates/moonbuild/src/gen/gen_check.rs Outdated Show resolved Hide resolved
crates/moonbuild/src/gen/gen_check.rs Outdated Show resolved Hide resolved
crates/moonbuild/src/gen/gen_check.rs Outdated Show resolved Hide resolved
@Young-Flash Young-Flash merged commit 2c58176 into main Oct 28, 2024
10 of 14 checks passed
@Young-Flash Young-Flash deleted the check_patch branch October 28, 2024 06:32
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