dotnet / dotnet/arcade

Can't override jobs.yml parameters like disableComponentGovernance from job

Open
#8,440 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
729
Forks
397
Avg merge
3d 15m
Merged PRs (30d)
149

Description

- [ ] This issue is blocking
- [ ] This issue is causing unreasonable pain

Given a .yml like this:

```yml
stages:
- stage: build
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
jobs:
- job: Build_Linux
timeoutInMinutes: 120
disableComponentGovernance: true # <--- this causes an error
steps:
....
```

results in an Azure Pipelines error:
```
/eng/common/templates/jobs/jobs.yml (Line: 45, Col: 3): 'disableComponentGovernance' is already defined
```

If I read it correctly this happens because this code passes along parameters from jobs.yml into the job.yml so we end up with one `disableComponentGovernance` from jobs.yml and one from the `job`: https://github.com/dotnet/arcade/blob/3cbeb243091dab28adfdcd09fc43b77112cfbe72/eng/common/templates/jobs/jobs.yml#L44-L51

The same happens with the other parameters that are forwarded, like `continueOnError` etc.

/cc @mmitche

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.