microsoft / microsoft/azure-devops-python-api

Defining "auto_complete_set_by" attribute to GitPullRequest object doesn't make PR auto-completed

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

還沒有人認領這個 Issue。

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

描述

Hi, I'm seeing an unexpected behaviour when I try to create a PR that auto-completes.
This is a snippet:

import azure.devops as azdo 
import azure.devops.released.git as azdo_git
...

pr = azdo_git.GitPullRequest(
                    auto_complete_set_by=(
                    azdo_git.IdentityRef(id="<some id>")
                    ),
                    title='title',
                    description='description',
                    source_ref_name='source_ref_name',
                    target_ref_name='target_ref_name',
                    completion_options=azdo_git.GitPullRequestCompletionOptions(
                        # also tried with merge_strategy=False,  same result
                        merge_strategy="noFastForward", 
                        delete_source_branch=True, triggered_by_auto_complete=True
                    ),
                    reviewers=self.set_pr_reviewers(self.pr_reviewer_ids),
                )

azdo_connection = azdo.connection.Connection(base_url=self.organization_url, creds=credentials)
git_client = azdo_connection.clients.get_git_client()

repository_id = "<some repo id>"
project_id = "<some project id>"

git_client.create_pull_request(
                pr,
                repository_id,
                project_id,
            )

I have made sure that the user ID for auto-complete is correct (the one passed into IdentityRef())

the resulting PR is successfully created, all looks good except it's not auto-completed. The PR has no attached pipeline or branch policy, so I can't figure out why it won't work.

Any help is appreciated, thanks!

貢獻指南

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

從這裡開始

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

研究方向

從 GitPullRequest.auto_complete_set_by 和 GitPullRequestCompletionOptions 欄位開始,然後追蹤 git_client.create_pull_request 如何傳送它們。將產生的請求與 Azure DevOps 的自動完成要求進行比較;完成的標準是,在所述條件下建立的 pull request 會自動完成。Issue 中未指定檔案或測試。

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

評估

技術堆疊
azure, git, python
領域
api
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
30/100

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

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