feat(packages): add delete command
Description
Adds glab packages delete (alias rm): deletes a package by numeric ID, with
a confirmation prompt that can be skipped with -y for scripts.
Related Issues
Related to #7421 (closed)
How has this been tested?
Automated:
go test ./internal/commands/packages/delete/...golangci-lint run ./internal/commands/packages/...— 0 issues
Manual (using a package created in !3394 (merged)):
- Build the branch:
make build ./bin/glab packages list -R group/project --jq '.[] | "\(.id) \(.name) \(.version)"'— find the numeric ID of a package to delete../bin/glab packages delete <id> -R group/project— prompts for confirmation; answering no cancels without deleting.- Run it again and confirm — the package is deleted;
glab packages listno longer shows it. ./bin/glab packages rm <id> -y -R group/project— thermalias with-ydeletes without prompting../bin/glab packages delete not-a-number -R group/project— fails with "package ID must be an integer"../bin/glab packages delete <id> -R group/project < /dev/null— non-interactive without-yfails asking for the-yflag.
Edited by Oscar Tovar