Skip to content

Fix#9264 Add filenames invalid regex and Delete folders error-limit boundary - #9357

Open
leehaut wants to merge 2 commits into
apache:mainfrom
leehaut:hotfix/lance-common-60
Open

leehaut wants to merge 2 commits into
apache:mainfrom
leehaut:hotfix/lance-common-60

Conversation

@leehaut

@leehaut leehaut commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Fix #9264

Summary

  • Add filenames to result: compile the wildcard RegExp once before selecting files. An invalid expression (e.g. ([) now fails the entry instead of being caught per file, leaving the action successful with zero result files.
  • Delete folders: align When number of errors less than with Move files ([Bug]: Result issues in Move files, Delete files and Zip file #9175): success requires strictly fewer errors than the limit (nrErrors < limit). Reaching the limit on the last entry no longer leaves the action true while the same count earlier in the list made it false.
  • Update the action docs that previously documented these behaviours as NOTES.
  • Add unit tests for both cases.

Test plan

  • Manual: invalid RegExp on Add filenames to result → result=[false]
  • Manual: Delete folders, limit=1, order folder then file → result=[false]
  • Manual: Delete folders, limit=1, order file then folder → result=[false], remaining folder kept
  • Unit: ActionAddResultFilenamesResultTest
  • Unit: ActionDeleteFoldersResultTest
  • ./mvnw spotless:apply / CI spotless:check

@bamaer

bamaer commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Thanks @leehaut, this works as described: both new tests fail on main and pass on this branch, and the module tests are green.

Blockers

  • Add filenames: a file entry with a non-regex wildcard now fails. compileWildcard() runs before the file/folder check (ActionAddResultFilenames.java:180). The wildcard only applies to folders, but a single file a.txt with wildcard *.txt now gives result=false, errors=1, files=0; on main it gives true, 0, 1. This can also happen with Copy previous results to args?, where the wildcard comes from the second field of the row.
    Suggested fix: compile it only in the folder branch, as Delete files does: addMatchingFilesFromFolder(filefolder, compileWildcard(realWildcard), parentWorkflow, result). Then limit the docs line to folders ("…and the Wildcard (RegExp) of every folder is a valid regular expression").

Built and ran the unit tests of both plugins locally; not run in a workflow.

@leehaut

leehaut commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @bamaer — good catch.

Moved compileWildcard() into the folder branch only (same as Delete files), so a file entry with a non-regex wildcard like *.txt is added again. Docs updated accordingly, plus tests for the file-entry / previous-result cases.

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.

[Bug]: Add filenames to result is true with an invalid regular expression; Delete folders is true when the last folder brings the errors to the limit

2 participants