Add the gitlab-ci template file.

Issue fork scanner-3440527

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

Assigned: Unassigned » damienmckenna
damienmckenna’s picture

It'd be useful to be able to skip the Drupal.NamingConventions.ValidFunctionName.InvalidPrefix test in phpcs.

damienmckenna’s picture

Status: Active » Needs work

Something's causing the pipelines to not run.

jonathan1055’s picture

The error

jobs d7 drupal test dependencies config should implement a script: or a trigger: keyword

means you have invalid yml (also shown in the colored tags by the pipeline). You are missing the variables: keyword, because the 'd7 drupal test dependencies' is being interpreted as job names.

damienmckenna’s picture

The current test failures are due to problems with the Devel module, so I opened a merge request for it:

damienmckenna’s picture

Thanks to fjgarlin for the syntax tip for the "exclude" option.

damienmckenna’s picture

Title: Add Gitlab CI template file » Add Gitlab CI template file [D7]
damienmckenna’s picture

I think we might need to try loading the devel module from D7Security via a composer.json file.

fjgarlin’s picture

I made some changes to the MR to unblock the issue where it wouldn't go past composer and left a note in the MR to revert once #3442120: D7 pipeline fails: Uploading artifacts as "archive" to coordinator... 413 Request Entity Too Large is merged (that issue is in "needs review" now).

damienmckenna’s picture

Status: Needs work » Needs review

Thanks to help from fjgarlin and jonathan1055, this works now.

fjgarlin’s picture

Great!! Thanks for the back and forth, it was really useful to improve the templates for Drupal 7. I am glad we've found a way to make it work.

I left a couple of comments in the MR.

damienmckenna’s picture

It's weird - the last commit, to leverage _D7_DRUPAL_TEST_DEPENDENCIES to download the dependencies instead of before_script, seems to cause the custom download of Devel to be replaced by by the d.o version.

fjgarlin’s picture

Umm, what makes you think that it's using the "devel" version of d.o?

fjgarlin’s picture

Maybe it was a one-off error kind of thing?
I re-ran the pipeline and it was green: https://git.drupalcode.org/issue/scanner-3440527/-/pipelines/155305

damienmckenna’s picture

The Devel version on d.o doesn't have PHP 8 fixes, which is why it fails with this error:

Exception Deprecated devel_generate.in  464 devel_generate_word()              
    Implicit conversion from float 31461.000000000004 to int loses precision

It is definitely weird that it worked on the second run.

fjgarlin’s picture

That line seems to be exactly the same in both versions:
- d.o: https://git.drupalcode.org/project/devel/-/blob/7.x-1.x/devel_generate/d...
- gitlab.com: https://gitlab.com/d7security/devel/-/blob/7.x-1.x/devel_generate/devel_...

For what is worth, I don't think that it would have tried to bring it from d.o as we are adding the --source attribute, so whatever the problem is seems to be in the gitlab.com version of it.

So it's probably worth opening the issue upstream and fixing in there.

damienmckenna’s picture

I submitted a comments-only change to the merge request and it failed again. Running it locally I spotted where it hits a different number of errors each time, but I can reproduce the problem.

I'll submit another MR to Devel.

fjgarlin’s picture

Perfect! I think the MR for this issue is looking pretty good already, so once that upstream issue is created/merged it should all be good (and consistent 🙂).

damienmckenna’s picture

I submitted a MR for Devel to fix the bug: https://gitlab.com/d7security/devel/-/merge_requests/3

damienmckenna’s picture

The way the test logic was set up there were scenarios where the tests didn't run properly, so the logic from Devel wasn't actually running. I made some changes to improve the generated test data so it'll be better at triggering the problem.

  • DamienMcKenna committed 34997ae6 on 7.x-1.x
    Issue #3440527 by DamienMcKenna, jonathan1055, fjgarlin: Gitlab-CI setup...
damienmckenna’s picture

Status: Needs review » Fixed

Committed.

damienmckenna’s picture

Assigned: damienmckenna » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.