feat: ingest logic to use FileService - BED-8317,BED-8318#2808
feat: ingest logic to use FileService - BED-8317,BED-8318#2808mykeelium wants to merge 4 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
c0f97d8 to
7b55a77
Compare
70b7597 to
1c28d46
Compare
| } | ||
| defer sourceFile.Close() | ||
|
|
||
| scratchFile, err = os.CreateTemp(scratchDirectory, "archive-*") |
There was a problem hiding this comment.
I am a little confused why we're doing direct OS file operations here, doesn't file service have a local storage driver?
There was a problem hiding this comment.
It does, but this is supposed to be a stage earlier than the fileService, in this case spooling is done to take the users file and validate it prior to saving it to the file service. In the event that we have a file service that is not on the os, this handles the resources ensuring they are available for the fileService. Not in this scope, but maybe the upload could be shifted to a presigned url so we do not need this step at all.
Description
This change migrates the ingestion logic to use the new FileService. In addition, the cleanup daemon was updated to be able to delete files using the new FileService.
Motivation and Context
Resolves BED-8317,BED-8318
How Has This Been Tested?
The application was started and multiple ingested files were created. The data from these files were ingested correctly. In addition new tests were added.
For the cleanup, files were added to the directories, and both with exemptions and without PruneData was run to ensure the proper files were deleted.
Screenshots (optional):
Types of changes
Checklist: