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

Unable to delete package with empty suffix #3882

Open
theJasonFan opened this issue Feb 14, 2024 · 0 comments
Open

Unable to delete package with empty suffix #3882

theJasonFan opened this issue Feb 14, 2024 · 0 comments

Comments

@theJasonFan
Copy link

Bug report

I was able to create a package with an empty suffix with nf-quilt but python API did not allow me to delete it. Using the python API I am able to find the package with an empty suffix in the list but am unable to remove it with delete_package

Expected Behavior

Either a package with an empty suffix should never be allowed, anywhere. Or that package_delete or upstream validation of package names allow for empty suffixes (when appropriate). I can appreciate how this can also be a dangerous path to go down as one would not want to delete an entire S3 bucket / quilt registry.

Logs from Python REPL

>>> import quilt3
>>> quilt3.list_packages("s3://registry-name")
<generator object S3PackageRegistryV1.list_packages at 0x1072b2d40>
>>> list(quilt3.list_packages("s3://registry-name"))
['ont', 'ont/test', 'ont/test0']
>>> quilt3.delete_package("ont", "s3://registry-name")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jf/.miniforge-arm64/envs/nf-sandbox/lib/python3.12/site-packages/quilt3/telemetry.py", line 135, in decorated
    results = func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jf/.miniforge-arm64/envs/nf-sandbox/lib/python3.12/site-packages/quilt3/api.py", line 46, in delete_package
    validate_package_name(name)
  File "/Users/jf/.miniforge-arm64/envs/nf-sandbox/lib/python3.12/site-packages/quilt3/util.py", line 367, in validate_package_name
    raise QuiltException(f"Invalid package name: {name}.")
quilt3.util.QuiltException: Invalid package name: ont.
>>> quilt3.delete_package("ont/", "s3://tome-fulcrum-quilt")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jf/.miniforge-arm64/envs/nf-sandbox/lib/python3.12/site-packages/quilt3/telemetry.py", line 135, in decorated
    results = func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jf/.miniforge-arm64/envs/nf-sandbox/lib/python3.12/site-packages/quilt3/api.py", line 46, in delete_package
    validate_package_name(name)
  File "/Users/jf/.miniforge-arm64/envs/nf-sandbox/lib/python3.12/site-packages/quilt3/util.py", line 367, in validate_package_name
    raise QuiltException(f"Invalid package name: {name}.")
quilt3.util.QuiltException: Invalid package name: ont/.
>>> quilt3.delete_package("ont/", "s3://tome-fulcrum-quilt")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jf/.miniforge-arm64/envs/nf-sandbox/lib/python3.12/site-packages/quilt3/telemetry.py", line 135, in decorated
    results = func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jf/.miniforge-arm64/envs/nf-sandbox/lib/python3.12/site-packages/quilt3/api.py", line 46, in delete_package
    validate_package_name(name)
  File "/Users/jf/.miniforge-arm64/envs/nf-sandbox/lib/python3.12/site-packages/quilt3/util.py", line 367, in validate_package_name
    raise QuiltException(f"Invalid package name: {name}.")
quilt3.util.QuiltException: Invalid package name: ont/.

Thanks!

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

No branches or pull requests

1 participant