feat(saas-migration): persist export/backup result via EntityFileStorage#75
Merged
Merged
Conversation
The export/backup ZIP is now uploaded to EntityFileService (local/S3/Buckie) only after the pipeline finishes successfully, instead of being kept as a raw file on local/container disk. The local working copy is deleted right after, and a job never reports COMPLETED without a durable, downloadable result. AccountMigrationJob.resultPath (raw filesystem path) is replaced by resultFile (EntityFile reference), and the download endpoint streams via StoredEntityFile instead of FileSystemResource. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AccountMigrationProperties.outputDirectory), but is only uploaded toEntityFileService/EntityFileStorage(local safe dir, S3, Buckie, …) after the pipeline finishes successfully — the local copy is deleted right after, win or lose.COMPLETEDwithout a persisted, downloadable result: if the upload toEntityFileStoragefails, the job is markedFAILEDinstead.AccountMigrationJob.resultPath(raw filesystemString) is replaced byresultFile(EntityFileFK, eager-fetched), associated with the job itself.GET /jobs/{jobId}/downloadnow streams viaStoredEntityFile.toResource()(through the newAccountMigrationJobService.downloadResult()), so it works transparently regardless of which storage backend is configured — no moreFileSystemResourceover a raw path.finallyblock and never exposed for download.ARCHITECTURE.mdupdated (new §7.1, diagrams, DB schema, roadmap) to document the new persistence flow.Test plan
mvn -pl extensions/entity-files/sources/core,extensions/saas/sources,extensions/saas/sources/migration -am install -DskipTests— reactor builds clean with the newentity-filesdependency wired in.mvn -pl extensions/saas/sources/migration test— all 75 existing unit tests pass unchanged.GET /jobs/{jobId}/downloadstreams correctly against each configuredEntityFileStoragebackend (local, S3, Buckie).🤖 Generated with Claude Code