Make composer installation steps reusable snippets

Created on 15 May 2025, 21 days ago

Problem/Motivation

📌 Consider merging the build and validate stages Active (comment 7) or the some times reported issue of artifacts too big (last instance in this slack converation for this job).

If we could isolate the composer / yarn install steps we could potentially:
- Run everything as usual
- Skip this in the "composer" job, leaving artifact size really small, and then calling the snippet when needed inside each job, for example in the "before_script".
--- We could also do this variable-driven as I suggested in the other issue.

Proposed resolution

Discuss approach and see options. Pay attention to BC.

Feature request
Status

Active

Component

gitlab-ci

Created by

🇪🇸Spain fjgarlin

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

Comments & Activities

  • Issue created by @fjgarlin
  • 🇪🇸Spain fjgarlin

    The comment that I make reference to:
    --
    We could defo run things based on a variable (name to be determined) as that's easy enough to trigger or not full jobs (via rules) and to check in the very first part of the script for each job.

    Example (pseudocode):

    variables:
      NEW_VARIABLE: 1
    
    .run-composer-steps: &run-composer-steps
    - do the composer things
    
    composer:
      rules:
        - if NEW_VARIABLE == 0
      script
        - *run-composer-steps
    
    cspell (for example):
      # Drop the "needs" part
      script:
        - if NEW_VARIABLE == 1 OR no-asset-from-composer-found
            *run-composer-steps
          endif
       - rest of the job script
    

    That way we could experiment and turn on/off as needed.

Production build 0.71.5 2024