Plan for initial codebase

Created on 30 January 2025, 3 months ago

Problem/Motivation

This project needs to cover several key set-ups of Contrib projects, to help us increase test coverage. This will need several branches, which may not differ by much. We can use the recognised version naming conventions as in regular contrib projects

Proposed resolution

Testing with Drupal 7

  1. Branch 7.x-1.x which does contain a composer.json file
  2. Branch 7.x-2.x which contain a composer.json file

Testing with Drupal 10

  1. Branch 3.x - which is also compatible with Drupal 9
  2. Branch 4.x - which is only also compatible with Drupal 10+

Within each branch, the .gitlab-ci.yml can define variants to test with the minimum and maximum PHP versions for the core releases being used.

📌 Task
Status

Active

Component

General / Miscellaneous

Created by

🇬🇧United Kingdom jonathan1055

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @jonathan1055
  • 🇬🇧United Kingdom jonathan1055

    To ensure that the validation and linting jobs are all run, the 3.x and 4.x branches should contain at least one file of each of the following types:

    • .php
    • .js
    • .css
    • .yml
    • .md

    In Drupal 7 testing, the only linting job is PHPCS so these extra file types are not needed.

  • 🇬🇧United Kingdom jonathan1055

    First pipeline was run on D10. Four out of the six linting jobs were run.
    https://git.drupalcode.org/project/gitlab_templates_downstream/-/pipelin...

    • composer-lint and cspell are always run (unless specifically skipped) so that is OK
    • phpstan was not run because there are no .php files (ok)
    • stylelint was not run because there are no .css files (ok)
    • eslint was run because we have one .yml (ok)
    • phpcs was run - there are no .php files but this is not in the jobs rules (needs to be checked)
  • 🇪🇸Spain fjgarlin

    We can use the recognised version naming conventions

    I am happy with that, but I'd also be ok with a non-standard setup where we maybe use long-verbose-names for the branches so that we know exactly what the branch is about.

    With the standard names, we'd need probably a main branch with a readme.md where it explains each branch.

  • 🇬🇧United Kingdom jonathan1055

    Yes using longer verbose names might be better, it was just that I was expecting we should mimic real D7 and D10 projects as much as possible, But you are right that the branch names are not salient to the testing purpose of the project.

    So using the names I suggested in the summry, would they instead become

    • d7-no-composer
    • d7-with-composer
    • d10-with-d9-legacy
    • d10-plus

    or something like that? I have only created 7.x-1.x so far, so will halt until we get these names agreed.

  • 🇪🇸Spain fjgarlin

    Slight change suggestion:

    • d7-basic
    • d7-composer
    • d9-plus
    • d10-plus

    Prefix should be the module's minimum (d9, d10, d11) and then whatever else makes sense after.

  • 🇬🇧United Kingdom jonathan1055

    Thanks, yes those are better. I have pushed d7-basic and d9-plus to see how it goes, before creating the other two.

    For the README.md we do not want to maintain four versions, do we? All info can be in one file, telling about all the branches. I have set 'd9-plus' as the default branch for now. But maybe 'd10-plus' will become the default when I make it, so the readme can be stored there (and there alone?), with the other three just having a url to that file? We want to make it as easy for us as possible.

  • 🇪🇸Spain fjgarlin

    How about main as default branch with only the readme file?

  • 🇬🇧United Kingdom jonathan1055

    OK, yes. It might be useful to have a branch which does not run a pipeline. In time that could be the default branch, but while developing it is useful to have one of the active branches as default to that a pipeline is run whenever a push is made.

    To prove the d7-basic test coverage, I submitted a pipeline via UI with gitlab_templates_ref 1.7.0 and it failed as expected. This shows that we had not catered for a missing composer.json, which is now fixed in 1.7.1
    https://git.drupalcode.org/project/gitlab_templates_downstream/-/pipelin...

    I have created 📌 Add Gitlab Templates Downstream testing project Active and triggered the first two downstream pipelines sucessfully.

  • 🇪🇸Spain fjgarlin

    it is useful to have one of the active branches as default to that a pipeline is run whenever a push is made.

    We can tweak/override the rules on any branch so the CI runs on push for that branch.

  • 🇪🇸Spain fjgarlin

    Great to see the two projects connecting and proving that we can control multiple cases from this project.

  • 🇪🇸Spain fjgarlin

    It's a great start!

    Feedback:
    - "main": it doesn't probably need a ".gitlab-ci.yml" file, unless we want to trigger the branch pipelines from there (maybe a daily scheduled task). I'd make this branch the default branch, it shouldn't interfere with running pipelines as/when needed on the other branches.
    - Then each branch's readme file should be about that branch/project only and explain briefly the case/s that it covers.
    - Each branch's "gitlab-ci.yml" file might have specific overrides for when to run the pipeline if the default setup won't trigger then on commit.

  • 🇬🇧United Kingdom jonathan1055

    I have changed 'main' to be the default and removed the README from each of the other branches before I saw your latest comment. I thought that in the first instance it would be simpler to have just one readme. But if you want one on each branch I can do that. The 'main' readme can be reduced to minimal, although at the moment there is not much to add anyway.

    One downstream pipeline failed, d7-composer, so I will look at that. I had not run that branch directly here.
    https://git.drupalcode.org/project/gitlab_templates_downstream/-/pipelin...

    "main": it doesn't probably need a ".gitlab-ci.yml" file, unless we want to trigger the branch pipelines from there (maybe a daily scheduled task).

    Initially I was going to say that we need to run the GTD pipelines everyday, as there should be nothing that changes in them that we do not do ourselves, and we will be triggering them during gitlab templates MR testing quite frequently. But maybe it would be reassuring to know that the infrastructure is always OK and the pipelines are green, so that if we get a failure from a downstream then we know it has to be caused by the MR and not a previously existing error.

  • 🇪🇸Spain fjgarlin

    I think it looks cool to just have the minimal readme on main, and then each module just have the module's code itself. I don't think we need per-branch readme at all. Thanks for that.

    Happy to get that daily task from GTD. Maybe we can set up the file in main to trigger the 4 branches automatically (downstream style), that way we only need to set up one daily task.

  • 🇪🇸Spain fjgarlin

    As for the composer error. We don't get Drupal 7 via composer, so the line here ( "drupal/core": "^7") fails.

    We can just try it to bring external dependencies, like here on the "API" project or drupal modules, like here in the "Scheduler" project. Anything except for core D7 🙂

  • Merge request !8Draft: #3503337 general mr testing → (Open) created by jonathan1055
  • Pipeline finished with Success
    about 1 month ago
    Total: 275s
    #451020
  • Pipeline finished with Failed
    about 1 month ago
    Total: 186s
    #451027
  • Pipeline finished with Success
    about 1 month ago
    Total: 162s
    #451035
  • Pipeline finished with Success
    about 1 month ago
    Total: 344s
    #451069
  • Pipeline finished with Success
    about 1 month ago
    Total: 265s
    #451198
  • Pipeline finished with Failed
    about 1 month ago
    Total: 145s
    #451284
  • Pipeline finished with Failed
    about 1 month ago
    Total: 275s
    #451298
  • Pipeline finished with Failed
    about 1 month ago
    Total: 151s
    #451369
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 185s
    #451409
  • Pipeline finished with Failed
    about 1 month ago
    Total: 200s
    #451414
  • Pipeline finished with Success
    about 1 month ago
    Total: 265s
    #451418
  • Pipeline finished with Success
    about 1 month ago
    Total: 166s
    #452024
  • Merge request !13#3513352 Fix Nightwatch test on d9-basic → (Merged) created by jonathan1055
  • Pipeline finished with Success
    about 1 month ago
    Total: 159s
    #452227
  • 🇬🇧United Kingdom jonathan1055

    Just reviewing this issue to see if there anything else we need to do.

    From #2
    We have files with all those extensions except .css and .md.
    I have raised 📌 Add test coverage for stylelint job Active for the css checking.
    Only the 'main' branch has a .md file, but this is not triggered in the downstream pipelines. Do we need to add a .md file into the branches? Some phpcs checks are done on .md files. Or we could add 'GTD Main' into the downstream pipeline list? I was thinking that we don't have downstream coverage of the 'pages' job, so maybe we could use the main branch for that?

    From #3

    • eslint now also checks the Nightwatch .js file in addition to the .yml file. Running with _ESLINT_EXTRA = --verbose, search for yield: to show the files found and whether they were tested. It shows that two are checked gitlab_templates_downstream.info.yml and downstream-one.js
    • we now get PHPStan jobs because we added .php files for the phpunit tests
    • stylelint will be covered by the above issue
    • phpcs was run even though there were no files to check. Running with _PHPCS_EXTRA = -v shows 0 files - see this example on 'main' https://git.drupalcode.org/project/gitlab_templates_downstream/-/jobs/47... Maybe there is a mismatch between the job rules and the list of php files we derive. Could add issue in Gitlab Templates to investigate this

    The problem in #15 was fixed a while ago.

    I have added a paragraph about the git alias for comparing against the parent. Here is the updated file in MR14. Do I need to add the explanation as per in slack ?

  • 🇪🇸Spain fjgarlin

    Yup, maybe we can use the "main" branch to generate a small documentation site, where we have a page for each branch explaining what each branch is about. Something short but that will be enough to check md files and the pages job.

    Once done we can add it to the downstream files in case we do changes to the "pages" job.

    Given that you created the two follow-ups above, maybe we can create one for the "pages" documentation files for this project.

    I added some minor feedback to MR14.

  • Pipeline finished with Failed
    28 days ago
    Total: 189s
    #454343
  • Pipeline finished with Success
    28 days ago
    Total: 177s
    #454386
  • 🇬🇧United Kingdom jonathan1055

    Thanks. I have created 📌 Add documentation .md files to test the pages job Active and responded in MR14

  • Pipeline finished with Success
    24 days ago
    Total: 147s
    #457830
  • Pipeline finished with Success
    23 days ago
    Total: 186s
    #457849
  • Pipeline finished with Success
    23 days ago
    Total: 772s
    #457943
  • Pipeline finished with Failed
    17 days ago
    Total: 335s
    #462625
  • Pipeline finished with Failed
    17 days ago
    Total: 272s
    #462664
  • Pipeline finished with Failed
    17 days ago
    Total: 212s
    #463131
  • Pipeline finished with Success
    16 days ago
    Total: 188s
    #463251
  • Pipeline finished with Success
    16 days ago
    Total: 190s
    #463279
  • Pipeline finished with Success
    16 days ago
    Total: 163s
    #463313
  • 🇬🇧United Kingdom jonathan1055

    As we have the last follow-up issue I think we can set this issue to fixed.

    We can contiue to use MR8 as a general testing merge request, to try out things or use a specific Gitlab Templates MR. It does not matter that this issue will eventually become closed.

  • Status changed to Fixed 16 days ago
  • 🇪🇸Spain fjgarlin

    Agree, we can close and keep using MR8 as needed.
    Thanks!

  • Pipeline finished with Success
    15 days ago
    Total: 161s
    #464479
  • Pipeline finished with Failed
    14 days ago
    Total: 145s
    #465558
  • Pipeline finished with Success
    14 days ago
    Total: 134s
    #465568
  • Pipeline finished with Success
    14 days ago
    Total: 131s
    #465572
  • Pipeline finished with Success
    14 days ago
    Total: 173s
    #465585
  • Pipeline finished with Failed
    14 days ago
    Total: 134s
    #465717
  • Pipeline finished with Failed
    13 days ago
    Total: 186s
    #466259
  • Pipeline finished with Success
    12 days ago
    Total: 247s
    #466669
  • Pipeline finished with Success
    12 days ago
    Total: 141s
    #466750
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024