Repository navigation
feat: update file metadata and relocate versioned S3 content - #154
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Preserve versioned content updates and reject metadata changes while content is updating. Adapt PUT file tests to active storage versions.
Merge current development and update Core Application and S3 packages.
…t updates and relocations
…e Application 6.5.1
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 636f36cd27
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |

0 New Issues
0 Fixed Issues
0 Accepted Issues
Adds
PUT /api/v1/files/{id}for replacing name, type, owner and folder together. Both the current and requested scope require update permission; personal files require an owner, avatars forbid one. Null or omitted optional fields clear their values.When type or owner changes, the requested metadata and
Relocatingstatus are saved with one sharedOperationAttemptId. Downloads and access checks use the new metadata immediately, whileStorageKeyandVersionIdretain the previous active content until an exact-version S3 copy is verified. The destination key is derived from the current type, owner and unchanged file ID. No separate relocation fields or JSON state are stored. The database migration renames the existingcontent_update_attempt_idcolumn tooperation_attempt_id.The existing reconciliation worker resumes interrupted copies using
operation-attempt-idmetadata. Mutations are blocked during relocation. Storage failures during relocation discovery, copying and verification are logged per file and returned as failures so reconciliation continues with other files. Cancellation and errors during transactional completion still propagate. Folder placement is validated under the hierarchy lock before saving the requested metadata; deleted-folder reconciliation handles a destination deleted while copying. Cleanup of the retired key is scheduled in the same transaction as completion with its former active version as a boundary, delayed according toFileManager:Relocation:CleanupDelay(seven days by default) to cover existing download URLs. The handler buffers the ordered version listing before deleting, preserves newer and active content, removes older versions, and deletes the boundary last. A missing boundary is a no-op; listing and deletion failures propagate for retries. Cleanup always deletes explicit version IDs.Pending uploads and files above the current 5 GiB single-copy limit cannot change scope. Name and folder changes do not copy S3 content. Content type, size and active storage version remain storage-managed.
Uses Core Application 6.5.1 and S3 1.4.1. Content updates and copies share
FileOperationAttemptId, the aggregate'sOperationAttemptIdproperty, andFileMetadataNames.OperationAttemptId. No legacy-marker fallback is needed under the agreed assumption that there are no existing files.FileStorageVersionService.FindAsyncshares current and historical version lookup between relocation and content-update recovery; each caller supplies its existing acceptance policy. Storage key construction is encapsulated inFileStorageKey.FileRelocationOptionsis a plain Application class with a section name and seven-day default. Infrastructure binds it, registers the typed instance and validates positive cleanup delays at startup throughFileRelocationOptionsValidator; Application adds no configuration or options package references. The architecture convention now permits Application options with a registered validator in the same module's InfrastructureOptions/<Name>/directory, while preserving the existing placement and startup-validation checks for Infrastructure options.Validation: all CI checks pass, including formatting, architecture tests and Helm checks. FileManager: 885 unit, 172 integration and 551 functional tests. PostgreSQL coverage verifies persisted requested metadata, the shared operation marker and the active-version switch; real-S3 coverage verifies recovery after a lost copy response, downloads during relocation and eventual cleanup after target-folder deletion. S3 integration coverage also verifies bounded history cleanup, preservation of a newer active version, and chronological pagination with delete markers and a new upload between pages on the CI SeaweedFS backend. SonarQube reports 0 new issues, 97.8% new-code coverage and 0% new-code duplication.