- Issue created by @Charlie ChX Negyesi
- ๐จ๐ฆCanada xmacinfo Canada
I agree 100%. Don't block innovation over a missing space.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
+1
In practice, almost no patch gets committed without a round of review anyway. So thereโs very little risk of coding standards violations to get committed. (Itโd fail CI anyway, just not as early.)
I suspect part of the reason is CI cost: save expensive CPU time for patches that could be green. But does this really save time & money? ๐ค Because โฆ just to get to the point of running
phpcs
takes ~5 minutes (a lot of Docker activity before then!).phpcs
then takes seconds, sometimes a minute. If we fail at that time, like we do today, the overhead is the overwhelming majority.Worse: this means the only thing a contributor can fix is โฆ coding standards. Because thatโs the only information you get. So the current setup often results in netmore CPU time than if
phpcs
didnโt havehalt-on-fail: true
! - Status changed to Needs review
over 1 year ago 8:07pm 4 June 2023 - last update
over 1 year ago 29,411 pass - ๐ซ๐ฎFinland lauriii Finland
I'm wondering what does DrupalCI output now when there are coding standard violations? Also how does it report if there are coding standard violations and test failures?
- last update
over 1 year ago 29,415 pass - ๐จ๐ฆCanada Charlie ChX Negyesi ๐Canada
Excellent question, let's try.
- Status changed to Needs work
over 1 year ago 12:43pm 5 June 2023 - ๐บ๐ธUnited States smustgrave
Moving to NW assuming #7 was suppose to fail.
- Status changed to Needs review
over 1 year ago 10:12am 6 June 2023 - ๐จ๐ฆCanada Charlie ChX Negyesi ๐Canada
Sorry but no, this still needs review by core committers and I suspect the DA as well then we can see what we need to do to DrupalCI to make this fail. Eventually it'll be CNW but that'll be in a different issue queue.
- ๐ฌ๐งUnited Kingdom longwave UK
From past conversations with the DA I believe there is no capacity to make changes to DrupalCI to support this or any other feature requests, and instead we should look to implementing it when we switch to GitLab CI.
- Status changed to Needs work
over 1 year ago 10:57am 8 June 2023 The Needs Review Queue Bot โ tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide โ to find step-by-step guides for working with issues.
- Status changed to Needs review
over 1 year ago 1:35pm 8 June 2023 - ๐ซ๐ทFrance nod_ Lille
And in the meantime we have the needs review queue bot to pick up some of this.
Excluding this issue for the bot, since what we need is discussion, not more bots getting in the way :)
- ๐จ๐ฆCanada Charlie ChX Negyesi ๐Canada
Wait a second, wasn't that very useful? This means we could commit the patch as is if we wanted and while the checks won't show the phpstan fail , the bot eventually will. It's not like RTBC patches get in within hours.
- ๐ฌ๐งUnited Kingdom longwave UK
Sometimes patches do get in quickly when they are critical, or core committers are working together. I'd really prefer not to have false-positive green test runs on something that has actually failed checks.
- ๐บ๐ธUnited States smustgrave
Is the goal to be able to run tests with phpcs errors?
If that's the case wouldn't the issue still need to have those fixed before it can be marked RTBC. Resulting in needing to run the tests again couldn't that be costly?
- ๐ซ๐ทFrance nod_ Lille
The problem with the needs review queue bot is that it's not a reliable service. It runs on a laptop behind the TV of a relative's house and there are a few limitations on what it can do today with regard to selecting patches to tests, running against specific branches, how frequently it runs because we need to use d.o api responsibly, etc. It's all solvable with some time but it's not time I have at the moment.
I do see the value of having the code style gate not being a blocker to running the tests. Overall most of the linting stuff is easy to fix, spacing, permissions, etc. so that would make sense to assume that it'll be easy to fix at any point and now "slow down" patches for that. There are a few eslint rules that are not easy to get rid off if eslint complaints but we could say it's non-blocking only for phpcs stuff and a specific subset of eslint rules.
If we're doing a wishlist it could make sense to not halt test runs on lint failures for NR issues but fail test runs for RTBC issues (since by that point the patches should be in a ready to commit state)
@longwave if core committers are involved and the patch is critical, everything that is non blocking would still be run in the pre-commit hook no?
- ๐บ๐ธUnited States smustgrave
For me Iโm kind of 50/50.
If youโre rock n rolling with an issue and want to test how itโs going you donโt want to be delayed by phpcs issues.
But if we run tests for phpcs issues we still would have to run with them fixed. So double the resources right? Could that be noticeably more costly?
- ๐จ๐ฆCanada Charlie ChX Negyesi ๐Canada
It won't be double the resources, no, such minutiae can be fixed ongoing. A complex enough patch will need many rounds anyways.
What we have here is: submit patch, schedule a check back in an hour so to find the patch was not tested. Often over the lack of absolutely unnecessary doxygen which makes it doubly infuriating. There's already an issue over dropping some of that but it's a long way off before we don't need to add any fluff.
- ๐บ๐ธUnited States smustgrave
So should this be moved over to the gitlab queue if we aren't going to add here?
- ๐ฌ๐งUnited Kingdom longwave UK
Is there a way of just running the checks after the tests? Then we could keep halt-on-fail, but the tests would fail first, and the checks would only even run if the tests pass?
- last update
over 1 year ago 29,448 pass - ๐บ๐ธUnited States smustgrave
Moved the check to the bottom. Guessing that could matter?
22:49 21:54 Running- ๐บ๐ธUnited States smustgrave
I messed up indentation. Lets try again.
- ๐บ๐ธUnited States smustgrave
No then it would show green even though there were phpcs errors I believe.
But #22 shows it ran the tests but still failed. Not sure why it's aborted but that's promising I think?
- last update
over 1 year ago CI aborted - Status changed to Needs work
over 1 year ago 2:21pm 15 June 2023 - ๐ฌ๐งUnited Kingdom longwave UK
This doesn't appear to have worked due to unintended side effects, see https://dispatcher.drupalci.org/job/drupal_patches/187500/consoleFull
The tests create a bunch of output that is useful for debugging. But running the checks after the tests means that this output is considered as changes to the repo, and so the files are spellchecked/linted/etc. The clues are:
01:02:11 core/scripts/dev/commit-code-check.sh --drupalci 01:26:14 core/scripts/dev/commit-code-check.sh: line 212: /usr/bin/yarn: Argument list too long 01:26:14 01:26:14 CSpell: failed
Then a huge number of PHPStan failures, and then it starts checking Nightwatch's CSS output:
01:27:18 nightwatch_output/nightwatch-html-report/css/bootstrap.min.css 01:27:18 6:9 โ Expected no more than 1 declaration declaration-block-single-line-max-declarations 01:27:18 6:1006 โ Expected "Roboto" to be "roboto" value-keyword-case 01:27:18 6:1060 โ Expected "Arial" to be "arial" value-keyword-case 01:27:18 6:1171 โ Expected "SFMono-Regular" to be "sfmono-regular" value-keyword-case 01:27:18 6:1186 โ Expected "Menlo" to be "menlo" value-keyword-case 01:27:18 6:1192 โ Expected "Monaco" to be "monaco" value-keyword-case
Finally this all seems to take too long (it is analysing Bootstrap JS), and times out:
01:27:19 Checking core/nightwatch_output/nightwatch-html-report/js/bootstrap.min.js 01:27:19 02:11:11 Build timed out (after 110 minutes). Marking the build as aborted. 02:11:11 Build was aborted
- ๐ฌ๐งUnited Kingdom catch
Hadn't seen this issue but have an MR up to run unit tests (but not everything else) if phpcs fails on gitlab. It would be a YAML change to allow unit + kernel but not everything else too.
- ๐ณ๐ฟNew Zealand quietone
Thanks catch, I intended to relate to that issue but mucked it up.
- Status changed to Closed: duplicate
about 1 year ago 11:28am 11 September 2023 - ๐ฌ๐งUnited Kingdom catch
[# https://www.drupal.org/project/drupal/issues/3386076] โ now runs phpunit and kernel tests if cs/phpstan etc. fails, but blocks functional etc. I think that's a good compromise between fast feedback and wasted test runs on typos for otherwise ready patches, so going to close this as duplicate.