- Issue created by @greggles
- 🇦🇺Australia elc
In the process of adding a phpstan.neon file to deal with the
Unsafe usage of new static
error.Given this is a contrib module, I'm following the same approach of Drupal core and turning off that error given "new static() is a best practice in Drupal, so we cannot fix that."
https://www.drupal.org/docs/develop/development-tools/phpstan/handling-u... →
https://git.drupalcode.org/project/drupal/-/blob/10.0.x/core/phpstan.neo...The OPT_IN_* variables don't seem to be working at all - I thought that would given the opportunity to test Drupal 9, 10, and 11 against the code base to be able to tell when we needed a new branch, but none of them seem to work.
Next step after get it working is to turn off DrupalCI for all branches.
I'll add the commits to the 8.x-1.x branch, but I'm not sure it warrants a release there. It's just setting up testing so only if there is a security issue would that branch get a new release at this point.
- Status changed to Needs review
over 1 year ago 3:09am 8 November 2023 - 🇦🇺Australia elc
My local phpstan was complaining about being able to find any Drupal classes, and was not showing up the same errors that the GitlabCI was showing. Turns out my environment was missing phpstan/extension-installer despite it being required by 3 of the other requirements.
For others, some experimenting with the OPT_IN_* variables indicates that the 4 spaces before the variable to indent it to the same level as the project def above it. The DA template doesn't make this apparent because it has the comment block without any indent at all. Added these back in an tests valid without warning on all
There's a CI linter which is very very useful for making sure the .gitlab-ci.yml is valid, and that all of your variables are correct:
https://git.drupalcode.org/project/genpass/-/ci/lint ; just replace the project name in that url. It's the "CI link" button, top right of the pipelines page.Does GitlabCI work on D7 branches? It doesn't usually run composer which is making me think not. If not it would seem that DrupalCI is going to hang around until D7 is finally closed off.
- 🇺🇸United States greggles Denver, Colorado, USA
I appreciate all your work and explanations of what you're doing!
I am not sure about D7. I think we should focus this issue on the 2.0.x-dev branch and not worry about D7. I guess drupal.org will turn off drupalci when appropriate.
I see it's passing now. Feel free to mark this as "fixed" whenever you are happy with it.
- Status changed to Needs work
over 1 year ago 3:38am 8 November 2023 - 🇦🇺Australia elc
Updated remaining tasks list.
Switching to NW because of 8.x-1.x branch still needing to have testing switched over.
- 🇦🇺Australia elc
This is "fixed" for the 2.0.x branch.
The DA template is not going to work with the 8.x-1.x branch as it's testing against D10.1 when it needs to be testing against D9 only. D8 testing is long turned off. Will need to dive into the CI syntax and divert from the template to avoid it always trying D10 tests.
This won't hold up 2.0.2.
- Issue was unassigned.
- Status changed to Fixed
over 1 year ago 6:49am 8 November 2023 - 🇦🇺Australia elc
Sending back to main branch as we're fixed for both.
Had to force the use of the drupal/core:9.5.x branch as by default it tests against D10. The D9 testing core does not include phpstan? The option was to turn it off with
SKIP_PHPSTAN: '1'
, or add it as a require-dev for the branch of which I chose the latter because it meant actually checking if anything was wrong.Had to ignore a number of errors on 8.x-1.x branch:
- Use of deprecated genpass_password(); The notice was to let others know of the change, not bog down this test
- Use of deprecated ModuleHandlerInterface::getImplementations() since this test will never be run against D10 because this version is deprecated
- Updated tests to D9 since they will never be run against D8 core on here again.
That means we've turned off Drupal CI for all of the D8/9/10 versions.
There is actually a way to test D7 core with Gitlab CI too; I ran into that while looking at this but lost the page. It would be possible to turn off DrupalCI for that branch too if the need arose. It really depends on any announcement from DA as D7 will be killed off Jan 2025, so whichever comes first.
I did have the instructions on how to get Gitlab CI working on issue forks but I have lost that page too and can no longer find it. If someone could point me towards that it would be great! At present the issue forks are excluded from the workflow and the pipelines only run when there is a commit to a main branch. It has something to do with adding an array style variable to .gitlab-ci.yml.
- 🇦🇺Australia elc
Just updating summary to tick off the 8.x-1.x branch changes to testing. Seems to be all done for now.
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Needs work
about 1 year ago 6:01am 24 November 2023 - 🇦🇺Australia elc
Switching to NW for some small testing of gitlab config.
Probably nothing to see here.
- Status changed to Fixed
about 1 year ago 6:25am 24 November 2023 - 🇦🇺Australia elc
Now the OPT_IN_* tests actually work and 2.0.x is being tested against the other versions of Drupal core, major/minor and PHP release.
The indenting was an issue in .gitlab.yml, it was the missing "variables:" keyword.
Automatically closed - issue fixed for 2 weeks with no activity.