azure-devops-python-api icon indicating copy to clipboard operation
azure-devops-python-api copied to clipboard

PipelinesClient is missing model implementation for pipeline creation

Open sknopp opened this issue 3 years ago • 0 comments

Hi,

i tried to create a build pipeline with the azure.devops.v6_0.pipelines.PipelinesClient and noticed that this is currently not possible because of a missing model definition within the CreatePipelineConfigurationParameters. This object currently only has a type attribute but it also needs (at least) a repository and a path attribute to refer the corresponding repository. Attached you'll find a minimal working example for my case. I don't know which fields might be missing in addition to get it working in general.

I found my solution in this blog post and I'll move to a simple requests call for this case until it is fixed.

class CreatePipelineConfigurationParameters(Model):
    """
    Configuration parameters of the pipeline.

    :param type: Type of configuration.
    :type type: object
    """

    _attribute_map = {
        'path': {'key': 'path', 'type': 'object'},
        'repository': {'key': 'repository', 'type': 'RepositoryReference'},      # currently missing
        'type': {'key': 'type', 'type': 'object'},                                                # currently missing
    }

    def __init__(self, path=None, repository=None, type=None):
        super(CreatePipelineConfigurationParameters, self).__init__()
        self.path = path
        self.repository = repository                                                            # currently missing
        self.type = type                                                                               # currently missing

# currently missing, added as minimal working sample
class RepositoryReference(Model):
    _attribute_map = {
        'id': {'key': 'id', 'type': 'object'},
        'type': {'key': 'type', 'type': 'object'}
    }

    def __init__(self, id=None, type=None):
        self.id = id
        self.type = type

sknopp avatar Sep 23 '22 11:09 sknopp