feat: save file resource content synchronously for jobs [DHIS2-15276] #15747
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
To ensure the file content of a job that runs immediately is already saved a new method is added to the file resources service which stores the content synchronously via JClouds.
For clarity the existing methods that save the content asynchronously were renamed to reflect this.
New error codes are added for two cases:
Manual Testing
Automatic Testing
Existing tests indirectly cover the synchronous content storage as it is now used for metadata and tracker imports.
If all of them pass and the runtime for e2e tests has not increased notably beyond about 15min the behavior is as expected.
The new two error codes cannot be integration tested as this requires a failure of the cloud storage which cannot be simulated (with reasonable effort) except via mocking which at this point adds little value.