Skip to content

Batch 2: Document the result of the File exists, Create file, Delete files, Shell, Move files and Zip file actions. #8970 - #9024

Merged
bamaer merged 2 commits into
apache:mainfrom
Adalennis:8970-2
Oct 20, 2026

Conversation

@Adalennis

@Adalennis Adalennis commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Addresses #8970

Second batch: a Result section on the File exists, Create file, Delete files, Shell, Move files and Zip file pages, in the format of the first batch (#9000). Every row comes from a test run with hop-run on current main (47 cases).

While at it, existing text that was wrong:

  • Shell, Return status: it said a return value of 1 means success and 0 failure; it's the other way around.
  • Delete files, Include Subfolders: it deletes the matching files in subfolders, never the folders.
  • Labels aligned with Hop Gui: File name (File exists), Specify logfile and Copy previous results to args (Shell, Delete files), Add files to result files name (Move files).

Two notes describe current behaviour that may be worth a code fix: Move files' "errors lesser than" condition and its Fail option counting an existing file twice, and Delete files ignoring an invalid regular expression.

  • Run mvn clean install apache-rat:check to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If you have a group of commits related to the same change, please squash your commits into one and force push your branch using git rebase -i.
  • Mention the appropriate issue in your description (for example: addresses #123), if applicable.

To make clear that you license your contribution under the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@bamaer

bamaer commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Thanks @Adalennis, the label fixes and the Shell return-status fix are good catches. This only touches docs, so none of it can break anything. I checked every Result row against the action code on current main. The rows below say something different from what the code does.

Fix before merge

  • Zip file, False: a source file that can't be moved after zipping does not make the action false. moveFile logs the error, and then successResult = true (ActionZipFile.java:560) overrides it, so the action is true and the zip is in the result files. A failed delete is false only because VFS throws. Suggest dropping "or moved" and adding a NOTE about it, like the ones on Move files.
  • Zip file, True, "no file matches the wildcard (creates an empty zip)": this only holds with Include subfolders off. With it on, the wildcard is applied in findFiles, so the list comes back empty and the action is false with no zip (ActionZipFile.java:315-334).
  • Zip file, True with an empty source or with Get arguments from previous: neither path ever sets the result (ActionZipFile.java:917-994), so the action passes on the previous action's true/false. After a failure or unconditional hop it is false, even when every row zipped fine. Suggest: "the result of the previous action is passed on."
  • Move files NOTE, "counts as two errors": this only happens when the entry is a single file. With a folder or wildcard source, an existing file counts once (ActionMoveFiles.java:1043).
  • Delete files and Move files, Copy previous results to args in the Options table: this row still says the files come from the result files. The code reads the result rows, as the new Result rows line says, so each page now contradicts itself.

Worth fixing

  • Shell: with Execute for every result row and no result rows, the command doesn't run, and the previous result is passed on with no exit status (ActionShell.java:298).
  • Shell, "could not be started … script file doesn't exist", Exit status not set: that is true on Linux/macOS only. On Windows cmd.exe /C starts anyway and returns a non-zero exit code, which is then set as the exit status.

I reviewed the code against main but didn't run it.

…ults to args option of Delete files and Move files. apache#8970
@Adalennis

Copy link
Copy Markdown
Contributor Author

Thanks @bamaer. Changes added:

  • Zip file: fixed all three. A source that can't be moved after zipping leaves the action true with the zip in the result files (now a NOTE; only a failed delete makes it false). With Include sub-folders on, no match is false and creates no zip. An empty source or Get arguments from previous passes on the previous result, even when every row zipped. While testing I also corrected the Result files row: a zip that was created stays in the result files even when the action ends up false.
  • Delete files and Move files: the Copy previous results to args row now says result rows, with the fields.
  • Shell: added the no-rows case, and the Windows cmd.exe behaviour (from the code; I couldn't test on Windows).
  • Move files, "counts as two errors": I kept it. An existing destination file with Fail gave 2 errors both with a single-file entry and with a folder entry (folder src/ with a.txt, dst/a.txt existing: errors=2). Line 1043 sets entryStatus for a subfolder in the listing; for a file inside the folder, moveOneFile returns moveFile's false and the folder loop calls updateErrors() again.

@bamaer
bamaer merged commit 3337131 into apache:main Oct 20, 2026
3 checks passed
@Adalennis Adalennis changed the title Document the result of the File exists, Create file, Delete files, Shell, Move files and Zip file actions. #8970 Batch 2: Document the result of the File exists, Create file, Delete files, Shell, Move files and Zip file actions. #8970 Oct 30, 2026
@Adalennis

Copy link
Copy Markdown
Contributor Author

Reported: #9175 (Move files errors-lesser-than limit and double count with Fail, Delete files invalid regex and short result rows, Zip file result with Get arguments from previous and after a failed move).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants