Revanth14 opened a new pull request, #1169: URL: https://github.com/apache/iceberg-go/pull/1169
Fixes #1165. ## Summary - Add `iceberg branch delete <table-id> <branch-name> [--yes]`. - Add `iceberg tag delete <table-id> <tag-name> [--yes]`. - Reject deletion of the `main` branch before any catalog commit, so the table can't be left headless (`RemoveSnapshotRef` clears `currentSnapshotID` for `main`). - Validate that the requested ref exists and matches the expected ref type (`branch delete` refuses a tag, `tag delete` refuses a branch). - Commit a `RemoveSnapshotRef` update guarded by `AssertTableUUID` + `AssertRefSnapshotID(ref, observedSnapshot)`. Pinning the observed snapshot is intentional: a concurrent move/delete of the ref between load and commit fails the requirement instead of silently removing a different ref state. - Add structured delete output (`RefDeletedResult`) for both text and JSON modes, so `--output json` keeps working. ## Implementation notes - The delete handlers mirror the existing `branch create` / `tag create` paths in `cmd/iceberg/branch_tag.go`, sharing `loadTable`, `confirmAction`, and the `Output` interface. - The shared `osExit` test hook moved from `upgrade_rollback.go` into a dedicated `cmd/iceberg/exit.go`, and the create handlers were migrated onto it so the whole file uses one exit convention and the error paths are testable. ## Testing - `env GOCACHE=/private/tmp/iceberg-go-gocache go test ./cmd/iceberg -count=1` - `env GOCACHE=/private/tmp/iceberg-go-gocache go vet ./cmd/iceberg` - `gofmt -l cmd/iceberg` - `git diff --check` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
