Skip to content

fix(cli): validate branch and tag retention inputs#1399

Open
fallintoplace wants to merge 2 commits into
apache:mainfrom
fallintoplace:fix/cli-branch-tag-retention-validation
Open

fix(cli): validate branch and tag retention inputs#1399
fallintoplace wants to merge 2 commits into
apache:mainfrom
fallintoplace:fix/cli-branch-tag-retention-validation

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Why

The branch/tag create commands previously accepted invalid ref names and non-positive retention values. Those inputs could create metadata updates that should have been rejected up front.

What Changed

  • Reject invalid branch/tag names before updates are built, preventing malformed refs (empty names, whitespace-wrapped names, path separators, ./.., control characters).
  • Reject non-positive retention settings (--max-ref-age, --max-snapshot-age, --min-snapshots-to-keep) so invalid policies are not persisted.
  • Add regression coverage for both branch and tag validation paths.

Testing

go test ./cmd/iceberg -run 'TestRunBranchCreateRejectsNegativeRetentionValues|TestRunBranchCreateRejectsInvalidRefName|TestRunTagCreateRejectsNegativeMaxRefAge|TestRunTagCreateRejectsInvalidRefName' -count=1

@fallintoplace fallintoplace requested a review from zeroshade as a code owner July 4, 2026 23:37
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

Successfully merging this pull request may close these issues.

1 participant