Problem/Motivation

We were using this for a while, but in one of the refactorings went back to using 'dependencies'. This allows, for example, phpstan to start running as soon as composer finishes, without waiting for yarn to also finish.

https://docs.gitlab.com/ee/ci/yaml/#needs

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Note the phpcs and phpstan jobs queued even while the yarn job is still queued.
Gitlab screenshot showing jobs in later stage queued while jobs in the first stage are still queued

API changes

Data model changes

Release notes snippet

Issue fork drupal-3390073

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

catch created an issue. See original summary.

catch’s picture

Status: Active » Needs review

catch’s picture

Issue summary: View changes
catch’s picture

Issue summary: View changes
Parent issue: » #3386474: [omnibus] Speed up gitlab ci runs
StatusFileSize
new142.74 KB
fjgarlin’s picture

Status: Needs review » Reviewed & tested by the community

Quick win. Changes look good. RTBC.

wim leers’s picture

+1 for needs.

P.S.: I wish GitLab's docs at https://docs.gitlab.com/ee/ci/yaml/ were clearer on when to use needs vs dependencies.

catch’s picture

Title: Use 'needs' instead of 'dependencies' to speed up gitlab CI jobs » Use 'needs' instead of 'dependencies' to speed up gitlab CI jobs and run phpstan first
Status: Reviewed & tested by the community » Needs review

Sorry one more tweak - if we move phpstan higher up in the YAML, it'll get queued first as soon as composer finishes, giving it more of a chance of finishing when the other jobs do.

fjgarlin’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed and still looks good imo. It only changes the order of the phpcs vs phpstan, but the jobs are exactly the same.
Note that the UI sorts alphabetically (emoji and then name), so the change is only visible in code. ie: https://git.drupalcode.org/project/drupal/-/pipelines/24180

RTBC.

catch’s picture

Issue summary: View changes
StatusFileSize
new138.38 KB

lauriii made their first commit to this issue’s fork.

lauriii’s picture

Status: Reviewed & tested by the community » Needs review

It looks like the pipeline is failing for this both before and after the rebase. Am I missing something?

lauriii’s picture

Status: Needs review » Fixed

@catch pointed out on Slack that the CI is failing due to something that shouldn't be impacted by the changes here:

ERROR: Job failed: prepare environment: waiting for pod running: pulling image "drupalci/php-8.2-apache:production": image pull failed: rpc error: code = Unknown desc = Error response from daemon: Head "https://registry-1.docker.io/v2/drupalci/php-8.2-apache/manifests/production": received unexpected HTTP status: 503 Service Unavailable. Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information

Committed 6950ec5 and pushed to 11.x. Thanks!

  • lauriii committed 6950ec5b on 11.x
    Issue #3390073 by catch, fjgarlin: Use 'needs' instead of 'dependencies...

Status: Fixed » Closed (fixed)

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