Search code examples
azure-devopsazure-pipelinesazure-devops-self-hosted-agent

Can I force ADO to disregard a build agent demand?


We are running Azure DevOps Server and we have our own, locally hosted build agents. I'm trying to get a WhiteSource scan to run on one of our build agents. The WhiteSource task "demands" node.js. But none of our projects use node.js at all, so whether the agents have node.js installed is totally irrelevant. I can't identify an option that could be used to stop the WhiteSource task making this demand.

Is there a way to cancel the demand? A way to tell ADO "this task/pipeline is going to demand node.js, but in fact I know better; you may disregard that demand and run the pipeline even on a build agent that doesn't have node.js installed"?

The build pipeline is a YAML pipeline. I would like a YAML-only solution if possible.

I would like to avoid actually installing node.js on our build agents, given that the dependency on it is entirely spurious; it would never actually be used.


Solution

  • Is there a way to cancel the demand?

    The demand of some agents is automatically added according to the needs of the task.

    In this case, we cannot cancel these demands.

    For a workaround to solve this issue, you can manually set the node.js in Agent Pools -> Target self agent -> Capabilities -> User-defined capabilities.

    enter image description here

    It can also meet the demand of the pipeline without actually installing node.js.