From 06f0b6df3522116f49319c556c177100edaa381c Mon Sep 17 00:00:00 2001 From: am-lim <55768281+am-lim@users.noreply.github.com> Date: Wed, 7 Jun 2023 16:24:02 -0700 Subject: [PATCH] [devcenter] Small updates - fix error string and update data plane help (#6374) * fix formatting * fix lint errors * Schedules CLI changes * Fix azdev linter errors * Set default to user-id * Add devcenter tests and update help * fix azdev linter error * Fix ARG bug * add default 'me' for help and regenerate whl file * Add project and network connection tests * Add gallery test * update previous tests, reformat * regenerate whl, add recordings * updates to test * Fix gallery test * Add attached network and pool tests * Pool test recording * Add rest of devbox tests * add schedule to pool * Add catalog tests * Handle dogfood dataplane * update * add env type tests * Improve control plane update commands * rerun tests and edit error messasing * delete unused files * delete unused files * add defaults for devcenter and project * Not error message for dev project list * Delay Schedule Customization * Whl file and style changes * Add validation * pr comments * add proj pool and schedule tests * add whl file * uncomment out record only * Add catalog and env type tests * Update to make clear dummy val * Update to make clear dummy ref * Add whl file * Update to tests, fix dp polling * add dev box test, fix ymls * add environment test * fix style * generate whl file * update yml * Update README * Update readme * correct mispelling * Fix wording of readme * Update name of extension * Remove fidalgo extension * Fix PR build errors * Fix pool operation and gallery tests * Remove usage command * Generate new whl file * Fix aio operations * Fix aio operations * Reorganize code * Generate whl file * Update to aaz * fix identity * run tests * proj env type test * fix tests * update parameters for pool * Update 2023-1-1 dataplane API * Update CLI client code * clean up old control plane * add pool logic * add customizations * update tests * fix gallery test * update tests * fix tests * comment out control plane * uncomment tests * style and linter fixes * guid * update tests * Delete scheduled tasks * Clean up extension * Update managed identity api version * add artifacts API * add artifacts API * test updates * Update aaz * Update aaz * Merge AAZ calls * remove top * Remove top from aaz * Remove unused args using aaz dev tools * undo changes * Control plane 2023-1-1 * fix show and wait * update image version and schedule * fix ordering of imports * Fix location description * Add pool health check customization, fix desc * add 200 for catalog sync * add extra line * fix style * Add update environment command * Delay actions customization * Delay actions customization * correct comparison * Style fixes * Update control plane tests for 2023-01-01-preview * Update data plane tests 2023-01-01-preview * Add 2023-01-01-preview whl file * Update dataplane to 2023-04-01 API * Fix style errors * Update api version * Update examples, add usage API * update dev box definition wait * Fix list attached network description * Fix history file * Update read me to point to correct CLI reference * Update help, required params, examples * fix examples * fix linter issue * Add endpoint option to data plane cmds * Fix endpoint regex, update to dev box list * dev center and project tests * network connection test * dev box definition test * gallery test * attached network test * env type tests * pool test * update tests * Add usage test * updates * Update data plane tests for API v2023-04-01 * fix bugs * catalog tests and improvements to code * update pool tests without idle * update tests * update last tests * Style fixes * Remove pool run health check * Add 04-01 whl file * Improve endpoint error message * Further improve error message string * improved wording * Fix example name * FIx dev box list bug * Add whl file * GA updates * Pr comments * Add breaking changes to HISTORY.rst * update for restart test * Fix env create error string, update dp help --------- Co-authored-by: amandalim95 <55768281+amandalim95@users.noreply.github.com> Co-authored-by: Meenakshi Das (SHE/HER) Co-authored-by: meenakshidas1996 <103694696+meenakshidas1996@users.noreply.github.com> --- src/devcenter/HISTORY.rst | 5 ++ src/devcenter/azext_devcenter/_help.py | 72 ++++++++++---------- src/devcenter/azext_devcenter/_validators.py | 2 + src/devcenter/setup.py | 2 +- 4 files changed, 44 insertions(+), 37 deletions(-) diff --git a/src/devcenter/HISTORY.rst b/src/devcenter/HISTORY.rst index 48d833155c0..151ccc71873 100644 --- a/src/devcenter/HISTORY.rst +++ b/src/devcenter/HISTORY.rst @@ -2,6 +2,11 @@ Release History =============== +1.0.1 +++++++ +* Update error string for environment create same name validation +* Update data plane help to align with control plane + 1.0.0 ++++++ * Update control plane and data plane APIs to v2023-04-01 diff --git a/src/devcenter/azext_devcenter/_help.py b/src/devcenter/azext_devcenter/_help.py index 571c98cf030..2c6eb3271fd 100644 --- a/src/devcenter/azext_devcenter/_help.py +++ b/src/devcenter/azext_devcenter/_help.py @@ -10,7 +10,7 @@ "devcenter dev" ] = """ type: group - short-summary: "Manages devcenter developer resources." + short-summary: "Manage devcenter developer resources." """ helps[ "devcenter dev project" @@ -23,7 +23,7 @@ "devcenter dev project list" ] = """ type: command - short-summary: "Lists all projects." + short-summary: "List all projects." examples: - name: List using dev center text: |- @@ -37,7 +37,7 @@ "devcenter dev project show" ] = """ type: command - short-summary: "Gets a project." + short-summary: "Get a project." examples: - name: Get using dev center text: |- @@ -60,7 +60,7 @@ "devcenter dev pool list" ] = """ type: command - short-summary: "Lists available pools." + short-summary: "List available pools." examples: - name: List using dev center text: |- @@ -76,7 +76,7 @@ "devcenter dev pool show" ] = """ type: command - short-summary: "Gets a pool." + short-summary: "Get a pool." examples: - name: Get using dev center text: |- @@ -99,7 +99,7 @@ "devcenter dev schedule show" ] = """ type: command - short-summary: "Gets a schedule." + short-summary: "Get a schedule." examples: - name: Get using dev center text: |- @@ -122,8 +122,8 @@ "devcenter dev dev-box list" ] = """ type: command - short-summary: "Lists dev boxes for a user, lists dev boxes in the dev center for a \ -project and user, or lists dev boxes that the caller has access to in the dev center." + short-summary: "List dev boxes for a user, list dev boxes in the dev center for a \ +project and user, or list dev boxes that the caller has access to in the dev center." examples: - name: List all dev boxes in the dev center text: |- @@ -153,7 +153,7 @@ "devcenter dev dev-box show" ] = """ type: command - short-summary: "Gets a dev box." + short-summary: "Get a dev box." examples: - name: Get using dev center text: |- @@ -169,7 +169,7 @@ "devcenter dev dev-box create" ] = """ type: command - short-summary: "Creates a dev box." + short-summary: "Create a dev box." examples: - name: Create using dev center text: |- @@ -185,7 +185,7 @@ "devcenter dev dev-box delete" ] = """ type: command - short-summary: "Deletes a dev box." + short-summary: "Delete a dev box." examples: - name: Delete using dev center text: |- @@ -201,7 +201,7 @@ "devcenter dev dev-box show-remote-connection" ] = """ type: command - short-summary: "Gets remote connection info." + short-summary: "Get remote connection info." examples: - name: Get remote connection using dev center text: |- @@ -217,7 +217,7 @@ "devcenter dev dev-box start" ] = """ type: command - short-summary: "Starts a dev box." + short-summary: "Start a dev box." examples: - name: Start using dev center text: |- @@ -233,7 +233,7 @@ "devcenter dev dev-box restart" ] = """ type: command - short-summary: "Restarts a dev box." + short-summary: "Restart a dev box." examples: - name: Restart using dev center text: |- @@ -249,7 +249,7 @@ "devcenter dev dev-box stop" ] = """ type: command - short-summary: "Stops a dev box." + short-summary: "Stop a dev box." examples: - name: Stop using dev center text: |- @@ -265,7 +265,7 @@ "devcenter dev dev-box list-action" ] = """ type: command - short-summary: "Lists actions on a dev box." + short-summary: "List actions on a dev box." examples: - name: List actions using dev center text: |- @@ -281,7 +281,7 @@ "devcenter dev dev-box delay-action" ] = """ type: command - short-summary: "Delays an action." + short-summary: "Delay an action." examples: - name: Delay action using dev center text: |- @@ -299,7 +299,7 @@ "devcenter dev dev-box delay-all-actions" ] = """ type: command - short-summary: "Delays all actions." + short-summary: "Delay all actions." examples: - name: Delay all actions using dev center text: |- @@ -317,7 +317,7 @@ "devcenter dev dev-box show-action" ] = """ type: command - short-summary: "Gets an action." + short-summary: "Get an action." examples: - name: Get action using dev center text: |- @@ -335,7 +335,7 @@ "devcenter dev dev-box skip-action" ] = """ type: command - short-summary: "Skips an action." + short-summary: "Skip an action." examples: - name: Skip action using dev center text: |- @@ -360,7 +360,7 @@ "devcenter dev environment list" ] = """ type: command - short-summary: "Lists the environments for a project or lists the environments for a user within a project." + short-summary: "List the environments for a project or list the environments for a user within a project." examples: - name: List by project using dev center text: |- @@ -384,7 +384,7 @@ "devcenter dev environment show" ] = """ type: command - short-summary: "Gets an environment." + short-summary: "Get an environment." examples: - name: Get using dev center text: |- @@ -419,7 +419,7 @@ "devcenter dev environment update" ] = """ type: command - short-summary: "Updates an environment." + short-summary: "Update an environment." examples: - name: Update using dev center text: |- @@ -437,7 +437,7 @@ "devcenter dev environment deploy" ] = """ type: command - short-summary: "Updates an environment." + short-summary: "Update an environment." examples: - name: Update using dev center text: |- @@ -455,12 +455,12 @@ "devcenter dev environment delete" ] = """ type: command - short-summary: "Deletes an environment and all its associated resources." + short-summary: "Delete an environment and all its associated resources." examples: - name: Delete using dev center text: |- az devcenter dev environment delete --dev-center-name "ContosoDevCenter" \ - --name "mydevenv" --project-name "DevProject" --user-id "00000000-0000-0000-0000-000000000000" +--name "mydevenv" --project-name "DevProject" --user-id "00000000-0000-0000-0000-000000000000" - name: Delete using endpoint text: |- az devcenter dev environment delete --endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" \ @@ -478,7 +478,7 @@ "devcenter dev catalog list" ] = """ type: command - short-summary: "Lists all of the catalogs available for a project." + short-summary: "List all of the catalogs available for a project." examples: - name: List using dev center text: |- @@ -494,7 +494,7 @@ "devcenter dev catalog show" ] = """ type: command - short-summary: "Gets the specified catalog within the project." + short-summary: "Get the specified catalog within the project." examples: - name: Get using dev center text: |- @@ -517,7 +517,7 @@ "devcenter dev environment-type list" ] = """ type: command - short-summary: "Lists all environment types configured for a project." + short-summary: "List all environment types configured for a project." examples: - name: List using dev center text: |- @@ -540,24 +540,24 @@ "devcenter dev environment-definition list" ] = """ type: command - short-summary: "Lists all environment definitions available within a catalog or lists all environment \ + short-summary: "List all environment definitions available within a catalog or list all environment \ definitions available for a project." examples: - name: List using dev center text: |- - az devcenter dev environment-definition list --dev-center-name "ContosoDevCenter" \ + az devcenter dev environment-definition list --dev-center-name "ContosoDevCenter" \ --project-name "DevProject" - name: List using endpoint text: |- - az devcenter dev environment-definition list --dev-center-name "ContosoDevCenter" \ + az devcenter dev environment-definition list --dev-center-name "ContosoDevCenter" \ --project-name "DevProject" - name: List by catalog using dev center text: |- - az devcenter dev environment-definition list --dev-center-name "ContosoDevCenter" \ + az devcenter dev environment-definition list --dev-center-name "ContosoDevCenter" \ --project-name "DevProject" --catalog-name "myCatalog" - name: List by catalog using endpoint text: |- - az devcenter dev environment-definition list --endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" \ + az devcenter dev environment-definition list --endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" \ --project-name "DevProject" --catalog-name "myCatalog" """ @@ -569,10 +569,10 @@ examples: - name: Get using dev center text: |- - az devcenter dev environment-definition show --dev-center-name "ContosoDevCenter" \ + az devcenter dev environment-definition show --dev-center-name "ContosoDevCenter" \ --project-name "DevProject" --catalog-name "myCatalog" --definition-name "foo" - name: Get using endpoint text: |- - az devcenter dev environment-definition show --endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" \ + az devcenter dev environment-definition show --endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" \ --project-name "DevProject" --catalog-name "myCatalog" --definition-name "foo" """ diff --git a/src/devcenter/azext_devcenter/_validators.py b/src/devcenter/azext_devcenter/_validators.py index a28c6336bc4..178715c94f2 100644 --- a/src/devcenter/azext_devcenter/_validators.py +++ b/src/devcenter/azext_devcenter/_validators.py @@ -77,6 +77,8 @@ def validate_endpoint(endpoint, dev_center): def validate_env_name_already_exists(env_iterator, name, user_id, project): for env in env_iterator: if env.name.casefold() == name.casefold(): + if user_id == "me": + user_id = env.user error_message = f"""An environment with the name '{name}' \ already exists for the user-id '{user_id}' in this project '{project}'.""" raise InvalidArgumentValueError(error_message) diff --git a/src/devcenter/setup.py b/src/devcenter/setup.py index 9431221610f..d8e96142888 100644 --- a/src/devcenter/setup.py +++ b/src/devcenter/setup.py @@ -10,7 +10,7 @@ from setuptools import setup, find_packages # HISTORY.rst entry. -VERSION = '1.0.0' +VERSION = '1.0.1' try: from azext_devcenter.manual.version import VERSION except ImportError: