You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been looking at blogs from other parties (such as this one) to see what the Azure DevOps REST API expects for creating a new pipeline. Thanks to those, I made the following fetch request:
And this works as expected, where it creates a pipeline within Azure DevOps (assuming the properties in the sample fetch exist).
Actual behaviour
To create a new YAML pipeline, the type definition of IPipelinesApi.createPipeline() requires me to call the function as follows:
constproject='MyProject';constpipelinesApi=awaitazureDevOps.getPipelinesApi();constpipeline=awaitpipelinesApi.createPipeline({name: 'test',folder: '/',configuration: {type: ConfigurationType.Yaml,// An enum which is equal to literal value 1}},project);
This results in the following error thrown:
Error: This API does not support creating pipelines of configuration type Yaml.
at RestClient.<anonymous> (node_modules/typed-rest-client/RestClient.js:202:31)
at Generator.next (<anonymous>)
at fulfilled (node_modules/typed-rest-client/RestClient.js:6:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
This seems to make sense. When I reproduce the request that is made, which would look like the following:
This happens because the value 1 is not valid for configuration.type. It should be the string literal yaml in case you want to make a YAML pipeline. I expect more errors to occur when that single issue is fixed, since there is no way to specify a repository name or path to the yaml file.
The text was updated successfully, but these errors were encountered:
Environment
Node version: v18.19.0
Npm version: 10.2.3
OS and version: Linux 5.10.102.1-microsoft-standard-WSL2 - linux/x64
azure-devops-node-api version: 13.0.0
Issue Description
The new
IPipelinesApi.createPipeline()
that has been published under version 13 seems to have several incompatibilities with the Azure DevOps REST API for creating a YAML pipeline. The function accepts an incomplete list of values that the REST API requires. The expected values seem to be copied directly from what is documented in the REST API documentation, but that documentation is NOT correct.IPipelinesApi.createPipeline()
and the the documentation at https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/create?view=azure-devops-rest-7.1 should be corrected to reflect the parameters that the REST API actually expects.Expected behaviour
I've been looking at blogs from other parties (such as this one) to see what the Azure DevOps REST API expects for creating a new pipeline. Thanks to those, I made the following
fetch
request:And this works as expected, where it creates a pipeline within Azure DevOps (assuming the properties in the sample
fetch
exist).Actual behaviour
To create a new YAML pipeline, the type definition of
IPipelinesApi.createPipeline()
requires me to call the function as follows:This results in the following error thrown:
This seems to make sense. When I reproduce the request that is made, which would look like the following:
I get the same error in the body of the REST API.
This happens because the value
1
is not valid forconfiguration.type
. It should be the string literalyaml
in case you want to make a YAML pipeline. I expect more errors to occur when that single issue is fixed, since there is no way to specify a repository name or path to the yaml file.The text was updated successfully, but these errors were encountered: