microsoft / microsoft/azure-devops-python-api
Defining "auto_complete_set_by" attribute to GitPullRequest object doesn't make PR auto-completed
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 684
- フォーク
- 218
- 平均マージ
- 8日 10時間
- マージ済み PR(30日)
- 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!
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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