Grouping dynamic pipelines by environment

I’m generating jobs, but I’m unsure how to group them. What am I missing? My jobs have the structure like:

dev-data/19-foo-dependencies:
  script:
    - cd stacks/data/19-foo-dependencies
    - terraform fmt -check=true
    - make -f $CI_PROJECT_DIR/Makefile init env=dev account=data
    - terraform validate
    - make -f $CI_PROJECT_DIR/Makefile plan
  rules:
    - changes:
        - stacks/data/19-foo-dependencies/*
    - when: manual
stg-data/19-foo-dependencies:
  script:
    - cd stacks/data/19-foo-dependencies
    - terraform fmt -check=true
    - make -f $CI_PROJECT_DIR/Makefile init env=stg account=data
    - terraform validate
    - make -f $CI_PROJECT_DIR/Makefile plan
  rules:
    - changes:
        - stacks/data/19-foo-dependencies/*
    - when: manual

Be awesome to get your feedback and improvements!

@hendry

I’m unsure what you want to do. Are you looking to collapse the list of test jobs in this view or group another way?

Thanks!

-James H, GitLab Product Manager, Verify:Pipeline Execution

Hey @jheimbuck_gl !

Tbh I’m not sure how these ended up being “test jobs”. Also when they fail it doesn’t appear to bubble up to the main CI/CD Pipeline view.

I’m not looking to collapse the list (everything ideally needs to be in view), I’m looking to group by $ENV somehow. Also it would be great if the pills could be wider, since it’s difficult to read the name of the full service undergoing a TF plan.

I hope that made sense. :sweat_smile:

@hendry

I’m guessing that no stage is defined and test is the default. without seeing your .gitlab-ci.yml it’s a guess :wink:

There’s not a way to group things within the UI unless you’ve grouped them into a stage in the .gitlab-ci.yml file unfortunately.

-James H, GitLab Product Manager, Verify:Pipeline Execution

Ahhh! Thanks. I’ve add stages and stage: to every job, now my envs are nicely in two columns:

I still don’t understand how to bubble up the error though in the generate job run. I don’t want people thinking the CI passed when it in fact, failed. :sweat_smile:

@hendry

Are you using strategy: depend? docs link for you.

-James H, GitLab Product Manager, Verify:Pipeline Execution

1 Like

I’ve only just noticed that since having stages, if the first stage fails, the second stage isn’t run.

I am not sure how to tweak gitlab runner to run all the stages.

@hendry

allow_failure should do the trick but note that if you need artifacts from previous stages that may result in those jobs failing.

Hope this helps!

-James H, GitLab Product Manager, Verify:Pipeline Execution