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

[Appconfig] consistency check #19281

Merged
merged 66 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
5f23239
adding docstrings for displayname and description
seankane-msft Jun 16, 2021
184451f
changing key -> feature_id
seankane-msft Jun 16, 2021
4245462
fixing up secret reference for consistency
seankane-msft Jun 16, 2021
565be70
pylint fix
seankane-msft Jun 16, 2021
971ba34
updates to clients
seankane-msft Jun 21, 2021
89184a9
fixing tests
seankane-msft Jun 21, 2021
5679d8d
updates to clients
seankane-msft Jun 21, 2021
5125053
merge conflicts
seankane-msft Jun 21, 2021
8f60ae5
changing base_url -> endpoint
seankane-msft Jun 21, 2021
2d3cd14
undoing changes to generated
seankane-msft Jun 21, 2021
b9d01c8
adding changelog
seankane-msft Jun 21, 2021
4371f0f
updating changelog, enabled is kwarg
seankane-msft Jun 21, 2021
375481e
lint fixes
seankane-msft Jun 21, 2021
b791000
formatting
seankane-msft Jun 22, 2021
84939ed
using key instead of feature_id
seankane-msft Jun 22, 2021
8a01a16
feature_id strips key prefix
seankane-msft Jun 22, 2021
f8d277c
working for sync
seankane-msft Jun 22, 2021
c58a41f
removing if conditional on delete
seankane-msft Jun 22, 2021
bc2263d
doc and typehint
seankane-msft Jun 22, 2021
8fcede6
adding delete overload to async
seankane-msft Jun 22, 2021
b40fd10
fixing tests
seankane-msft Jun 22, 2021
37d0ece
adding back label to not be breaking
seankane-msft Jun 22, 2021
de563be
non breaking for delete
seankane-msft Jun 22, 2021
c8a4aa9
undoing breaking change
seankane-msft Jun 22, 2021
163decc
undoing rename of endpoint
seankane-msft Jun 22, 2021
f5154d0
undoing more breaking changes
seankane-msft Jun 22, 2021
d65d39f
fixing up a couple more
seankane-msft Jun 22, 2021
9d9b932
one more removal
seankane-msft Jun 22, 2021
b2c2450
changelog
seankane-msft Jun 22, 2021
f130b68
fixing breaking change
seankane-msft Jun 22, 2021
e53bda8
secret reference issue, breaking change fixed
seankane-msft Jun 22, 2021
6378d76
pylint and mypy fixes
seankane-msft Jun 22, 2021
cfb9642
more of xiangs feedback
seankane-msft Jun 22, 2021
4ac7be2
fixing key and feature_id
seankane-msft Jun 22, 2021
bdc7d76
working with xiang
seankane-msft Jun 22, 2021
5c93cb5
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
seankane-msft Jun 23, 2021
fe14053
fixed secref
seankane-msft Jun 23, 2021
c73406b
fixed feature flag
seankane-msft Jun 23, 2021
4c87a30
fixed feature filter tests
seankane-msft Jun 23, 2021
1ba6c4c
mypy and pylint fixes
seankane-msft Jun 23, 2021
813baad
updating tests
seankane-msft Jun 23, 2021
2242415
bringing in overload
seankane-msft Jun 23, 2021
8825de1
fixes
seankane-msft Jun 23, 2021
fd6e205
remove overload
seankane-msft Jun 23, 2021
1e844a7
fixing changelog
seankane-msft Jun 23, 2021
4242112
fixing docstrings
seankane-msft Jun 23, 2021
675a926
fixing attribute map
seankane-msft Jun 23, 2021
2cc0ed4
fixing for py2.7
seankane-msft Jun 24, 2021
d526af6
mypy, pylint, and py2.7 fixes
seankane-msft Jun 24, 2021
218aaa9
pylint fix
seankane-msft Jun 24, 2021
94114a7
renaming
seankane-msft Jun 24, 2021
a1d8216
testing typeerror
seankane-msft Jun 24, 2021
f94ebbb
value property instead of enabled and filters
seankane-msft Jun 25, 2021
8e63b29
fixing value configuring
seankane-msft Jun 25, 2021
576dbec
fixing tests for only value @property on featflag
seankane-msft Jun 25, 2021
6f39042
working for secref
seankane-msft Jun 25, 2021
5d1a5ce
pylint and mypy fixes
seankane-msft Jun 28, 2021
c725580
test fix
seankane-msft Jun 28, 2021
108816d
cleaning up
seankane-msft Jun 28, 2021
dd84819
xiangs comment
seankane-msft Jun 28, 2021
01e02d8
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
seankane-msft Jun 28, 2021
3330b66
patching storage stuff
seankane-msft Jun 28, 2021
ad4d592
fixing value property
seankane-msft Jun 29, 2021
1647c2e
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
seankane-msft Jun 29, 2021
8ddc1e3
to generated update
seankane-msft Jun 29, 2021
c9cc8f3
Merge branch 'main' into appconfig-consistency
seankane-msft Jun 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sdk/appconfiguration/azure-appconfiguration/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Release History

## 1.2.0 (2021-07-06)
### Features Added

### Breaking Changes

### Key Bugs Fixed

### Fixed

## 1.2.0b2 (2021-06-08)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# --------------------------------------------------------------------------

from ._azure_appconfiguration_client import AzureAppConfigurationClient
from ._constants import PERCENTAGE, TARGETING, TIME_WINDOW
from ._constants import FILTER_PERCENTAGE, FILTER_TARGETING, FILTER_TIME_WINDOW
from ._models import (
ConfigurationSetting,
FeatureFlagConfigurationSetting,
Expand All @@ -26,7 +26,7 @@
"ResourceReadOnlyError",
"FeatureFlagConfigurationSetting",
"SecretReferenceConfigurationSetting",
"PERCENTAGE",
"TARGETING",
"TIME_WINDOW",
"FILTER_PERCENTAGE",
"FILTER_TARGETING",
"FILTER_TIME_WINDOW",
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# license information.
# -------------------------------------------------------------------------
import binascii
from typing import Optional, Any, Mapping, Union
from typing import Optional, Any, Union, Mapping, TYPE_CHECKING
from requests.structures import CaseInsensitiveDict
from azure.core import MatchConditions
from azure.core.pipeline import Pipeline
Expand Down Expand Up @@ -39,13 +39,9 @@
from ._sync_token import SyncTokenPolicy
from ._user_agent import USER_AGENT

try:
from typing import TYPE_CHECKING
except ImportError:
TYPE_CHECKING = False

if TYPE_CHECKING:
from azure.core.paging import ItemPaged
from azure.core.credentials import TokenCredential


class AzureAppConfigurationClient:
Expand All @@ -54,16 +50,14 @@ class AzureAppConfigurationClient:
:param str base_url: base url of the service
:param credential: An object which can provide secrets for the app configuration service
:type credential: :class:`~azure.appconfiguration.AppConfigConnectionStringCredential`
:keyword Pipeline pipeline: If omitted, the standard pipeline is used.
:keyword HttpTransport transport: If omitted, the standard pipeline is used.
:keyword list[HTTPPolicy] policies: If omitted, the standard pipeline is used.
or :class:`~azure.core.credentials.TokenCredential`

"""

# pylint:disable=protected-access

def __init__(self, base_url, credential, **kwargs):
# type: (str, Any, **Any) -> None
# type: (str, Union[AppConfigConnectionStringCredential, TokenCredential], **Any) -> None
try:
if not base_url.lower().startswith("http"):
base_url = "https://" + base_url
Expand All @@ -76,7 +70,7 @@ def __init__(self, base_url, credential, **kwargs):
self._credential_scopes = base_url.strip("/") + "/.default"

self._config = AzureAppConfigurationConfiguration(
credential, base_url, credential_scopes=self._credential_scopes, **kwargs
credential, base_url, credential_scopes=self._credential_scopes, **kwargs # type: ignore
)
self._config.user_agent_policy = UserAgentPolicy(
base_user_agent=USER_AGENT, **kwargs
Expand All @@ -92,7 +86,7 @@ def __init__(self, base_url, credential, **kwargs):
)

self._impl = AzureAppConfiguration(
credential, base_url, pipeline=pipeline, credential_scopes=self._credential_scopes
credential, base_url, pipeline=pipeline, credential_scopes=self._credential_scopes # type: ignore
)

@classmethod
Expand Down Expand Up @@ -172,7 +166,6 @@ def list_configuration_settings(
:type label_filter: str
:keyword datetime accept_datetime: filter out ConfigurationSetting created after this datetime
:keyword list[str] fields: specify which fields to include in the results. Leave None to include all fields
:keyword dict headers: if "headers" exists, its value (a dict) will be added to the http request header
:return: An iterator of :class:`ConfigurationSetting`
:rtype: ~azure.core.paging.ItemPaged[ConfigurationSetting]
:raises: :class:`HttpResponseError`, :class:`ClientAuthenticationError`
Expand Down Expand Up @@ -226,7 +219,6 @@ def get_configuration_setting(
match_condition=MatchConditions.Unconditionally, # type: Optional[MatchConditions]
**kwargs # type: Any
): # type: (...) -> Union[None, ConfigurationSetting]

"""Get the matched ConfigurationSetting from Azure App Configuration service

:param key: key of the ConfigurationSetting
Expand All @@ -238,7 +230,6 @@ def get_configuration_setting(
:param match_condition: The match condition to use upon the etag
:type match_condition: :class:`~azure.core.MatchConditions`
:keyword datetime accept_datetime: the retrieved ConfigurationSetting that created no later than this datetime
:keyword dict headers: if "headers" exists, its value (a dict) will be added to the http request header
:return: The matched ConfigurationSetting object
:rtype: :class:`~azure.appconfiguration.ConfigurationSetting`
:raises: :class:`HttpResponseError`, :class:`ClientAuthenticationError`, \
Expand Down Expand Up @@ -288,7 +279,6 @@ def add_configuration_setting(self, configuration_setting, **kwargs):

:param configuration_setting: the ConfigurationSetting object to be added
:type configuration_setting: :class:`~azure.appconfiguration.ConfigurationSetting`
:keyword dict headers: if "headers" exists, its value (a dict) will be added to the http request header
:return: The ConfigurationSetting object returned from the App Configuration service
:rtype: :class:`~azure.appconfiguration.ConfigurationSetting`
:raises: :class:`HttpResponseError`, :class:`ClientAuthenticationError`, :class:`ResourceExistsError`
Expand Down Expand Up @@ -342,7 +332,7 @@ def set_configuration_setting(
:type configuration_setting: :class:`ConfigurationSetting`
:param match_condition: The match condition to use upon the etag
:type match_condition: :class:`~azure.core.MatchConditions`
:keyword dict headers: if "headers" exists, its value (a dict) will be added to the http request header
:keyword str etag: check if the ConfigurationSetting is changed. Set None to skip checking etag
:return: The ConfigurationSetting returned from the service
:rtype: :class:`~azure.appconfiguration.ConfigurationSetting`
:raises: :class:`HttpResponseError`, :class:`ClientAuthenticationError`, \
Expand Down Expand Up @@ -396,7 +386,6 @@ def set_configuration_setting(
@distributed_trace
def delete_configuration_setting(self, key, label=None, **kwargs):
# type: (str, Optional[str], **Any) -> ConfigurationSetting

"""Delete a ConfigurationSetting if it exists

:param key: key used to identify the ConfigurationSetting
Expand All @@ -406,7 +395,6 @@ def delete_configuration_setting(self, key, label=None, **kwargs):
:keyword str etag: check if the ConfigurationSetting is changed. Set None to skip checking etag
:keyword match_condition: The match condition to use upon the etag
:paramtype match_condition: :class:`~azure.core.MatchConditions`
:keyword dict headers: if "headers" exists, its value (a dict) will be added to the http request
:return: The deleted ConfigurationSetting returned from the service, or None if it doesn't exist.
:rtype: :class:`~azure.appconfiguration.ConfigurationSetting`
:raises: :class:`HttpResponseError`, :class:`ClientAuthenticationError`, \
Expand Down Expand Up @@ -464,7 +452,6 @@ def list_revisions(self, key_filter=None, label_filter=None, **kwargs):
:type label_filter: str
:keyword datetime accept_datetime: filter out ConfigurationSetting created after this datetime
:keyword list[str] fields: specify which fields to include in the results. Leave None to include all fields
:keyword dict headers: if "headers" exists, its value (a dict) will be added to the http request header
:return: An iterator of :class:`ConfigurationSetting`
:rtype: ~azure.core.paging.ItemPaged[ConfigurationSetting]
:raises: :class:`HttpResponseError`, :class:`ClientAuthenticationError`
Expand Down Expand Up @@ -521,7 +508,7 @@ def set_read_only(self, configuration_setting, read_only=True, **kwargs):
:type read_only: bool
:keyword match_condition: The match condition to use upon the etag
:paramtype match_condition: :class:`~azure.core.MatchConditions`
:keyword dict headers: if "headers" exists, its value (a dict) will be added to the http request header
:keyword str etag: check if the ConfigurationSetting is changed. Set None to skip checking etag
:return: The ConfigurationSetting returned from the service
:rtype: :class:`~azure.appconfiguration.ConfigurationSetting`
:raises: :class:`HttpResponseError`, :class:`ClientAuthenticationError`, :class:`ResourceNotFoundError`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# license information.
# --------------------------------------------------------------------------

TIME_WINDOW = u"Microsoft.TimeWindow"
FILTER_TIME_WINDOW = u"Microsoft.TimeWindow"

PERCENTAGE = u"Microsoft.Percentage"
FILTER_PERCENTAGE = u"Microsoft.Percentage"

TARGETING = u"Microsoft.Targeting"
FILTER_TARGETING = u"Microsoft.Targeting"
Loading