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

added package fam removal func, and tests #1252

Merged
merged 3 commits into from
Mar 22, 2022
Merged

Conversation

nerdvegas
Copy link
Contributor

fixes #1248

Copy link
Contributor

@maxnbk maxnbk left a comment

Choose a reason for hiding this comment

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

some notes

src/rez/cli/rm.py Outdated Show resolved Hide resolved
"-f", "--family",
help="remove the entire specified package family (eg 'python'). This "
"is only supported if the family is empty, or all its packages are "
"hidden")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we ought to avoid archiving a family if it contains any packages, including hidden packages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed, updating

from rez.package_remove import remove_package_family

if opts.dry_run:
parser.error("--dry-run is not supported with --family")
Copy link
Contributor

Choose a reason for hiding this comment

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

dry run could probably at least tell you if it would allow proceeding with an archival if it weren't a dry run?

@JeanChristopheMorinPerso
Copy link
Member

Have you considered a --recursive flag to make it easier to just purge an entire family? If yes, I'd be curious to know the reasoning for not including something like (apart fro the obvious that it is a dangerous operation).

@nerdvegas
Copy link
Contributor Author

Have you considered a --recursive flag to make it easier to just purge an entire family? If yes, I'd be curious to know the reasoning for not including something like (apart fro the obvious that it is a dangerous operation).

That's it, it's a dangerous op. I figured it's better to make the user do that themselves, than accidentally delete a whole fam.

@JeanChristopheMorinPerso
Copy link
Member

And what about a --force flag to mimic the Unix rm -r command? By default fail if not empty, but if -f is provided, then go ahead even if not empty.

@nerdvegas
Copy link
Contributor Author

And what about a --force flag to mimic the Unix rm -r command? By default fail if not empty, but if -f is provided, then go ahead even if not empty.

Still dangerous but --force makes more sense than --recurse and implies the danger. Yeah I'll add this.

-added force option
-only allow rm of truly empty packages when force=false
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@instinct-vfx instinct-vfx left a comment

Choose a reason for hiding this comment

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

I will have good use for this. Agreeing with the proposed and accepted changes.

@nerdvegas nerdvegas merged commit 90b6327 into master Mar 22, 2022
@bpabel bpabel deleted the feature/1248-rm_pkg_fam branch January 19, 2023 20:35
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.

add ability to delete package family
4 participants