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

Recursive download flag/general improvements in handling downloads #403

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ammernico
Copy link
Collaborator

No description provided.

Copy link
Member

@primeos-work primeos-work left a comment

Choose a reason for hiding this comment

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

I reviewed this commit by commit so the comments might be a bit irritating since you've switched to another approach in a later commit.

Nitpick regarding the "Move XYZ into a own function" commit messages: I'd use "dedicated function" instead.

TODO: I still have to review the last commit.

src/commands/source/download.rs Outdated Show resolved Hide resolved
src/commands/source/download.rs Outdated Show resolved Hide resolved
src/commands/source/download.rs Outdated Show resolved Hide resolved
src/commands/source/download.rs Outdated Show resolved Hide resolved
src/commands/source/download.rs Show resolved Hide resolved
src/commands/source/download.rs Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
Cargo.lock Outdated Show resolved Hide resolved
src/commands/source/download.rs Outdated Show resolved Hide resolved
@ammernico ammernico marked this pull request as draft August 27, 2024 14:09
@ammernico ammernico marked this pull request as ready for review September 4, 2024 17:03
I found the show_message a bit misleading since indicatif has the same
method name for setting a real message. The method on the wrapper was
just showing the progress.

https://docs.rs/indicatif/0.17.8/indicatif/struct.ProgressBar.html#method.set_message

Signed-off-by: Nico Steinle <[email protected]>
Refactor source download logic into a separate function for better
code organization.

Signed-off-by: Nico Steinle <[email protected]>
This refactor improves the maintainability and clarity of the
download function.

Signed-off-by: Nico Steinle <[email protected]>
- Track and display download results in an ASCII table

- Make `source already exists` not an error, just a result type

- Introduced a `--recursive` flag to the `download` subcommand to
  enable downloading of both the main packages and all their
  dependencies.

- Added `--image` and `--env` options to specify the Docker image
  and environment variables, ensuring the correct dependency tree
  is resolved based on the build environment. Took this approach
  from the tree-of command.

- Used a `HashSet` to avoid duplicate processing of packages and
  their dependencies.

- Only check sources where the download was successful, skipped or
  forced. Use the `verify_impl` to verify the sources. Calling
  `super::verify` wasn't ideal since it could break on different CLI
  arguments.

This update improves clarity and tracking of the download outcomes
and allows for more comprehensive package management by
ensuring that all necessary dependencies are downloaded alongside
the requested packages.

Signed-off-by: Nico Steinle <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prerelease PRs which are merged to staging branch but not in main/master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants