Review main Abandoned

67327[TASK] Add TypeScript to cglFixMyCommit scripts

Martin Kutschker CR 0 V 0 Normal +51 −24 updated 11/04/21, 12:56

Commit message

There are CGL rules that are checked for TypeScript files.
Add auto-fixing of style errors for TypeScript.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 2

Review log 1215

  1. Martin Kutschker uploaded patch set 1 01/01/21, 19:19

  2. TYPO3com voted on patch set 1 V +1 01/01/21, 19:31 Completed build in 10m 59s on Fri, 1 Jan, 07:30 PM Test Summary: 32540 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8543

  3. Martin Kutschker uploaded patch set 2 01/01/21, 21:07

  4. TYPO3com voted on patch set 2 V -1 01/01/21, 21:23 Completed build in 16m 02s on Fri, 1 Jan, 09:23 PM Test Summary: 31713 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8545

  5. TYPO3com voted on patch set 2 V +1 01/04/21, 13:43 Completed build in 10m 00s on Mon, 4 Jan, 01:43 PM Test Summary: 32546 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8588

  6. Christian Kuhn commented on patch set 2 V -1 01/04/21, 14:37

    not sure if we should really add this to cglFixMyCommit.sh - especially due to the introduced js dependency. apart from that decision, the change fails with runTests.sh anyways: Build/Scripts/runTests.sh -s cglGit Creating network "local_default" with the default driver cglFixMyCommit.sh: Searching for source files in latest git commit ... Sources/TypeScript/adminpanel/Resources/Public/TypeScript/AdminPanel.ts Build/Scripts/cglFixMyCommit.sh: line 158: npx: command not found
  7. Martin Kutschker commented on patch set 2 01/04/21, 17:05

    Reply

    Hm, must have installed npx ony my machine. No problem to invoke ESlint without it. Ad Node dependency: what do you propose? Two options are: * create a cglFixMyCommitWithNode.sh script * check for Node and simply skip ESlint if it is not present
  8. Martin Kutschker commented on patch set 2 01/04/21, 19:06

    Reply

    Thinking again about it. The only devs who are going to be affected are the ones who change TS files. To push a valid commit they have to build the JS, so they need Node anyway. Sno, no need to worry about any dependencies.
  9. Oli Bartsch commented on patch set 2 01/04/21, 19:17

    Reply

    As you said, changing TS requires to run the grunt tasks to compile TS and to copy it to the public folders. The compile-typescript task already contains eslint. Therefore adding it here seems to be duplicated.
  10. Martin Kutschker commented on patch set 2 01/04/21, 19:47

    Reply Unresolved

    Your first comment simply said "no". I have been bitten by a check on Bamboo despite the local build. Maybe an error of mine.
  11. Christian Kuhn commented on patch set 2 05/20/21, 19:24

    Hey Masi. Thinking about this one for a while I came to the conclusion it's better to not introduce this to that script: The script is often called as-is without runTests.sh encapsulation and does not have many dependencies yet. It just fixes basic php cgl issues and works as soon as some local PHP is installed, which is often the case. Adding js dependencies here makes the script much less reliable and I'd assume it would fail on most current local dev machines. I think it's fine to perform the js cgl stuff only when CI says 'no' - it's fine for probably 80% of patches anyways, since they don't change js/ts. And if it then fails, runTests.sh comes to the rescue to not have a local setup for the dependencies. In the end, I hope if it's ok to keep the script as-is. Would you be fine with dropping this approach?
  12. Martin Kutschker commented on patch set 2 05/20/21, 19:56

    Reply

    The most convincing argument for abandoning non-PHP checks is that you need to build JS/CSS anyways prior to the commit. So maybe a check that tests if the JS is not older than TS is nice. But that's something for another patch. The only thing I'd retain is the cleanup for the return value. IMHO it's rather surprising that the test function does an exit. But that's a matter of style.
  13. Christian Kuhn commented on patch set 2 05/20/21, 20:51

    Reply

    right. would you like to strip-down the patch to the cleanups and rename title and stuff?
  14. Christian Kuhn commented on patch set 2 11/04/21, 12:56

    Let us abandon this one for now: We agreed the typescript stuff should not be integrated to the php cgl fixer directly. The left over cleanup did not happen for a while. If that is still a topic, we can happily resurrect the patch or push a new version.
  15. Christian Kuhn abandoned the change 11/04/21, 12:56