Adalennis opened a new issue, #9264:
URL: https://github.com/apache/hop/issues/9264
### Apache Hop version?
2.21.0-SNAPSHOT
### Java version?
Java 21
### Operating system
macOS
### What happened?
Found while documenting the result of these actions (#8970, third batch).
Reproduced with hop-run on main, with both plugins built from 627b99abf1. The
current behaviour is documented in a NOTE on each action page, so the docs need
an update when these are fixed.
**1. Add filenames to result: an invalid regular expression adds nothing,
and the action is true**
`GetFileWildcard()` compiles the wildcard inside
`TextFileSelector.includeFile()`, which catches the `PatternSyntaxException`
for each file, logs it and skips the file. `processFile()` still returns true,
so no error is counted.
With a folder holding `a.txt` and `b.log` and *Wildcard (RegExp)* `([`, the
log shows for each file:
Error while finding files ... in [file:///…/ar/a.txt]. Exception
:Unclosed character class near index 1
No file is added and the action is true with 0 errors: the same result as a
valid wildcard that matches nothing. Delete files does the same (#9175, point
3).
**2. Delete folders: "When number of errors less than" is true when the last
folder brings the errors to the limit**
`updateErrors()` marks the success condition as broken when `nrErrors >=
nrLimitFolders`, but that is only checked before the next folder. At the end,
`getSuccessStatus()` returns true when `nrErrors <= nrLimitFolders`. So the
result depends on where the failing entry is in the list:
| Limit | Folders (a file is an error) | Result |
|---|---|---|
| 1 | folder, file | true, 1 error |
| 1 | file, folder | false, 1 error, stops, the folder is not deleted |
| 2 | folder, file, file | true, 2 errors |
| 2 | file, file, folder | false, 2 errors, stops, the folder is not deleted
|
With the same number of errors, the action is true or false depending on the
order. Move files has the same `>=` / `<=` mismatch (#9175, point 1); Get a
file with FTP and FTP delete had it too (#9170, fixed in #9187).
### Issue Priority
Priority: 3
### Issue Component
Component: Actions
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]