microsoft / microsoft/azure-devops-python-api

PipelinesClient is missing model implementation for pipeline creation

未關閉
#432 0 則留言 8 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
Python
星號
684
分支
218
平均合併
8 天 10 小時
30 天內合併 PR
1

描述

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

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 models.py 中的 CreatePipelineConfigurationParameters 開始,將其目前的欄位與 issue 中可正常運作的範例進行比較。檢查 RepositoryReference 的表示方式,以及這些模型如何為建立 pipeline 進行序列化。當 client 可以使用 issue 中描述的 repository 和 path 值建立 pipeline 時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
azure, python
領域
api, devops
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。