-
Notifications
You must be signed in to change notification settings - Fork 10
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
build: Do not create archive twice when create bundle #1120
Conversation
Instead of double archive cretion, just make copy with simpler name
🧙 Sourcery has finished reviewing your pull request! Tips
|
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.
We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.
WalkthroughThe Changes
Sequence DiagramsequenceDiagram
participant User
participant Script
participant OS
User ->> Script: Call archive_build(working_dir, dir_name)
Script ->> Script: Call get_file_path(working_dir)
Script -->> OS: Retrieve file path
OS -->> Script: Return file path
Script ->> Script: Create archive with file path
Script -->> User: Return created archive
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- build_utils/create_and_pack_executable.py (3 hunks)
Additional comments not posted (3)
build_utils/create_and_pack_executable.py (3)
20-32
: Functionget_file_path
looks good.The function correctly generates the file path based on platform and version information.
35-43
: Functioncreate_archive
looks good.The function correctly creates the archive file, handling both zip and tar.gz formats.
67-78
: Functionarchive_build
looks good.The function correctly creates the archive and copies it with a simpler name. The use of
tqdm
for progress indication is a good addition.
Quality Gate passedIssues Measures |
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)
- build_utils/create_and_pack_executable.py (3 hunks)
Additional comments not posted (3)
build_utils/create_and_pack_executable.py (3)
67-78
: LGTM! But verify the function usage in the codebase.The logic in
archive_build
correctly handles the archiving process and the creation of a copy with a simpler name.However, ensure that all function calls to
archive_build
match the new signature.Verification successful
Verified: Function usage is correct.
The function
archive_build
is only called once in the codebase, and it matches the new signature.
build_utils/create_and_pack_executable.py: archive_build(args.working_dir, dir_name)
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `archive_build` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type python $'archive_build'Length of output: 63
Script:
#!/bin/bash # Description: Verify all function calls to `archive_build` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type py $'archive_build'Length of output: 200
35-42
: LGTM! But verify the function usage in the codebase.The logic in
create_archive
correctly handles the creation of zip and tar.gz archives.However, ensure that all function calls to
create_archive
match the new signature.Verification successful
The function
create_archive
is used correctly withinbuild_utils/create_and_pack_executable.py
.
- The function call
create_archive(working_dir)
matches the new signature.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `create_archive` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type python $'create_archive'Length of output: 64
Script:
#!/bin/bash # Description: Verify all function calls to `create_archive` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg 'create_archive\(' --glob '*.py'Length of output: 205
20-32
: LGTM! But verify the function usage in the codebase.The logic in
get_file_path
correctly handles platform-specific naming and versioning.However, ensure that all function calls to
get_file_path
match the new signature.Verification successful
Verified!
The function
get_file_path
is called correctly with theworking_dir
argument and optionally with thewith_version
argument.
build_utils/create_and_pack_executable.py: line 21
:file_path = get_file_path(working_dir)
build_utils/create_and_pack_executable.py: line 23
:shutil.copy(get_file_path(working_dir), get_file_path(working_dir, with_version=False))
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `get_file_path` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type python $'get_file_path'Length of output: 63
Script:
#!/bin/bash # Description: Verify all function calls to `get_file_path` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type py 'get_file_path'Length of output: 340
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1120 +/- ##
========================================
Coverage 92.91% 92.91%
========================================
Files 205 205
Lines 32519 32519
========================================
Hits 30215 30215
Misses 2304 2304 ☔ View full report in Codecov by Sentry. |
Instead of double archive cretion, just make copy with simpler name
Summary by CodeRabbit
New Features
Refactor