- Issue created by @apotek
- Status changed to Postponed: needs info
about 1 month ago 7:31am 20 September 2024 - πͺπΈSpain fjgarlin
It's easier if you put a link to the job and/or the pipeline. This job depends on the "composer (next major)" being successful, and we are temporary allowing that job to fail, so it might be that the actual error is in there.
Please review that first and if you still think it's a phpstan job issue, add the link to the pipeline / MR/ job.
- πΊπΈUnited States apotek
Hi fjgarlin,
Thank you for the response and clarification. It was helpful to note: "This job depends on the "composer (next major)" being successful".
This makes sense, but the thing is that the composer (next major) job is allowed to fail without failing. But this job marks a big red x failure when it fails. If this job depends on the success of the first (composer) job, then there is some dissonance here. It seems if the first job is allowed to fail, then this job should also be allowed to fail.
It looks like I will have to disable my CI. It was working fine before, but is now marking the merge requests as failing, despite having no discernible issues is the versions the module has demonstrated compatibility for.
Overall, it seems odd to fail a module for not having Drupal 11 compatibility when it doesn't even _claim_ to be compatible yet. If the module claimed version 11 compatibility and yet failed the composer (next major) job or failed the phpstan (next major), that would make sense. But in this case, these two jobs are introducing requirements that are not claimed by the module,which means these two jobs are _advisory_ and should not be failing merge requests.
The specific run is here: https://git.drupalcode.org/project/orange_dam/-/jobs/2803541
- πͺπΈSpain fjgarlin
Note that this situation is only temporary.
The allow_failure will be removed soon: https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes...
There is a blog post as well about the transition to Drupal 11 as default, explained here: https://www.drupal.org/drupalorg/blog/gitlab-ci-templates-will-make-drup... β
- π¬π§United Kingdom jonathan1055
Hi apotek
I have been working on issue π¬ Inform jobs about the "composer" job exit status and bail out early Active which would help in your situation, as this would show more clearly where the problem is. I have just updated that issue with instuctions on how to use it in a pipeline. - π¬π§United Kingdom jonathan1055
It looks like I will have to disable my CI.
Or you can just opt out of testing against Drupal 11 until you are ready to do so. Use
variables: OPT_IN_TEST_NEXT_MAJOR: 0
as explained in the blog post linked in #4. All the jobs at the "current" version pass, so you will have a green pipeline result again.
- π¬π§United Kingdom jonathan1055
Thinking about this again, maybe @apotek has a good point. If we are allowing the Composer Next Major to fail during this transition period, than maybe we should have added
allow_failure: true
to the other 'Next Major' variants also. That would have served the same purpose, to encourage maintainers to see how their module works with Drupal 11, but not impact the pipeline result. - π¬π§United Kingdom jonathan1055
I have pushed the change mentioned in #7 to MR254 which is ready for review and testing.
- πͺπΈSpain fjgarlin
I thought that all βnext majorβ jobs had it, so yeah, it was an oversight.
Iβll try to review and commit a few small MRs in the coming days (probably from the contrib room at DrupalCon).
- πͺπΈSpain fjgarlin
Actually, this behavior might be because of this: https://git.drupalcode.org/project/orange_dam/-/blob/2.x/.gitlab-ci.yml?...
But Iβll review the MR in any case.
- π¬π§United Kingdom jonathan1055
Actually, this behavior might be because of this
Yes you are absolutely right. The gitlab templates default in .phpstan-base is
allow_failure:true
, so the orange_dam project is explicitly setting it to false (which affects all variants). The push I have just committed to MR254 should override that, back to 'true' for 'next major'.It would be good if that MR could be committed and a new default release
1.5.9
made, as this will avoid more support requests like this. It may be a while before π Update templates so 11.0 is the default/current branch RTBC is finally merged. - πͺπΈSpain fjgarlin
Yup, happy to commit quick bug fixes before the big shift. I left feedback on the other issue.
- πͺπΈSpain fjgarlin
Closing this one as the work in π¬ Inform jobs about the "composer" job exit status and bail out early Active will solve the issue.
- πΊπΈUnited States apotek
Thank you @fjgarlin and @jonathan1055 for digging in to the issue with me. I appreciate it.
As a module maintainer, I do appreciate the gitlab CI automations, but given the ad hoc and voluntary nature of module maintenance, it would be good if this tooling defaulted to advisory notices (as agreed in this thread) for anything the module has not yet claimed or delivered upon.
As a maintainer, I do want my phpstan and phpcs to fail for all versions for which I claim compatibility in my existing code. But I do not want them to fail for versions for which I have not begun the update effort and for which I am not claiming compatibility.
I also note that since Drupal 11 is out, next major would be Drupal 12. Or am I misunderstanding what next major signifies?
Thank you again for your contributions. I just wanted to offer some feedback in the issue itself as history. Thank you for #3471235 too.
- πͺπΈSpain fjgarlin
You're welcome.
Some of your questions are answered here: https://www.drupal.org/drupalorg/blog/gitlab-ci-templates-will-make-drup... β
Right now:
- current is 10, and next major is 11.
- we are testing next major even if modules don't opt in, in preparation for the D11 shift.When π Update templates so 11.0 is the default/current branch RTBC is merged:
- current will be 11, and there won't be next major until 12 is available
- we will only test the versions that maintainers choose to test - π¬π§United Kingdom jonathan1055
But I do not want them to fail for versions for which I have not begun the update effort and for which I am not claiming compatibility.
Yes absolutely agree, and we had already catered for Nightwatch and PHPUnit next major, but missed it for PHPStan. That is what we fixed on π¬ Inform jobs about the "composer" job exit status and bail out early Active so thank you for alerting us the oversight.
Now that fjgarlin has made a new default release, this fix should be automatically used by all projects running the default gitlab templates version. You can see that this MR has been included by using the two links at the end of this documentation page
If you run a new pipeline now, it should end green overall even though PHPStan Next Major will show amber in the detailed view.