Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`tag list | suggest | approve | reject` and `--tag` on product create/edit

Aperta
#68 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
cli

Direzione di ricerca

Start by reading the CLI command structure and the existing product create, edit, list, and view implementations, then check how they handle RFC 9457 errors and --json. Implement the tag commands and product tag options against the specified endpoints, following their response and permission behavior. Add a CLI path to docs/using-source/create-a-data-product.md; done means the commands, options, and documentation cover the behaviors in this issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Pick, suggest and review the tags products carry.

Depends on source-cooperative/source.coop#648 for the /tags endpoints. Setting a product's tags already works: source-cooperative/source.coop#647 added tags to POST /products/{account_id} and PATCH /products/{account_id}/{product_id}.

tag commands

  • tag list answers GET /tags: the approved tags, the list product list --tags filters on. Anyone may run it, signed in or not.
  • tag list --pending answers GET /tags?pending=true: the tags awaiting review, with who suggested each and when. Only admins may list them.
  • tag suggest <tag> answers POST /tags with { "tag_id": "<tag>" }. The API trims and lowercases the tag, so print the tag it answers, not the one typed. A 201 means the tag was added and awaits review; a 200 means it already existed, which is not an error. A retry is therefore always safe.
  • tag approve <tag> answers PATCH /tags/{tag_id} with { "pending": false }. Admins only.
  • tag reject <tag> answers DELETE /tags/{tag_id}, which takes the tag off every product carrying it. tag reject <tag> --replace-with <approved-tag> (or tag merge <tag> <approved-tag>) passes ?replace_with=, which puts the approved tag in its place instead. Admins only. Both answer 409 for a tag that has already been approved, so they never strip an approved tag from products.

URL-encode the tag in the path: tags may hold spaces (sea%20ice).

Tags on products

  • product create --tag <tag>, repeatable, sends tags as a list.
  • product edit --tag <tag> (repeatable) replaces the product's tags with exactly those given; product edit --clear-tags sends "tags": []. Leaving both out sends no tags, which keeps the product's tags as they are. If --add-tag/--remove-tag read better, they can compute the new list from product view's, since the API only replaces the whole list.
  • A tag outside the approved list is refused with a 400 problem that names the unknown tags; print it and point at tag suggest. A tag the product already carries is accepted even if it has since left the list.

Tags awaiting review show only to people who may edit the product, so product view shows them to the product's editors and to no one else.

As the epic says, the CLI validates nothing itself: it sends the request and shows the API's error. Errors are now RFC 9457 problems (source-cooperative/source-coop-cli#67), so a 400 lists each field's problem under errors. --json and the shared conveniences from #28 apply to tag list. Add a CLI path to the "Tags" part of docs.source.coop docs/using-source/create-a-data-product.md once these ship.

Lingua principale
Rust
Stelle
2
Fork
0
Merge medio
1g 9h
PR unite (30g)
22

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di source-cooperative/source-coop-cli

Tutte le issue di source-cooperative/source-coop-cli

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.