Azure / Azure/azure-devops-cli-extension

[Feature Request] fix az devops wiki page create The versionType should be 'branch' and version cannot not be null API 5.1

Open
#1,453 0 comments 0 reactions 0 assignees View on GitHub
Feature
Dominant language
Python
Stars
682
Forks
278
Avg merge
3d 23h
Merged PRs (30d)
3

Description

Reproduce the same issue when use the same Rest API to create Wiki Page.

az devops wiki page create --path 'my page' --organization https://dev.azure.com/$OrganizationName --verbose --debug --detect --project 'mywiki' --wiki test --file-path test1.md --encoding utf-8

The cause of the issue is from the Azure DevOps CLI extension itself.

When you add the --debug argument in Azure DevOps CLI, you will see that the az devops wiki page create command is using the Rest API version 5.0.

azext_devops.devops_sdk.client: Api version '5.0'

Refer to this doc about [Pages - Create Or Update Version 5.0](https://learn.microsoft.com/en-us/rest/api/azure/devops/wiki/pages/create-or-update?view=azure-devops-rest-5.0&tabs=HTTP) It doesn't support the parameters: versionType.

azext_devops.devops_sdk.client: Response content: b'{"$id":"1","innerException":null,"message":"The versionType should be \'branch\' and version cannot not be null\\r\\nParameter name: versionDescriptor","typeName":"Microsoft.TeamFoundation.SourceControl.WebServer.InvalidArgumentValueException, Microsoft.TeamFoundation.SourceControl.WebServer","typeKey":"InvalidArgumentValueException","errorCode":0,"eventId":0}'
msrest.exceptions: The versionType should be 'branch' and version cannot not be null

This parameter is available after Rest API version 5.1.

The root cause of the issue is that Azure DevOps CLI requires versionType parameter, but Azure DevOps CLI is using old version of Rest API which doesn't support the version type argument.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.