microsoft / microsoft/azure-devops-python-api

Add support for using generic query in get_builds or rather any API call that supports AZ Cli --query parameter

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

還沒有人認領這個 Issue。

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

描述

I am trying to get builds which triggers only on pull requests to main.

az pipelines runs list  --query [? contains(sourceBranch,'refs/pull')]

Above command gives me all builds that uses source branch as refs/pull/<pr_number>/merge

In get_builds method of build client there is no way to do this.

branch_name parameter works only when you specify explicit branch name.

I realized that I could use "reason_filter=pullRequest" but it would be helpful if generic query parameter is supported in all those API calls where, AZ cli has --query parameter.

Is there any way to specify query in such API requests?

def get_builds(self, project, definitions=None, queues=None, build_number=None, min_time=None, max_time=None, requested_for=None, reason_filter=None, status_filter=None, result_filter=None, tag_filters=None, properties=None, top=None, continuation_token=None, max_builds_per_definition=None, deleted_filter=None, query_order=None, branch_name=None, build_ids=None, repository_id=None, repository_type=None):

貢獻指南

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

從這裡開始

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

研究方向

從 BuildClient.get_builds 入口點開始,將其參數與 issue 中所示的 Azure CLI --query 行為進行比較。確定哪些 API 呼叫應接受通用查詢,以及這如何配合它們現有的簽名;當 get_builds 的要求篩選功能正常運作,且支援的範圍已由測試涵蓋時,即表示完成。

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

評估

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

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

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