mapbox / mapbox/tilesets-cli

wildcard in tileset delete

Open
#90 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
141
Forks
27
PR merge metrics
No merged PRs in 30d

Description

I've got a few hundred tilesets to manage, is there a potential for wildcard of tileset ids?

For example, delete any tilesets with "projected" in their id name:

(Zooniverse) MacBook-Pro:Zooniverse ben$ tilesets delete *projected*
To confirm tileset deletion please enter the full tileset id "*projected*": *projected*
Traceback (most recent call last):
  File "/Users/ben/miniconda3/envs/Zooniverse/bin/tilesets", line 8, in <module>
    sys.exit(cli())
  File "/Users/ben/miniconda3/envs/Zooniverse/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/ben/miniconda3/envs/Zooniverse/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/ben/miniconda3/envs/Zooniverse/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/ben/miniconda3/envs/Zooniverse/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/ben/miniconda3/envs/Zooniverse/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/ben/miniconda3/envs/Zooniverse/lib/python3.7/site-packages/mapbox_tilesets/scripts/cli.py", line 220, in delete
    raise errors.TilesetsError(r.text)
mapbox_tilesets.errors.TilesetsError: {"message":"Not Found"}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the tilesets delete command in mapbox_tilesets/scripts/cli.py, especially the delete function near line 220, and reproduce the wildcard example from the issue. Trace how the command validates and sends the tileset ID; done means a wildcard such as projected can identify matching tilesets and handle deletion safely.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.