Skip to content

!reference tag usage with parallel:matrix keyword results in unexpected config should be an array of hashes errors

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

When trying to use !reference tags for parallel:matrix, an error is displayed:

This GitLab CI configuration is invalid: jobs:build_jobs:parallel:matrix config should be an array of hashes.

Steps to reproduce

  1. Add .gitlab-ci.yml with below content:
.VUE_APPS: 
 - APP_NAME: frontend
 APP_DIR: frontend
 
.DOTNET_APPS: 
 - APP_NAME: myapi1 
 APP_DIR: /apis/api1
 BASE_IMAGE: <registry_url>/aspnet6
 - APP_NAME: myapi2 
 APP_DIR: /apis/api2
 BASE_IMAGE: <registry_url>/nginx:alpine

build_jobs:
 stage: build
 parallel:
 matrix:
 - !reference [.VUE_APPS]
 script: 
 - echo "test"
  1. Go to pipeline editor and it will give the error message:
This GitLab CI configuration is invalid: jobs:build_jobs:parallel:matrix config should be an array of hashes.

What is the current bug behavior?

!reference tags don't work when merging array for parallel:matrix.

What is the expected correct behavior?

Support merging parallel:matrix arrays using !reference tags.

Relevant logs and/or screenshots

Screenshot_2024-01-30_at_18.37.12

Output of checks

This bug happens on GitLab.com

Edited by 🤖 GitLab Bot 🤖