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

UX update for context create and context use to list plugins will be installed #563

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

chandrareddyp
Copy link
Contributor

@chandrareddyp chandrareddyp commented Oct 20, 2023

What this PR does / why we need it

Before this change, the tanzu context create context-name and tanzu context use context-name commands created and activated the given context and installed the required plugins. However, they did not list all the plugins they would install as part of the command execution, resulting in a suboptimal user experience. Users were unaware of how many plugins would be installed or which ones were included. Sometimes, the installation process took a considerable amount of time, leaving users in the dark about the installation progress.

After this PR, the tanzu context create context-name and tanzu context use context-name commands will list the plugins they are going to install. This enhancement provides a great user experience, as users will know in advance which plugins are being installed. This makes it easier for users to track the progress.

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

  1. Use case: No plugins are installed for a context
❯ t context use tmc1
[i] Successfully activated context 'tmc1'
[i] Checking for required plugins for context tmc1...
[i] The following plugins will be installed for context 'tmc1': 
  NAME                  TARGET           VERSION  
  clustergroup          mission-control  v0.1.11  
  integration           mission-control  v0.1.11  
  ekscluster            mission-control  v0.1.11  
  account               mission-control  v0.1.12  
  setting               mission-control  v0.2.9   
  iam                   mission-control  v0.1.11  
  workspace             mission-control  v0.1.13  
  tanzupackage          mission-control  v0.2.10  
  data-protection       mission-control  v0.1.11  
  provider-aks-cluster  mission-control  v0.1.12  
  events                mission-control  v0.1.11  
  aks-cluster           mission-control  v0.2.1   
  apply                 mission-control  v0.3.8   
  secret                mission-control  v0.1.11  
  helm                  mission-control  v0.1.11  
  provider-eks-cluster  mission-control  v0.1.11  
  audit                 mission-control  v0.1.11  
  agentartifacts        mission-control  v0.1.11  
  management-cluster    mission-control  v0.2.11  
  continuousdelivery    mission-control  v0.1.11  
  inspection            mission-control  v0.1.11  
  policy                mission-control  v0.1.11  
  cluster               mission-control  v0.2.6   
[i] Reading plugin inventory for "projects.registry.vmware.com/tanzu_cli/plugins/plugin-inventory:latest", this will take a few seconds.
[i] Installing plugin 'clustergroup:v0.1.11' with target 'mission-control' 
[i] Installing plugin 'integration:v0.1.11' with target 'mission-control' 
[i] Installing plugin 'ekscluster:v0.1.11' with target 'mission-control' 
[i] Installing plugin 'account:v0.1.12' with target 'mission-control' 
[i] Installing plugin 'setting:v0.2.9' with target 'mission-control' 
[i] Installing plugin 'iam:v0.1.11' with target 'mission-control' 
[i] Installing plugin 'workspace:v0.1.13' with target 'mission-control' 
[i] Installing plugin 'tanzupackage:v0.2.10' with target 'mission-control' 
[i] Installing plugin 'data-protection:v0.1.11' with target 'mission-control' 
[i] Installing plugin 'provider-aks-cluster:v0.1.12' with target 'mission-control' 
[i] Installing plugin 'events:v0.1.11' with target 'mission-control' 
[i] Installing plugin 'aks-cluster:v0.2.1' with target 'mission-control' 
[i] Installing plugin 'apply:v0.3.8' with target 'mission-control' 
[i] Installing plugin 'secret:v0.1.11' with target 'mission-control' 
[i] Installing plugin 'helm:v0.1.11' with target 'mission-control' 
[i] Installing plugin 'provider-eks-cluster:v0.1.11' with target 'mission-control' 
[i] Installing plugin 'audit:v0.1.11' with target 'mission-control' 
[i] Installing plugin 'agentartifacts:v0.1.11' with target 'mission-control' 
[i] Installing plugin 'management-cluster:v0.2.11' with target 'mission-control' 
[i] Installing plugin 'continuousdelivery:v0.1.11' with target 'mission-control' 
[i] Installing plugin 'inspection:v0.1.11' with target 'mission-control' 
[i] Installing plugin 'policy:v0.1.11' with target 'mission-control' 
[i] Installing plugin 'cluster:v0.2.6' with target 'mission-control' 
[i] Successfully installed all required plugins
❯ 
  1. Use case: When all plugins are installed for a context:
❯ t context unset tmc1
[i] The tanzu cli essential plugins have not been installed and are being installed now. The install may take a few seconds.

The context 'tmc1' of type 'mission-control' has been set as inactive
Deactivating plugin 'iam:v0.1.11' for context 'tmc1'
Deactivating plugin 'workspace:v0.1.13' for context 'tmc1'
Deactivating plugin 'agentartifacts:v0.1.11' for context 'tmc1'
Deactivating plugin 'data-protection:v0.1.11' for context 'tmc1'
Deactivating plugin 'events:v0.1.11' for context 'tmc1'
Deactivating plugin 'cluster:v0.2.6' for context 'tmc1'
Deactivating plugin 'aks-cluster:v0.2.1' for context 'tmc1'
Deactivating plugin 'ekscluster:v0.1.11' for context 'tmc1'
Deactivating plugin 'provider-eks-cluster:v0.1.11' for context 'tmc1'
Deactivating plugin 'integration:v0.1.11' for context 'tmc1'
Deactivating plugin 'apply:v0.3.8' for context 'tmc1'
Deactivating plugin 'audit:v0.1.11' for context 'tmc1'
Deactivating plugin 'secret:v0.1.11' for context 'tmc1'
Deactivating plugin 'helm:v0.1.11' for context 'tmc1'
Deactivating plugin 'clustergroup:v0.1.11' for context 'tmc1'
Deactivating plugin 'management-cluster:v0.2.11' for context 'tmc1'
Deactivating plugin 'policy:v0.1.11' for context 'tmc1'
Deactivating plugin 'account:v0.1.12' for context 'tmc1'
Deactivating plugin 'inspection:v0.1.11' for context 'tmc1'
Deactivating plugin 'provider-aks-cluster:v0.1.12' for context 'tmc1'
Deactivating plugin 'setting:v0.2.9' for context 'tmc1'
Deactivating plugin 'tanzupackage:v0.2.10' for context 'tmc1'
Deactivating plugin 'continuousdelivery:v0.1.11' for context 'tmc1'
❯ 
❯ 
❯ t context use tmc1
[i] Successfully activated context 'tmc1'
[i] Checking for required plugins for context tmc1...
[i] All required plugins are already installed and up-to-date
❯ 
❯
  1. Use case: When some plug plugins are installed, some are not installed for a context:
❯ 
❯ t plugin delete workspace --target tmc
Uninstalling plugin 'workspace' for target 'mission-control'. Are you sure? [y/N]: y
[i] Uninstalling plugin 'workspace' for target 'mission-control'
[ok] successfully uninstalled plugin 'workspace'
❯ 
❯ t plugin delete secret --target tmc   
Uninstalling plugin 'secret' for target 'mission-control'. Are you sure? [y/N]: y
[i] Uninstalling plugin 'secret' for target 'mission-control'
[ok] successfully uninstalled plugin 'secret'
❯ 
❯ 
❯ t context unset tmc1
The context 'tmc1' of type 'mission-control' has been set as inactive
Deactivating plugin 'provider-aks-cluster:v0.1.12' for context 'tmc1'
Deactivating plugin 'iam:v0.1.11' for context 'tmc1'
Deactivating plugin 'continuousdelivery:v0.1.11' for context 'tmc1'
Deactivating plugin 'helm:v0.1.11' for context 'tmc1'
Deactivating plugin 'agentartifacts:v0.1.11' for context 'tmc1'
Deactivating plugin 'tanzupackage:v0.2.10' for context 'tmc1'
Deactivating plugin 'ekscluster:v0.1.11' for context 'tmc1'
Deactivating plugin 'account:v0.1.12' for context 'tmc1'
Deactivating plugin 'events:v0.1.11' for context 'tmc1'
Deactivating plugin 'aks-cluster:v0.2.1' for context 'tmc1'
Deactivating plugin 'setting:v0.2.9' for context 'tmc1'
Deactivating plugin 'audit:v0.1.11' for context 'tmc1'
Deactivating plugin 'cluster:v0.2.6' for context 'tmc1'
Deactivating plugin 'inspection:v0.1.11' for context 'tmc1'
Deactivating plugin 'apply:v0.3.8' for context 'tmc1'
Deactivating plugin 'integration:v0.1.11' for context 'tmc1'
Deactivating plugin 'management-cluster:v0.2.11' for context 'tmc1'
Deactivating plugin 'data-protection:v0.1.11' for context 'tmc1'
Deactivating plugin 'clustergroup:v0.1.11' for context 'tmc1'
Deactivating plugin 'policy:v0.1.11' for context 'tmc1'
Deactivating plugin 'provider-eks-cluster:v0.1.11' for context 'tmc1'
❯ 
❯ t context use tmc1                    
[i] Successfully activated context 'tmc1'
[i] Checking for required plugins for context tmc1...
[i] The following plugins will be installed for context 'tmc1': 
  NAME       TARGET           VERSION  
  secret     mission-control  v0.1.11  
  workspace  mission-control  v0.1.13  
[i] Installing plugin 'secret:v0.1.11' with target 'mission-control' (from cache)
[i] Installing plugin 'workspace:v0.1.13' with target 'mission-control' (from cache)
[i] Successfully installed all required plugins
❯ 
❯ 
❯ t plugin list
Standalone Plugins
  NAME       DESCRIPTION                                                 TARGET  VERSION  STATUS     
  telemetry  configure cluster-wide settings for vmware tanzu telemetry  global  v1.1.0   installed  

Plugins from Context:  tmc1
  NAME                  DESCRIPTION                                                     TARGET           VERSION  STATUS     
  account               Account for tmc resources                                       mission-control  v0.1.12  installed  
  agentartifacts        helm for tmc resources                                          mission-control  v0.1.11  installed  
  aks-cluster           Manage and unmanage tmc aks clusters                            mission-control  v0.2.1   installed  
  apply                 Create/Update a resource with a resource file                   mission-control  v0.3.8   installed  
  audit                 Run an audit request on an org                                  mission-control  v0.1.11  installed  
  cluster                                                                               mission-control  v0.2.6   installed  
  clustergroup          A group of Kubernetes clusters                                  mission-control  v0.1.11  installed  
  continuousdelivery    Continuousdelivery for tmc resources                            mission-control  v0.1.11  installed  
  data-protection       Data protection for tmc resources                               mission-control  v0.1.11  installed  
  ekscluster                                                                            mission-control  v0.1.11  installed  
  events                Events for any meaningful user activity or system state change  mission-control  v0.1.11  installed  
  helm                  helm for tmc resources                                          mission-control  v0.1.11  installed  
  iam                   IAM Policies for tmc resources                                  mission-control  v0.1.11  installed  
  inspection            Inspection for tmc resources                                    mission-control  v0.1.11  installed  
  integration           Get available integrations and their information from registry  mission-control  v0.1.11  installed  
  management-cluster    A TMC registered Management cluster                             mission-control  v0.2.11  installed  
  policy                Policy for tmc resources                                        mission-control  v0.1.11  installed  
  provider-aks-cluster  Manage and unmanage tmc provider aks clusters                   mission-control  v0.1.12  installed  
  provider-eks-cluster                                                                  mission-control  v0.1.11  installed  
  secret                secret for tmc resources                                        mission-control  v0.1.11  installed  
  setting               Setting plugin for tmc resources                                mission-control  v0.2.9   installed  
  tanzupackage          Tanzupackage for tmc resources                                  mission-control  v0.2.10  installed  
  workspace             A group of Kubernetes namespaces                                mission-control  v0.1.13  installed  
❯
  1. Use case: Context create for k8s:
❯ t context create
? Select context creation type Kubernetes (Local Kubeconfig)
? Enter path to kubeconfig (if any) /Users/cpamuluri/tkg/tasks/k8s_remote_server/k8s_remote
? Enter kube context to use tkg-mgmt-vc-admin@tkg-mgmt-vc
? Give the context a name remote22
[ok] successfully created a kubernetes context using the kubeconfig /Users/cpamuluri/tkg/tasks/k8s_remote_server/k8s_remote
[i] Checking for required plugins for context 'remote22'...
[i] The following plugins will be installed for context 'remote22':
  NAME                TARGET      VERSION
  cluster             kubernetes  v0.28.0
  feature             kubernetes  v0.28.0
  kubernetes-release  kubernetes  v0.28.0
[i] Installing plugin 'cluster:v0.28.0' with target 'kubernetes' (from cache)
[i] Installing plugin 'feature:v0.28.0' with target 'kubernetes' (from cache)
[i] Installing plugin 'kubernetes-release:v0.28.0' with target 'kubernetes' (from cache)
[i] Successfully installed all required plugins
❯

  1. Use case: Context create: TMC:
❯ t context create --name tmc45 --endpoint unstable.tmc-dev.cloud.vmware.com --staging
Flag --name has been deprecated, it has been replaced by using an argument to the command
[i] API token env var is set

[ok] successfully created a TMC context
[i] Checking for required plugins for context 'tmc45'...
[i] The following plugins will be installed for context 'tmc45':
  NAME                  TARGET           VERSION
  ekscluster            mission-control  v0.1.11
  audit                 mission-control  v0.1.11
  continuousdelivery    mission-control  v0.1.11
  provider-eks-cluster  mission-control  v0.1.11
  apply                 mission-control  v0.3.8
  tanzupackage          mission-control  v0.2.10
  helm                  mission-control  v0.1.11
  iam                   mission-control  v0.1.11
  events                mission-control  v0.1.11
  account               mission-control  v0.1.14
  agentartifacts        mission-control  v0.1.11
  inspection            mission-control  v0.1.11
  integration           mission-control  v0.1.11
  cluster               mission-control  v0.2.6
  data-protection       mission-control  v0.1.11
  workspace             mission-control  v0.1.13
  clustergroup          mission-control  v0.1.11
  policy                mission-control  v0.1.11
  provider-aks-cluster  mission-control  v0.1.12
  aks-cluster           mission-control  v0.2.1
  setting               mission-control  v0.2.9
  management-cluster    mission-control  v0.2.11
  secret                mission-control  v0.1.11
[i] Installing plugin 'ekscluster:v0.1.11' with target 'mission-control' (from cache)
[i] Installing plugin 'audit:v0.1.11' with target 'mission-control' (from cache)
[i] Installing plugin 'continuousdelivery:v0.1.11' with target 'mission-control' (from cache)
[i] Installing plugin 'provider-eks-cluster:v0.1.11' with target 'mission-control' (from cache)
[i] Installing plugin 'apply:v0.3.8' with target 'mission-control' (from cache)
[i] Installing plugin 'tanzupackage:v0.2.10' with target 'mission-control' (from cache)
[i] Installing plugin 'helm:v0.1.11' with target 'mission-control' (from cache)
[i] Installing plugin 'iam:v0.1.11' with target 'mission-control' (from cache)
[i] Installing plugin 'events:v0.1.11' with target 'mission-control' (from cache)
[i] Installing plugin 'account:v0.1.14' with target 'mission-control' (from cache)
[i] Installing plugin 'agentartifacts:v0.1.11' with target 'mission-control' (from cache)
[i] Installing plugin 'inspection:v0.1.11' with target 'mission-control' (from cache)
[i] Installing plugin 'integration:v0.1.11' with target 'mission-control' (from cache)
[i] Installing plugin 'cluster:v0.2.6' with target 'mission-control' (from cache)
[i] Installing plugin 'data-protection:v0.1.11' with target 'mission-control' (from cache)
[i] Installing plugin 'workspace:v0.1.13' with target 'mission-control' (from cache)
[i] Installing plugin 'clustergroup:v0.1.11' with target 'mission-control' (from cache)
[i] Installing plugin 'policy:v0.1.11' with target 'mission-control' (from cache)
[i] Installing plugin 'provider-aks-cluster:v0.1.12' with target 'mission-control' (from cache)
[i] Installing plugin 'aks-cluster:v0.2.1' with target 'mission-control' (from cache)
[i] Installing plugin 'setting:v0.2.9' with target 'mission-control' (from cache)
[i] Installing plugin 'management-cluster:v0.2.11' with target 'mission-control' (from cache)
[i] Installing plugin 'secret:v0.1.11' with target 'mission-control' (from cache)
[i] Successfully installed all required plugins

Release note

The `tanzu context use` and `tanzu context create` commands' UX have been updated to list the plugins they're going to install.

Additional information

Special notes for your reviewer

@chandrareddyp chandrareddyp requested a review from a team as a code owner October 20, 2023 20:39
@chandrareddyp chandrareddyp changed the title [InProgress] UX update for 'context use' [InProgress] UX update for 'context use' to list plugins will be installed Oct 23, 2023
Copy link
Contributor

@marckhouzam marckhouzam left a comment

Choose a reason for hiding this comment

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

  1. I was curious if we wanted to do the same for tanzu context create?
    2.SyncPluginsForContextType is no longer used anywhere

pkg/command/context.go Outdated Show resolved Hide resolved
pkg/command/context.go Outdated Show resolved Hide resolved
pkg/command/context.go Outdated Show resolved Hide resolved
pkg/command/context.go Outdated Show resolved Hide resolved
@chandrareddyp
Copy link
Contributor Author

  1. I was curious if we wanted to do the same for tanzu context create?
    2.SyncPluginsForContextType is no longer used anywhere

SyncPluginsForContextType is not being used anywhere!

@marckhouzam marckhouzam changed the title [InProgress] UX update for 'context use' to list plugins will be installed UX update for 'context use' to list plugins will be installed Oct 24, 2023
@marckhouzam
Copy link
Contributor

  1. I was curious if we wanted to do the same for tanzu context create?
    2.SyncPluginsForContextType is no longer used anywhere

SyncPluginsForContextType is not being used anywhere!

So why are we keeping that function if it is not used?

Copy link
Contributor

@marckhouzam marckhouzam left a comment

Choose a reason for hiding this comment

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

Another very nice improvement. Thanks!

  1. Please add some release notes in the PR description.
  2. I still think doing this change for tanzu context create is just as important. I think it is a one line change? What do you think

pkg/command/context.go Outdated Show resolved Hide resolved
test/e2e/plugin_sync/k8s/plugin_sync_k8s_lifecycle_test.go Outdated Show resolved Hide resolved
pkg/command/context.go Outdated Show resolved Hide resolved
pkg/command/context.go Show resolved Hide resolved
pkg/command/context.go Outdated Show resolved Hide resolved
pkg/pluginmanager/manager.go Outdated Show resolved Hide resolved
@chandrareddyp
Copy link
Contributor Author

SyncPluginsForContextType

Removed it.

@chandrareddyp
Copy link
Contributor Author

Another very nice improvement. Thanks!

  1. Please add some release notes in the PR description.
  2. I still think doing this change for tanzu context create is just as important. I think it is a one line change? What do you think

Done

Copy link
Contributor

@marckhouzam marckhouzam left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks @chandrareddyp

@chandrareddyp chandrareddyp merged commit c8c3ee1 into main Oct 24, 2023
9 checks passed
@marckhouzam marckhouzam added this to the v1.1.0 milestone Oct 24, 2023
mpanchajanya pushed a commit that referenced this pull request Oct 24, 2023
mpanchajanya pushed a commit that referenced this pull request Oct 24, 2023
mpanchajanya pushed a commit that referenced this pull request Oct 24, 2023
@chandrareddyp chandrareddyp changed the title UX update for 'context use' to list plugins will be installed UX update for context create and context use to list plugins will be installed Oct 27, 2023
@chandrareddyp chandrareddyp deleted the topic/chandra/context-use-ux branch November 14, 2023 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants