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

Đang mở
#404 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ả

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):

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với entry point BuildClient.get_builds và so sánh các tham số của nó với hành vi Azure CLI --query được thể hiện trong issue. Xác định những lệnh gọi API nào nên chấp nhận một truy vấn generic và điều đó phù hợp với các chữ ký hiện có của chúng như thế nào; công việc được xem là hoàn tất khi tính năng lọc được yêu cầu hoạt động cho get_builds và phạm vi được hỗ trợ được kiểm thử.

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, python
Lĩnh vực
api, devops
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.