feat: add Iceberg table tag management UI and API#4164
feat: add Iceberg table tag management UI and API#4164fightBoxing wants to merge 4 commits intoapache:masterfrom
Conversation
|
@fightBoxing Thank you for your contribution. You need to trigger CI after rebasing the branch to proceed to the review stage. |
- Backend: Add createTag/deleteTag API endpoints in TableController - Backend: Add createTag/deleteTag interface in FormatTableDescriptor - Backend: Implement tag operations in MixedAndIcebergTableDescriptor using Iceberg TableOperations - Backend: Add unsupported exception for Paimon in PaimonTableDescriptor - Backend: Register /tags routes in DashboardServer - Backend: Add createTag/deleteTag methods in ServerTableDescriptor - Backend: Use CreateTagRequest DTO instead of raw Map for type safety - Frontend: Add Create Tag dialog with tag name and snapshot ID inputs in Selector.vue - Frontend: Add Delete Tag confirmation dialog in Selector.vue - Frontend: Add createTag/deleteTag API calls in table.service.ts - Frontend: Add i18n translations for tag operations in en.ts and zh.ts
3b680f9 to
07a2317
Compare
Thanks, I updated my PR again. |
| TableMetadata updated = builder.build(); | ||
| ops.commit(base, updated); | ||
| } | ||
| AmoroTable<?> amoroTable, String type, ProcessStatus status, int limit, int offset) { |
There was a problem hiding this comment.
[P0] Broken method signature causes compilation failure.\n\nReason summary: right after deleteTag, the method declaration for getOptimizingProcessesInfo(...) is missing, so this file becomes syntactically invalid (; expected) and amoro-ams cannot build.\n\nSuggested fix: restore the full method signature (@Override, return type, method name, params) and rerun ./mvnw -pl amoro-ams -am -DskipTests -Pskip-dashboard-build compile to verify.
| Preconditions.checkNotNull( | ||
| base.snapshot(snapshotId), "Snapshot %s not found in table", snapshotId); | ||
|
|
||
| TableMetadata.Builder builder = TableMetadata.buildFrom(base); |
There was a problem hiding this comment.
[P1] createTag currently uses setRef without guarding name conflicts.\n\nReason summary: builder.setRef(tagName, ...) can overwrite an existing ref with the same name, which is riskier than Iceberg createTag semantics (create-only, fail on existing ref).\n\nSuggested fix: add a pre-check such as Preconditions.checkArgument(base.ref(tagName) == null, ...) before setting the ref, or switch to an Iceberg create-tag path that enforces non-overwrite behavior.
| } | ||
|
|
||
| // Open the Create Tag modal | ||
| function openCreateTagModal(e: MouseEvent) { |
There was a problem hiding this comment.
[P1] The Create Tag flow is currently unreachable from UI.\n\nReason summary: openCreateTagModal is defined, but there is no template trigger bound to it, so users cannot actually open the modal and call the new create-tag API.\n\nSuggested fix: add a visible trigger (for example in the Tags tab/footer action area) and bind it to openCreateTagModal.
| * | ||
| * @param ctx - context for handling the request and response | ||
| */ | ||
| public void createTag(Context ctx) { |
There was a problem hiding this comment.
[P2] Missing test coverage for the new tag management API/flow.\n\nReason summary: this PR adds POST/DELETE tags, descriptor logic, and UI changes, but there are no accompanying tests in backend or frontend for success/error paths.\n\nSuggested fix: add at least controller/descriptor tests (create success, duplicate name, invalid snapshot, delete missing tag) and UI interaction tests (entry visibility, create/delete success/failure feedback).
|
[P0] |
- [P0] Restore missing getOptimizingProcessesInfo method signature in MixedAndIcebergTableDescriptor that was accidentally dropped after deleteTag method, causing compilation failure in amoro-ams module - [P0] Implement createTag/deleteTag in HudiTableDescriptor to satisfy the FormatTableDescriptor interface contract; Hudi does not support tag management so both methods throw UnsupportedOperationException with a clear message
- [P1] Guard createTag against name conflicts in MixedAndIcebergTableDescriptor. Previously builder.setRef(tagName, ...) would silently overwrite an existing tag or branch with the same name. Add a Preconditions.checkArgument on base.ref(tagName) == null to match Iceberg createTag create-only semantics. - [P1] Bind a visible Create Tag trigger in Selector.vue. openCreateTagModal was defined but had no template trigger, so users could not open the modal. Add a '+ Create Tag' link button at the bottom of the Tags tab-pane (using the pre-defined .create-tag-btn-wrapper style), wired to openCreateTagModal.


Summary
createTaganddeleteTagAPI endpoints for Iceberg tables (POST/DELETE /ams/v1/tables/catalogs/{catalog}/dbs/{db}/tables/{table}/tags)MixedAndIcebergTableDescriptorusing IcebergTableMetadataAPICreateTagRequestDTO inTableControllerto replace unsafeMap<String, Object>deserializationcreateTag/deleteTagservice functions in frontendtable.service.tsSelector.vuewith snapshot ID and optional max-ref-age inputsFormatTableDescriptorinterface andServerTableDescriptorwith tag management methodsTest Plan