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

[devcenter] Update data plane API to v2024-10-01-preview #8379

Open
wants to merge 95 commits into
base: main
Choose a base branch
from

Conversation

am-lim
Copy link
Contributor

@am-lim am-lim commented Dec 19, 2024


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

am-lim and others added 30 commits December 18, 2023 23:04
Fix environment def example and update style
Copy link

azure-client-tools-bot-prd bot commented Dec 19, 2024

⚠️Azure CLI Extensions Breaking Change Test
⚠️devcenter
rule cmd_name rule_message suggest_message
⚠️ 1010 - ParaPropUpdate devcenter dev customization-task show cmd devcenter dev customization-task show update parameter task_name: updated property options from ['--task-name'] to ['--name', '--task-name', '-n']
⚠️ 1006 - ParaAdd devcenter dev customization-task validate cmd devcenter dev customization-task validate added parameter no_wait
⚠️ 1001 - CmdAdd devcenter dev dev-box capture-snapshot cmd devcenter dev dev-box capture-snapshot added
⚠️ 1001 - CmdAdd devcenter dev dev-box list-snapshot cmd devcenter dev dev-box list-snapshot added
⚠️ 1001 - CmdAdd devcenter dev dev-box restore-snapshot cmd devcenter dev dev-box restore-snapshot added
⚠️ 1001 - CmdAdd devcenter dev dev-box show-snapshot cmd devcenter dev dev-box show-snapshot added
⚠️ 1001 - CmdAdd devcenter dev environment-type list-abilities cmd devcenter dev environment-type list-abilities added
⚠️ 1001 - CmdAdd devcenter dev environment-type show cmd devcenter dev environment-type show added
⚠️ 1011 - SubgroupAdd devcenter dev image-build sub group devcenter dev image-build added
⚠️ 1001 - CmdAdd devcenter dev project list-abilities cmd devcenter dev project list-abilities added
⚠️ 1001 - CmdAdd devcenter dev project show-operation cmd devcenter dev project show-operation added

Copy link

Hi @am-lim,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Collaborator

yonzhan commented Dec 19, 2024

Thank you for your contribution! We will review the pull request and get back to you soon.

Copy link

🚫All pull requests will be blocked to merge until Jan 6, 2025 due to CCOA

Copy link

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

Copy link

Comment on lines +102 to +107
def get_dataplane_endpoint(cli_ctx, endpoint=None, dev_center=None, project_name=None):
validate_endpoint(endpoint, dev_center)
if endpoint is None and dev_center is not None:
project = get_project_data(cli_ctx, dev_center, project_name)
endpoint = project["devCenterUri"]
endpoint = endpoint.split('//', 1)[-1]
Copy link
Contributor

@kairu-ms kairu-ms Dec 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the user can defined data-plane endpoints by three ways:

  • directly provide the endpoint
  • provide the dev_center and using the first devCenterUri of the project
  • provide both dev_center and project_name and using the devCenterUri

My question is why need the third way if providing the dev_center is enough to get the devCenterUri in response.

And for the second way actually you can config the data plane client like this which will retrieve the properties.devCenterUri as endpoint from devcenter resource from the control plane api.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kairu-ms For the question about why the third way is included, for commands that have a project name, we fail earlier and let the user know that the reason for the failure is that the project does not exist within the dev center. Otherwise, for example the user may receive a 401 not found for their get command or an empty list for their list command - but the user would be unaware that this is caused because the project does not exist within the chosen dev center.

I don't know if we can config the data plane client "By resource property" in the screenshot. This is because users using the data plane are only assumed to have read access to the project, not the dev center. Also, some commands do not have project name as a parameter (For example, in some list commands the user can list all the resources available in a dev center). This is why we need to use the azure resource graph query on all projects. Given this context, not sure if we can set up the devCenterUri this way?

@kairu-ms
Copy link
Contributor

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot do-not-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants