Skip to content

feat: add missing database operation kinds to filter#3860

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/add-compaction-database-operation
Draft

feat: add missing database operation kinds to filter#3860
Copilot wants to merge 5 commits intomainfrom
copilot/add-compaction-database-operation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 29, 2026

The Operations list supports filtering by kind, but several kinds exposed by the YDB API (e.g. /operation/list?kind=compaction) were missing from the UI, leaving those operations unviewable. This PR adds all kinds enumerated in ydb#39161 that were previously absent, along with the corresponding metadata interfaces from the YDB protobufs.

Type layer (src/types/api/operations.ts)

  • Extend OperationKind union with 'compaction', 'export', 'export/nfs', 'import/nfs', 'incbackup', and 'restore'
  • Add new entries to OPERATION_METADATA_TYPE_URLS:
    • Compacttype.googleapis.com/Ydb.Table.CompactMetadata
    • ImportFromFstype.googleapis.com/Ydb.Import.ImportFromFsMetadata
    • ExportToFstype.googleapis.com/Ydb.Export.ExportToFsMetadata
    • IncrementalBackuptype.googleapis.com/Ydb.Backup.IncrementalBackupMetadata
    • Restoretype.googleapis.com/Ydb.Backup.RestoreMetadata
  • Add metadata interfaces sourced from the YDB protos and include them in TOperationMetadata:
    • CompactMetadata (path, cascade, state, numeric progress, shards_done/total, max_shards_in_flight)
    • ImportFromFsMetadata / ExportToFsMetadata — settings with base_path + items[], plus progress enum and items_progress[] (analogous to the S3/YT variants)
    • IncrementalBackupMetadata / RestoreMetadataprogress (BackupProgress enum) and numeric progress_percent (0–100)
  • Add BackupProgress enum mirroring Ydb.Backup.BackupProgress

Operations UI (src/containers/Operations/)

  • Register all new kinds in OPERATION_KINDS, the useOperationsQueryParams Zod enum, and i18n (kind_compaction, kind_export, kind_export_nfs, kind_import_nfs, kind_incbackup rendered as "Incremental Backup", kind_restore)
  • Add type guards: isCompactMetadata, isImportFromFsMetadata, isExportToFsMetadata, isIncrementalBackupMetadata, isRestoreMetadata
  • isImportExportMetadata now also covers the FS variants, so the existing items_progress-based percentage calculation applies to import/nfs and export/nfs
  • getOperationProgress:
    • Formats numeric progress for compaction (folded into the existing buildindex branch since the shape matches)
    • Formats numeric progress_percent for incbackup / restore, falling back to the BackupProgress enum via the existing i18n keys
  • Render the state column for compaction alongside buildindex
// utils.ts — shared numeric-progress branch
if (isIndexBuildMetadata(metadata) || isCompactMetadata(metadata)) {
    if (typeof metadata.progress === 'number') {
        return `${Math.round(metadata.progress)}%`;
    }
}

// utils.ts — incbackup / restore
if (isIncrementalBackupMetadata(metadata) || isRestoreMetadata(metadata)) {
    if (typeof metadata.progress_percent === 'number') {
        return `${Math.round(metadata.progress_percent)}%`;
    }
    // ...fallback to BackupProgress enum via i18n
}

Copilot AI changed the title [WIP] Add compaction to the list of possible database operations Add "compaction" to database operations kind filter Apr 29, 2026
Copilot AI requested a review from adameat April 29, 2026 11:45
@adameat
Copy link
Copy Markdown
Member

adameat commented Apr 29, 2026

@copilot actually, consult with this PR: ydb-platform/ydb#39161 and add all missing pieces (not just compaction). btw, "incbackup" means "Incremental Backup".

@adameat
Copy link
Copy Markdown
Member

adameat commented Apr 29, 2026

@copilot and name the PR properly - according to commitlint

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 29, 2026

@copilot actually, consult with this PR: ydb-platform/ydb#39161 and add all missing pieces (not just compaction). btw, "incbackup" means "Incremental Backup".

Added the remaining kinds from ydb#39161: export, export/nfs, import/nfs, incbackup (Incremental Backup), and restore — to the OperationKind type, the dropdown, the URL Zod schema, and i18n. See ce61d01.

Copilot AI changed the title Add "compaction" to database operations kind filter Add missing database operation kinds (compaction, export, export/nfs, import/nfs, incbackup, restore) Apr 29, 2026
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 29, 2026

@copilot and name the PR properly - according to commitlint

I don't have permissions to rename the PR title from here. Could you rename it to something like feat: add missing database operation kinds to filter (conventional commit, lowercase, 52 chars)? Happy to use a different wording if you prefer.

@adameat adameat changed the title Add missing database operation kinds (compaction, export, export/nfs, import/nfs, incbackup, restore) feat: add missing database operation kinds to filter Apr 29, 2026
@adameat
Copy link
Copy Markdown
Member

adameat commented Apr 29, 2026

@copilot look for other metadata descriptions for new operation types in protobufs here: https://github.com/ydb-platform/ydb/tree/main/ydb/public/api/protos
add metadata if neccessary.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 29, 2026

@copilot look for other metadata descriptions for new operation types in protobufs here: https://github.com/ydb-platform/ydb/tree/main/ydb/public/api/protos
add metadata if neccessa...

Added metadata interfaces for the remaining new kinds in e7aa073, sourced from the YDB protos:

  • ImportFromFsMetadata (Ydb.Import.ImportFromFsMetadata) for import/nfs
  • ExportToFsMetadata (Ydb.Export.ExportToFsMetadata) for export/nfs
  • IncrementalBackupMetadata (Ydb.Backup.IncrementalBackupMetadata) for incbackup
  • RestoreMetadata (Ydb.Backup.RestoreMetadata) for restore

FS variants reuse the items_progress-based percentage logic alongside the S3/YT cases. incbackup/restore render the numeric progress_percent (0–100), falling back to the BackupProgress enum via the existing i18n keys.

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.

add "compaction" to the list of possible database operations

2 participants