-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Spring Cloud] Add application configuration service related implementation #4263
[Spring Cloud] Add application configuration service related implementation #4263
Conversation
Spring Cloud |
acs_resource = _get_or_default_acs_resource(client, resource_group, service) | ||
repos = acs_resource.properties.settings.git_property.repositories | ||
if next((r for r in repos if r.name == name), None) is not None: | ||
raise CLIError("Repo '{}' already exists.".format(name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the specific error type ValidationError
instead of CLIError
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, thanks!
acs_settings = acs_resource.properties.settings | ||
|
||
if not acs_settings or not acs_settings.git_property or not acs_settings.git_property.repositories: | ||
raise CLIError("Repos not found.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the specific error type ResourceNotFoundError
instead of CLIError
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, thanks for suggestion.
def _get_existing_repo(repos, name): | ||
repo = next((r for r in repos if r.name == name), None) | ||
if not repo: | ||
raise CLIError("Repo '{}' not found.".format(name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
try: | ||
result = sdk_no_wait(False, client.configuration_services.begin_validate, resource_group, service, DEFAULT_NAME, acs_settings).result() | ||
except Exception as err: # pylint: disable=broad-except | ||
raise CLIError("{0}. You may raise a support ticket if needed by the following link: https://docs.microsoft.com/azure/spring-cloud/spring-cloud-faq?pivots=programming-language-java#how-can-i-provide-feedback-and-report-issues".format(err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
if not git_result.is_valid: | ||
validation_result = git_result.git_repos_validation_result | ||
filter_result = [{'name': x.name, 'messages': x.messages} for x in validation_result if len(x.messages) > 0] | ||
raise CLIError("Application Configuration Service settings contain errors.\n{}".format(json.dumps(filter_result, indent=2))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
The pr is part of main...VSChina:enterprise.
Add implementation of Application Configuration Service show, clear, git add, git update, git remove, git list, bind and unbind.
General Guidelines
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally?For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your PR is merged into master branch, a new PR will be created to update
src/index.json
automatically.The precondition is to put your code inside this repo and upgrade the version in the PR but do not modify
src/index.json
.