Files
ChonchiOG fec2e80f02
Some checks failed
build / unused-deps (push) Has been cancelled
build / yamllint (push) Has been cancelled
build / smoke-test (push) Has been cancelled
build / eslint (push) Has been cancelled
build / jest (push) Has been cancelled
build / CodeQL (push) Has been cancelled
Fix environment-scoped variables with matrix jobs (#1726)
* Fix environment-scoped variables with matrix jobs

When using parallel matrix jobs with dynamic environment names
(e.g., `environment: name: $CLUSTER`), all matrix jobs after the
first one received the wrong environment-scoped variables.

Root cause: When `jobData.environment` is an object, it was assigned
by reference instead of being cloned. The subsequent mutation of
`this.environment.name` during variable expansion would affect all
matrix job instances sharing the same `jobData` object.

Fix: Clone the environment object using spread operator when it's
an object, similar to how `predefinedVariables` is handled in
parser.ts line 182.

Fixes #1725

* Add regression test for environment object cloning fix (#1725)

This test verifies that the environment object is properly cloned
(using spread operator) to prevent shared mutation between matrix jobs.

The test reads src/job.ts and checks for the spread operator pattern,
ensuring the fix cannot be accidentally removed.

* Fix linting: add YAML document start and fix object spacing

---------

Co-authored-by: Renier <renier.velazco@lmco.com>
2026-01-27 08:40:59 +01:00
..
2025-12-12 18:24:21 +01:00
2025-03-01 12:46:26 +01:00
2024-10-10 20:53:41 +02:00
2024-10-10 20:53:41 +02:00