leehaut opened a new pull request, #8984:
URL: https://github.com/apache/hop/pull/8984

   ## Summary
   
   `Delete folders` verification (F7) reported the wrong text for an empty 
folder list and did not check the folders that were actually configured.
   
   ## What went wrong
   
   `ActionDeleteFolders.check()` had two broken paths.
   
   - **Empty folder list.** The action added a warning whose text was the 
hardcoded string `Any folders to deletes`. It also looked up 
`CloneRowMeta.CheckResult.NrClonesdMissing`, a Clone Row key that does not 
exist in this plugin, and then discarded that string. F7 therefore showed a 
misspelled English warning that could not be translated.
   - **Non-empty folder list.** The existence check was commented out. The 
commented code also validated the bean property `fileName`, which this action 
does not have. The folder path is `fileItems[i].fileName`. With the check 
disabled, F7 produced no remark for a filled-in table, including a path that is 
missing or points at a file.
   
   Paths copied from Kettle often use `${Internal.Entry.Current.Directory}`. 
Hop only sets `Internal.Entry.Current.Folder`, so that expression was left 
unresolved and the check treated the literal `${...}` string as the folder name.
   
   ## What this changes
   
   - An empty folder list, when "Copy previous results to args" is off, is a 
warning: `No folders to delete`.
   - Each configured row is resolved and checked. A blank name, a missing 
folder, a path that is not a folder, or a path that cannot be opened is an 
error. An existing folder is an OK result. The Problems view hides OK results, 
so a folder that exists stays silent there.
   - When "Copy previous results to args" is on, the table is not checked. 
Those names come from the previous result at runtime.
   - `${Internal.Entry.Current.Directory}` is filled from 
`Internal.Entry.Current.Folder` (or the workflow filename folder) when the old 
name is not set. The same resolution is used for execution and resource 
dependencies.
   - Messages are in the Delete folders bundle (`messages_en_US.properties` and 
`messages_zh_CN.properties`).
   
   At runtime, a folder that is already gone is still treated as successfully 
deleted. Check reports that path as an error so a wrong path is visible before 
the workflow runs.
   
   ## Test plan
   
   - [x] `./mvnw -pl plugins/actions/deletefolders test`
   - [x] Delete folders, "Copy previous results to args" off, table cleared, 
F7: one warning, `No folders to delete`. The text `Any folders to deletes` does 
not appear.
   - [x] A path that does not exist: an error whose text contains the resolved 
path.
   - [x] A path that is a file: an error that it is not a folder.
   - [x] `${PROJECT_HOME}/some-existing-folder`: no problem row (the OK result 
is hidden).
   - [x] "Copy previous results to args" on and an empty table: no warning from 
the folder table.


-- 
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]

Reply via email to