microsoft / microsoft/azure-devops-python-api

Can get a task definition by id.

未关闭
#288 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
684
派生
218
平均合并
8 天 10 小时
30 天内合并 PR
1

描述

Having a task definition reference by id it's not possibled to have it retrieved.
I'm reffering to TaskDefinitionReference which is present both in task_agent_client.pyand build_client.py.

For example getting a pipeline definition and having mutiple build steps like

            {
              'environment': {},
              'enabled': True,
              'continueOnError': False,
              'alwaysRun': True,
              'displayName': 'Publish Artifact',
              'timeoutInMinutes': 0,
              'condition': 'succeededOrFailed()',
              'task': {
                **'id': '2ff763a7-ce83-4e1f-bc89-0ae63477cebe',**
                'versionSpec': '1.*',
                'definitionType': 'task'
              },
              'inputs': {
                'PathtoPublish': '$(build.artifactstagingdirectory)',
                'ArtifactName': 'drop',
                'ArtifactType': 'Container',
                'TargetPath': '\\\\my\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)',
                'Parallel': 'false',
                'ParallelCount': '8',
                'FileCopyOptions': ''
              }
            }

I would like to be able to retrieve all task step related by using the task -> id
Something like task_agent_client.get_task_by_id(task_id= '2ff763a7-ce83-4e1f-bc89-0ae63477cebe') and will return an object of type
class:TaskDefinitionReference <azure.devops.v5_1.task_agent.models.TaskDefinition>

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先阅读 task_agent_client.py 和 build_client.py 中的 TaskDefinitionReference,然后跟踪如何获取 pipeline 任务引用。添加所请求的 task_agent_client.get_task_by_id 入口点,使任务 ID 返回一个 TaskDefinition 对象,并根据示例任务引用验证返回的数据。

由索引模型根据 Issue 内容生成。

评估

技术栈
azure, python
领域
api, devops
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。