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

[Config] Rename local-context to config param-persist #15068

Merged
merged 9 commits into from
Sep 14, 2020
Merged

[Config] Rename local-context to config param-persist #15068

merged 9 commits into from
Sep 14, 2020

Conversation

arrownj
Copy link
Contributor

@arrownj arrownj commented Sep 7, 2020

Description
We have a long story in email to ask rename original az local-context to az config parampersist.

This PR is to do this work, and we also add deprecate info for az local-context.

And please note that in this PR, we only change the UE part(command name), the internal class name/ function name were not changed.

Testing Guide

az config parampersist on

Command group 'config parampersist' is experimental and not covered by customer support. Please use with discretion.
Parameter persist is turned on, you can run az config parampersist off to turn it off.

az config parampersist off

Command group 'config parampersist' is experimental and not covered by customer support. Please use with discretion.
Parameter persist is turned off, you can run az config parampersist on to turn it on.

az config parampersist show

Command group 'config parampersist' is experimental and not covered by customer support. Please use with discretion.
{
"all": {
"identity_name": "xiaojxu-msi-3",
"resource_group_name": "img_tmpl_customizers000001"
}
}

az config parampersist delete resource_group_name

Command group 'config parampersist' is experimental and not covered by customer support. Please use with discretion.
Param persist value is deleted. You can run az config parampersist show to show all available values.

az local-context off

This command is implicitly deprecated because command group 'local-context' is deprecated and will be removed in a future release. Use 'config parampersist' instead.
Command group 'local-context' is experimental and not covered by customer support. Please use with discretion.
Local context is turned off, you can run az local-context on to turn it on.

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.


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

@arrownj arrownj self-assigned this Sep 7, 2020
@yonzhan
Copy link
Collaborator

yonzhan commented Sep 7, 2020

Config

@@ -133,17 +133,17 @@ def delete_file(self, recursive=False):
parent_dir = os.path.dirname(local_context_file.config_path)
if not os.listdir(parent_dir):
shutil.rmtree(parent_dir)
logger.warning('Local context persistence file in working directory %s is deleted.',
Copy link
Member

Choose a reason for hiding this comment

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

How about we change the file name local_context.py to avoid inconsistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just as I described in the PR description, this PR is only attempted to update the UE part, actually the internal class / persist file / test framework are still called Local Context (az local-context is marked deprecated but not totally removed yet). Let's leave the internal renaming work to totally remove az local-context command.

@@ -1188,6 +1188,16 @@ config unset:
key:
rule_exclusions:
- no_positional_parameters
config parampersist show:
Copy link
Contributor

Choose a reason for hiding this comment

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

why don't we use param-persist? all names of your functions is param_persist

Copy link
Contributor Author

@arrownj arrownj Sep 11, 2020

Choose a reason for hiding this comment

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

The name is provided by PM after a long time survey.

Copy link
Member

Choose a reason for hiding this comment

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

It's a bit hard to read.

Copy link
Contributor

Choose a reason for hiding this comment

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

hard to understand the command name. prefer param-persist

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I will confirm with PM whether we can update it to param-persist.

c.positional('name', nargs='*', help='Space-separated list of parameter persistence names.')

with self.argument_context('config parampersist delete') as c:
c.positional('name', nargs='*', help='Space-separated list of parameter persistence names. Either positional name argument or --all can be specified.')
Copy link
Contributor

@Juliehzl Juliehzl Sep 11, 2020

Choose a reason for hiding this comment

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

should we use + to prevent no value added for the parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Support no value here.

c.argument('all', help='Clear all parameter persistence data. Either positional name argument or --all can be specified.', action='store_true')
c.argument('yes', options_list=['--yes', '-y'], help='Do not prompt for confirmation. Only available when --all is specified.', action='store_true')
c.argument('purge', help='Delete parameter persistence file from working directory. Only available when --all is specified.', action='store_true')
c.argument('recursive', help='Indicates this is recursive delete of parameter persistence. Only available when --all is specified.', action='store_true')
Copy link
Contributor

Choose a reason for hiding this comment

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

Indicate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.

@arrownj
Copy link
Contributor Author

arrownj commented Sep 11, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@arrownj arrownj changed the title [Config] Rename local-context to config parampersist [Config] Rename local-context to config param-persist Sep 14, 2020
@arrownj
Copy link
Contributor Author

arrownj commented Sep 14, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

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

Successfully merging this pull request may close these issues.

7 participants