firecow: 'parallel' property type must be integer at test-only changes.parallel

Created on 5 August 2024, 5 months ago
Updated 22 August 2024, 4 months ago

Problem/Motivation

β€’ 'parallel' property type must be integer at test-only changes.parallel
Specification docs agrees this should be an integer between 1 and 200.
https://docs.gitlab.com/ee/ci/yaml/#parallel

Steps to reproduce

$ gitlab-ci-local --version
4.52.2

$gitlab-ci-local \
  --remote-variables git@git.drupal.org:project/gitlab_templates=includes/include.drupalci.variables.yml=main \
  --cleanup \
  --no-artifacts-to-source \
  --variable="_GITLAB_TEMPLATES_REPO=project/gitlab_templates" \
  "$@"

Proposed resolution

Set an integer for parallel value or remove if not needed.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Fixed

Component

gitlab-ci

Created by

πŸ‡ΊπŸ‡ΈUnited States cmlara

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

Merge Requests

Comments & Activities

  • Issue created by @cmlara
  • πŸ‡ΊπŸ‡ΈUnited States cmlara
  • πŸ‡ͺπŸ‡ΈSpain fjgarlin

    I think I need more information to debug this. Can you paste the output as well? Which module are you running it with? Which β€œparallel” is it making reference to?

  • πŸ‡ͺπŸ‡ΈSpain fjgarlin

    See comments 36 to 38 in #3418831: Test-only job β†’ . Adding a value there makes it a bit more confusing in the GitLab UI, and it seems to be valid yaml/GitLab CI syntax, so I'm not sure what options we have that would not be disruptive for the GitLab CI users. I wonder if it's an issue with the "firecow" package.

  • πŸ‡ΊπŸ‡ΈUnited States cmlara

    Adding a value there makes it a bit more confusing in the GitLab UI... I'm not sure what options we have that would not be disruptive for the GitLab CI users. I wonder if it's an issue with the "firecow" package (https://github.com/firecow/gitlab-ci-local/issues)

    I'm not sure at the moment, would need more testing and looking at the original root issue in Gitlab along with their parser library and test a few scenarios with firecow.

    While I spend more time looking into that to determine where this needs to be fixed I do want to look at this quote from the original issue:

    One thing I discovered is that if the main phpunit job has been customised to run with a parallel matrix then this is replicated into the 'test-only changes' job, and that means that each of the changed tests are run in every parallel stream. The jobs are duplicated and it is a waste of resources - we only want one 'test-only changes' job

    Is that actually a valid assumption?

    Grabbing the REDIS module (it is the only one I know off hand that uses parallel):

      parallel:
        matrix:
          - REDIS_INTERFACE:
              - PhpRedis
              - Predis
              - Relay
    

    We are making the assumption that purging the parallel jobs being ignored is 'safe' in the name of resource consumption. What if the bug only occurs with one of the 3 interfaces? What if the values in the matrix are necessary for test run success? In fairness a lot of bugs will impact globally and we will save some time (assuming a value in the matrix is not required for a successful test run) however speaking as a maintainer (I have not needed parallel yet) the first time I hit this I'm re-adding parallel back into the test-only job and shaking my head in frustration that what would of been a 5 second click of a button turns into an hour long fix session.

  • πŸ‡ͺπŸ‡ΈSpain fjgarlin

    Since "parallel" can have different use cases, like number of parallel processes running the same job, or parallel processes running with different options, the assumption that we did in the mentioned issue might be wrong. The example that you provide there is a great one, that would be lost with the current setup.

    As there is a "loss" with the current approach, the job is a manual job, and the parallel option is not heavily used, I think that it might make sense to remove that line and document it in the https://project.pages.drupalcode.org/gitlab_templates/jobs/test-only-cha... page, in case somebody wants to keep the previous behavior (or bug, depends on how you look at it).

    I'll put together a quick MR with this and we can continue the discussion.

  • Status changed to Needs review 5 months ago
  • πŸ‡ͺπŸ‡ΈSpain fjgarlin

    Made the change and documented how to change the behavior if needed.

  • Status changed to RTBC 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States cmlara

    Looks good to me.

    Still looking if I need to file this in firecow however that does not require this issue to remain open.

  • πŸ‡¬πŸ‡§United Kingdom jonathan1055

    Yes I agree that removing the parallel: line makes sense. When I was working on the original issue I was not considering all of the uses of parallel. I do have a parallel matrix in Scheduler, to run the separate phpunit groups in different jobs, and with this MR and just two test files changed you can see that each of the five parallel jobs now run the same two changed tests:
    https://git.drupalcode.org/project/scheduler/-/pipelines/248004
    But I can customise the test-only job to remove parallel just like before

    The issue is still RTBC but I made a couple of suggestions in the help page

  • Pipeline finished with Skipped
    5 months ago
    #248040
    • fjgarlin β†’ committed 79dda4d6 on main
      Issue #3466101 by fjgarlin, cmlara, jonathan1055: firecow: 'parallel'...
  • Status changed to Fixed 5 months ago
  • πŸ‡ͺπŸ‡ΈSpain fjgarlin

    Merged! Thanks for the issue/fix/tests/reviews.

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

Production build 0.71.5 2024