83125[TASK] Make duplicateExceptionCodeCheck.sh warning free
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 1
Review log 1114
-
Simon Schaufelberger uploaded patch set 1 02/25/24, 20:39
-
Simon Schaufelberger updated the commit message in patch set 2 02/25/24, 20:41
-
core-ci voted on patch set 1 V +1 02/25/24, 20:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53557
-
Simon Schaufelberger commented on patch set 2 02/25/24, 20:45
duplicateExceptionCodeCheck.sh:132if an array should be used instead, this should be rewritten differently but the way how it is currently seams wrong. -
core-ci voted on patch set 2 V +1 02/25/24, 20:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53558
-
Stefan Bürk commented on patch set 2 CR -1 02/27/24, 20:58
duplicateExceptionCodeCheck.sh:19Replykeep the array. It's pretty fine to use `+=` to also add a element to the end of an array. `+=` has different outcomes in bash. https://linuxhandbook.com/bash-append-array/duplicateExceptionCodeCheck.sh:132ReplyPlease keep the original syntax along with keeping it an array above (see comment above). This is pretty normal regexp usage to check if something is in an array: https://www.baeldung.com/linux/check-bash-array-contains-value -
Simon Schaufelberger commented on patch set 2 02/27/24, 22:16
duplicateExceptionCodeCheck.sh:19ReplyAccording to the website, it should be written as: ``` ignoreFiles=() ignoreFiles+=("sysext/core/Tests/Acceptance/Support/_generated/ApplicationTesterActions.php") ``` but that has a totally different outcome where the ignoreFiles variable is used later as there is a comparison made between a string and an array and that doesn't work. -
Stefan Bürk commented on patch set 2 02/27/24, 23:17
duplicateExceptionCodeCheck.sh:19Reply UnresolvedThat would be the correct fix to add the parentheese here. The original check below is a regexp style check -> https://www.baeldung.com/linux/check-bash-array-contains-value#using-anifcondition-with-aregex-pattern However, feel free to change it to a for loop check if you feel better with it and keep(make) it here a correct array. We need to stay with this array syntax due to bash 3.x support (default macos bash version)duplicateExceptionCodeCheck.sh:132ReplyNote: the currentFilename is used as regexp for an regexp check against an array. Feel free to change it to a for-loop (in array) check. Simply using the currentFilename as regexp pattern is a little scary - at least without an proper quoting/escaping which is missing here. (dots etc). -
Stefan Bürk commented on patch set 2 02/27/24, 23:56
duplicateExceptionCodeCheck.sh:132Reply UnresolvedWe could check the exact bash default version on a mac. At least, using the filename from a variable should automatically quote things like dots and slashes, so it is matches literally and not in a regexp style: ``` In bash-3.2, the shell was changed to internally quote characters in single- and double-quoted string arguments to the =~ operator, which suppresses the special meaning of the characters special to regular expression processing ('.', '[', '\', '(', ')', '*', '+', '?', '{', '|', '^', and '$') and forces them to be matched literally. This is consistent with how the `==' pattern matching operator treats quoted portions of its pattern argument. ``` So i'd say keeping the current condition with with ignoreFiles as array (fixing above) and the currentFilename can stay and is safe.duplicateExceptionCodeCheck.sh:159UnresolvedIsn't the removing of the spaces for left and rightside (and removing the quotes) change in behaviour and changing the check here ? Guess have to recheck this after some sleep. I would say that this would now match "456" if the array contains "12345678" as already found exception code ... and the spaces has been used to have a better matching. Not sure, needs some playground tests. -
Stefan Bürk commented on patch set 2 04/21/24, 00:58
@simonschaufi+typo3@gmail.com ping -
Benni Mack updated the commit message in patch set 3
CR -1V +110/18/24, 13:28 -
core-ci voted on patch set 3 V -1 10/18/24, 17:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67969
-
Christian Kuhn commented on patch set 3 12/19/24, 18:02
Hey. i hope it is ok to abandon here for a couple of reasons: * this patch did not see activity for while * this is "only" a Build/ related script, mainly used within CI * this script is usually executed within the given CI / runTests.sh environment, where it works without issues * there are no apparent bugs within the given CI / runTests.sh enviroment that really have to be fixed at the moment. In case this is still a pressing issue, the patch could be resurrected and finished of course. -
Christian Kuhn abandoned the change 12/19/24, 18:03
duplicateExceptionCodeCheck.sh:19