arcade icon indicating copy to clipboard operation
arcade copied to clipboard

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

Open akoeplinger opened this issue 3 years ago • 5 comments

  • [ ] 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 avatar Feb 07 '22 13:02 akoeplinger

@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.

riarenas avatar Feb 10 '22 21:02 riarenas

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?

mmitche avatar Feb 11 '22 15:02 mmitche

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

riarenas avatar Feb 11 '22 16:02 riarenas

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.

akoeplinger avatar Feb 11 '22 22:02 akoeplinger

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.

riarenas avatar Feb 14 '22 17:02 riarenas