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 摘要。