question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue
  • 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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
riarenascommented, Feb 14, 2022

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.
0reactions
akoeplingercommented, Feb 11, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jenkins - How to disable automatic build from scm change ...
Click "Add property", choose "Suppress automatic SCM triggering"; Save. That would prevent changes to the master branch from triggering a build ...
Read more >
Create and Configure Jobs and Pipelines Using YAML
In DevCS, you can use a YAML file (a file with .yml extension) to store a job or a pipeline configuration in any...
Read more >
Jobs | GitLab
yml file, the variable is overridden with the new value. Any variables overridden by using this process are expanded and not masked. Manual...
Read more >
`.gitlab-ci.yml` keyword reference
Override a set of commands that are executed before job. cache, List of files that should be cached between subsequent runs. coverage, Code ......
Read more >
Configuring CI/CD Pipelines as Code with YAML in Azure ...
Navigate to your team project on Azure DevOps in a new browser tab. Before digging into the YAML pipelines, you will want to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found