microsoft / microsoft/azure-devops-python-api

Client Returns undefined while checking get_feature_state_for_scope for new project

Đang mở
#482 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ả

Hello Team,

I am using python API to check if there are some features enabled/disbaled at Project level e.g Repo's and Pipeline's.

Issue is that when a Private Project is created, everything is enabled by default. When I check the state for such projects it returns undefined

Below is the sample code and results:

    feature_client = connection.clients_v7_0.get_feature_management_client()
    repo: ContributedFeatureState = feature_client.get_feature_state_for_scope(feature_id='ms.vss-code.version-control', user_scope='host', scope_name='project', scope_value='<PROJECT_ID/NAME>')
    pipeline: ContributedFeatureState = feature_client.get_feature_state_for_scope(feature_id='ms.vss-build.pipelines', user_scope='host', scope_name='project', scope_value='<PROJECT_ID/NAME>')
    print(repo)
    print(pipeline)

Results:

{
    'additional_properties': {}, 
    'feature_id': 'ms.vss-code.version-control', 
    'overridden': None, 
    'reason': None, 
    'scope': <azure.devops.v7_0.feature_management.models.ContributedFeatureSettingScope object at 0x10f2c2580>, 
    'state': 'undefined'
}

{
    'additional_properties': {}, 
    'feature_id': 'ms.vss-build.pipelines', 
    'overridden': None, 
    'reason': None, 
    'scope': <azure.devops.v7_0.feature_management.models.ContributedFeatureSettingScope object at 0x10f2c2af0>,
    'state': 'undefined'
}

When I manually disable these features at Project level then it is able to identify them:

Disabled:

{
    'additional_properties': {}, 
    'feature_id': 'ms.vss-code.version-control', 
    'overridden': None, 
    'reason': None, 
    'scope': <azure.devops.v7_0.feature_management.models.ContributedFeatureSettingScope object at 0x1019d4580>, 
    'state': 'disabled'
}

{
    'additional_properties': {}, 
    'feature_id': 'ms.vss-build.pipelines', 
    'overridden': None, 
    'reason': None, 
    'scope': <azure.devops.v7_0.feature_management.models.ContributedFeatureSettingScope object at 0x1019d4af0>, 
    'state': 'disabled'
}

enabled back again:

{
    'additional_properties': {}, 
    'feature_id': 'ms.vss-code.version-control',
    'overridden': None, 
    'reason': None, 
    'scope': <azure.devops.v7_0.feature_management.models.ContributedFeatureSettingScope object at 0x1050d4580>, 
    'state': 'enabled'
}
{
    'additional_properties': {}, 
    'feature_id': 'ms.vss-build.pipelines', 
    'overridden': None, 
    'reason': None, 
    'scope': <azure.devops.v7_0.feature_management.models.ContributedFeatureSettingScope object at 0x1050d4af0>, 
    'state': 'enabled'
}

Can you please guide on this, shall we assume that if it is undefined it is enabled

Best
Jashan

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 bằng cách xem xét client Python quản lý tính năng và lệnh gọi get_feature_state_for_scope được nêu trong issue, sau đó so sánh phản hồi undefined của nó với hành vi trạng thái tính năng được ghi lại của Azure DevOps. Xác định xem undefined có phải là trạng thái kế thừa được mong đợi hay là lỗi của client/API; hoàn tất khi đã ghi lại hành vi hoặc xác định được thay đổi có thể tái hiện cần thiết để trả về trạng thái chính xác.

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
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
25/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.