Skip to content

Issue #9263 : Fix file-to-folder copy options, failed folder copies, and invalid regex - #9711

Draft
mattcasters wants to merge 1 commit into
apache:mainfrom
mattcasters:issue-9263
Draft

mattcasters wants to merge 1 commit into
apache:mainfrom
mattcasters:issue-9263

Conversation

@mattcasters

Copy link
Copy Markdown
Contributor

Copy files ignored Replace existing files, Remove source files, and Add files to result files name when the source was one file and the destination was a folder. That path copied the bytes directly. It now uses the same overwrite, removal, and result-file rules as a file copied onto a file, applied to the file inside the destination folder. Skipping an existing file is still a successful action.

A file that failed while a folder was copied was only logged, and the action stayed true with no errors, so the workflow followed the success hop. A failed file in the folder now makes that copy false with one error. Files that can be copied are still copied, removed, or added to the result.

Simple evaluation compiled the compare value as a regular expression outside a try. An invalid pattern such as ([ threw PatternSyntaxException and stopped the workflow before either hop. The action now logs the error and returns false with one error, the same outcome as a value that cannot be parsed as a number. A valid expression that does not match is still false with no errors.

Ran tools/with-isolated-display.sh ./mvnw -pl plugins/actions/copyfiles,plugins/actions/simpleeval -am test -Dtest=WorkflowActionCopyFilesTest,ActionSimpleEvalTest -Dsurefire.failIfNoSpecifiedTests=false. WorkflowActionCopyFilesTest: 7 tests, 0 failures. ActionSimpleEvalTest: 18 tests, 0 failures. mvn clean install apache-rat:check was not run.

fixes #9263


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • 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.

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

Labels

None yet

Projects

None yet

1 participant