microsoft / microsoft/azure-devops-python-api
Defining "auto_complete_set_by" attribute to GitPullRequest object doesn't make PR auto-completed
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 684
- Fork
- 218
- Merge trung bình
- 8 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
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!
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với các trường GitPullRequest.auto_complete_set_by và GitPullRequestCompletionOptions, sau đó lần theo cách git_client.create_pull_request gửi chúng. So sánh request tạo ra với các yêu cầu tự động hoàn tất của Azure DevOps; được coi là hoàn tất khi một pull request đã tạo tự động hoàn tất trong các điều kiện đã nêu. Issue không xác định tệp hoặc test nào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- azure, git, python
- Lĩnh vực
- api
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 30/100