fix(task) #37 #38 #39 #40 #41 FileFetchTask and RemoveFileTask fixes, #33 add missing tests - #42
Merged
Merged
Conversation
Merged
3 tasks
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.
Description
Fixes #33.
Fixes #37.
Fixes #38.
Fixes #39.
Fixes #40.
Fixes #41.
Grouped in one PR because the fixes change the same tasks, tests, reference pages and the CHANGELOG
Latestsection.FileFetchTask
listContents()ran before each file: N + 1 listings for N files, which also triggered the stale SFTP connection of SFTP connection timeout causing archiving step failure #24).next()), so each input is processed: withfile_pattern, only the first input copied the files, and a path received twice was skipped.fileExists(): skipped withignore_missing: true(default),\UnexpectedValueException(File <path> not found in source filesystem) otherwise. A missing file threwUnableToReadFile, whateverignore_missing.0is copied (it threwNo pattern neither input provided for the Task, or ended the iteration withfile_pattern).RemoveFileTask
Input file not found(warning) instead ofDeleted input file(thelocal/sftpadapters do not fail on a missing file); a list of paths is accepted (as forFileFetchTask, it triggered aTypeError); the failure message is fixed (Failed to delete input file).0is deleted.Tests (#33)
StorageTestCase(new): the tasks run on real local storages in a temporary directory (with a listing counter), iterating as the process manager does;symfony/filesystemadded torequire-devfor the cleanup.FileFetchTaskStorageTest,ListContentTaskTest,RemoveFileTaskTest(new): pattern / input modes, one listing per input, several inputs, paths received twice, file0,remove_source, overwriting,ignore_missingboth ways, errors, options, logs.CleverAgeFlysystemProcessExtensionTest,CleverAgeFlysystemProcessBundleTest(new): non-shared services with their storage locator and public aliases, bundle path.FileFetchTaskTest: the source mock answersfileExists().Coverage: 115/115 lines (35 tests). Without the fix, 9 of the new tests fail.
Documentation:
file_fetch_task.md(ignore_missing, outputs, notes on listing / inputs / missing files),remove_file_task.md(inputs, logs),troubleshooting.md.Checked with process-bundle-demo (see the demo PR):
demo.flysystem.fetch_multiple_inputs(a.txt,b.txt,a.txt,0)a.txt,b.txt, thenNo pattern neither input provided for the Taska.txt,b.txt,a.txt,0demo.flysystem.fetch_pattern_multiple_inputs(2 inputs)a.txt,b.txta.txt,b.txt,a.txt,b.txtdemo.flysystem.fetch_missing_input(missing.txt,a.txt)UnableToReadFilea.txtdemo.flysystem.remove_missing_file(a.txt,missing.txt,dir)missing.txtlogged as deleted,Failed to deleted input filefordirInput file not foundformissing.txtanddirdemo.flysystem.remove_files_input(['a.txt', 'b.txt'])TypeErrordemo.flysystem.fetch_write_failureNot changed:
ListContentTaskstill lists the directories (audit point, documented and intended: it outputsStorageAttributeswith theirtype).Requirements
Breaking changes
FileFetchTaskiterates are copied by the next execution of the task, not during the current iteration.file_patterntask copies the matching files.ignore_missing: true, a missing file given as input is skipped (the process failed).RemoveFileTaskis logged with thewarninglevel.FileFetchTask::$matchingFilesis now?list<string>andfindMatchingFiles()returns the files (protected members).🤖 Generated with Claude Code