Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client Returns undefined while checking get_feature_state_for_scope for new project #482

Open
jashan05 opened this issue Feb 1, 2024 · 0 comments

Comments

@jashan05
Copy link

jashan05 commented Feb 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant