microsoft / microsoft/azure-devops-python-api

Client Returns undefined while checking get_feature_state_for_scope for new project

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

還沒有人認領這個 Issue。

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

描述

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

貢獻指南

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

從這裡開始

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

研究方向

先檢視 issue 中所示的 Python 功能管理用戶端與 get_feature_state_for_scope 呼叫,然後將其 undefined 回應與 Azure DevOps 所記錄的功能狀態行為進行比較。判斷 undefined 是預期的繼承狀態,還是用戶端/API 缺陷;完成的標準是記錄該行為,或找出為返回正確狀態所需的可重現變更。

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

評估

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

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

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