Can't override jobs.yml parameters like disableComponentGovernance from job
- [ ] This issue is blocking
- [ ] This issue is causing unreasonable pain
Given a .yml like this:
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
@akoeplinger Is this blocking things? I think for the particular case of disableComponentGovernance we might just want to get rid of it from jobs.yml, as I don't think we ever want to be in a world where CG is disabled for an entire set of jobs.
Yeah, that makes sense. I think removing it from the top level is the best thing to do. What jobs do you need to disable CG for?
What jobs do you need to disable CG for?
I think this is related to the task not working in alpine containers, causing builds to be yellow: https://dev.azure.com/dnceng/internal/_build/results?buildId=1607090&view=results
yes exactly. it's not blocking right now since the task no longer causes an error but the warning is just noise.
Removing the property from jobs.yml sounds like a good solution.
I'm going to split this issue:
- https://github.com/dotnet/arcade/issues/8470 to remove the disableCompnenetGovernance property from jobs.yml
- This issue for the yaml bug of not being able to set properties we do want to keep in both job and jobs templates.