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

Add CEIP Opt-In support #143

Merged
merged 1 commit into from
Apr 3, 2023
Merged

Conversation

prkalle
Copy link
Contributor

@prkalle prkalle commented Mar 31, 2023

What this PR does / why we need it

This PR adds support for CEIP(Customer Experience Improvement Program) Opt-In support.

Summary of changes:

  • User would be prompted for CEIP Opt-In on any first tanzu command. Users choice would be persisted in the tanzu configuration file. Users can skip the prompt by providing their choice(yes/no) using the environment variable (TANZU_CLI_CEIP_OPT_IN_PROMPT_ANSWER) on the first use
  • Also added commands(experimental) "tanzu ceip-participation set" and "tanzu ceip-participation get" to get and set the CEIP Opt-In status. These commands may be deleted in future release if we decide to fold these commands functionality into existing tanzu telemetry plugin

Which issue(s) this PR fixes

Fixes #142

Describe testing done for PR

User would be prompted for CEIP opt-in choice on the first use( any tanzu command/plugin comamnd) as shown below.

❯ ./bin/tanzu plugin search
?
VMware's Customer Experience Improvement Program ("CEIP") provides VMware with information that enables VMware to improve its products and services and fix problems. By choosing to participate in CEIP, you agree that VMware may collect technical information about your use of VMware products and services on a regular basis. This information does not personally identify you.
For more details about the Program, please see http://www.vmware.com/trustvmware/ceip.html

Do you agree to Participate in the Customer Experience Improvement Program?
  [Use arrows to move, type to filter]
> Yes
  No

Based on the users selection, the status would be persisted in tanzu config-ng.yaml configuration file and user wouid not be prompted on subsequent tanzu command executions.

❯ ./bin/tanzu plugin search
  NAME                DESCRIPTION                           TARGET           VERSION      STATUS         CONTEXT
  isolated-cluster    Desc for isolated-cluster             global           v9.9.9       not installed
  pinniped-auth       Desc for pinniped-auth                global           v9.9.9       not installed
  cluster             Kubernetes cluster operations         kubernetes       v0.25.0-dev  not installed  tkg-aws-cc-capi115-upg-mc
  feature             Operate on features and featuregates  kubernetes       v0.25.0-dev  not installed  tkg-aws-cc-capi115-upg-mc
  kubernetes-release  Kubernetes release operations         kubernetes       v0.25.0-dev  not installed  tkg-aws-cc-capi115-upg-mc
  management-cluster  Desc for management-cluster           kubernetes       v9.9.9       not installed
  package             Desc for package                      kubernetes       v9.9.9       not installed
  secret              Desc for secret                       kubernetes       v9.9.9       not installed
  telemetry           Desc for telemetry                    kubernetes       v9.9.9       not installed
  account             Desc for account                      mission-control  v9.9.9       not installed
  apply               Desc for apply                        mission-control  v9.9.9       not installed
  audit               Desc for audit                        mission-control  v9.9.9       not installed
  cluster             Desc for cluster                      mission-control  v9.9.9       not installed
  clustergroup        Desc for clustergroup                 mission-control  v9.9.9       not installed
  continuousdelivery  Desc for continuousdelivery           mission-control  v9.9.9       not installed
  data-protection     Desc for data-protection              mission-control  v9.9.9       not installed
  ekscluster          Desc for ekscluster                   mission-control  v9.9.9       not installed
  events              Desc for events                       mission-control  v9.9.9       not installed
  helm                Desc for helm                         mission-control  v9.9.9       not installed
  iam                 Desc for iam                          mission-control  v9.9.9       not installed
  inspection          Desc for inspection                   mission-control  v9.9.9       not installed
  integration         Desc for integration                  mission-control  v9.9.9       not installed
  management-cluster  Desc for management-cluster           mission-control  v9.9.9       not installed
  policy              Desc for policy                       mission-control  v9.9.9       not installed
  secret              Desc for secret                       mission-control  v9.9.9       not installed
  tanzupackage        Desc for tanzupackage                 mission-control  v9.9.9       not installed
  workspace           Desc for workspace                    mission-control  v9.9.9       not installed

User can also skip the prompt by setting the environment variable TANZU_CLI_CEIP_OPT_IN_PROMPT_ANSWER to Yes or No

❯ export TANZU_CLI_CEIP_OPT_IN_PROMPT_ANSWER=no

❯ ./bin/tanzu plugin search
  NAME                DESCRIPTION                           TARGET           VERSION      STATUS         CONTEXT
  isolated-cluster    Desc for isolated-cluster             global           v9.9.9       not installed
  pinniped-auth       Desc for pinniped-auth                global           v9.9.9       not installed
  cluster             Kubernetes cluster operations         kubernetes       v0.25.0-dev  not installed  tkg-aws-cc-capi115-upg-mc
  feature             Operate on features and featuregates  kubernetes       v0.25.0-dev  not installed  tkg-aws-cc-capi115-upg-mc
  kubernetes-release  Kubernetes release operations         kubernetes       v0.25.0-dev  not installed  tkg-aws-cc-capi115-upg-mc
  management-cluster  Desc for management-cluster           kubernetes       v9.9.9       not installed
  package             Desc for package                      kubernetes       v9.9.9       not installed
  secret              Desc for secret                       kubernetes       v9.9.9       not installed
  telemetry           Desc for telemetry                    kubernetes       v9.9.9       not installed
  account             Desc for account                      mission-control  v9.9.9       not installed
  apply               Desc for apply                        mission-control  v9.9.9       not installed
  audit               Desc for audit                        mission-control  v9.9.9       not installed
  cluster             Desc for cluster                      mission-control  v9.9.9       not installed
  clustergroup        Desc for clustergroup                 mission-control  v9.9.9       not installed
  continuousdelivery  Desc for continuousdelivery           mission-control  v9.9.9       not installed
  data-protection     Desc for data-protection              mission-control  v9.9.9       not installed
  ekscluster          Desc for ekscluster                   mission-control  v9.9.9       not installed
  events              Desc for events                       mission-control  v9.9.9       not installed
  helm                Desc for helm                         mission-control  v9.9.9       not installed
  iam                 Desc for iam                          mission-control  v9.9.9       not installed
  inspection          Desc for inspection                   mission-control  v9.9.9       not installed
  integration         Desc for integration                  mission-control  v9.9.9       not installed
  management-cluster  Desc for management-cluster           mission-control  v9.9.9       not installed
  policy              Desc for policy                       mission-control  v9.9.9       not installed
  secret              Desc for secret                       mission-control  v9.9.9       not installed
  tanzupackage        Desc for tanzupackage                 mission-control  v9.9.9       not installed
  workspace           Desc for workspace                    mission-control  v9.9.9       not installed

User can get their current CEIP participation status using tanzu ceip-participation get command

❯ ./bin/tanzu ceip-participation get
  CEIP-STATUS
  Opt-in

User can update their current CEIP participation status using tanzu ceip-participation set command

❯ ./bin/tanzu ceip-participation set false
❯ ./bin/tanzu ceip-participation get
  CEIP-STATUS
  Opt-out

Release note

Add CEIP Opt-In support 

Additional information

Special notes for your reviewer

This PR is depending on tanzu-plugin-runtime PR:42. So build and CI jobs would fails. I will update the PR with tanzu-plugin-runtime dependency in go.mod dependency once the other PR is merged. However the PR is open for comments and PR.

Copy link
Contributor

@anujc25 anujc25 left a comment

Choose a reason for hiding this comment

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

Overall looks good. I will wait for the go mod dependencies to be updated before approving.

pkg/command/ceip_participation.go Outdated Show resolved Hide resolved
@prkalle prkalle force-pushed the feature/ceip-opt branch 2 times, most recently from eabcf4a to 5fd8cfe Compare April 3, 2023 17:07
Copy link
Contributor

@mpanchajanya mpanchajanya 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 for incorporating the validations and tests

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.

Thanks @prkalle. I noticed the commit message mentions the wrong environment variable.

@prkalle prkalle force-pushed the feature/ceip-opt branch 2 times, most recently from 23b73d0 to a9fb1a8 Compare April 3, 2023 18:25
@prkalle
Copy link
Contributor Author

prkalle commented Apr 3, 2023

Thanks @prkalle. I noticed the commit message mentions the wrong environment variable.

Thanks @marckhouzam . Upated the commit message.

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.

Shoot, this can break shell completion.

$ rm ~/.config/tanzu/config*
$ tz [tab][tab]
^[7^[[1A^[[0G^[[1A^[[0G^[8^[[?25h
^[7^[[?25l^[8^[[0G^[[2K^[[1;36m? ^[[0m^[[1;99m
^[[0m  ^[[36m[Use arrows to move, type to filter]^[[0m
^[[1;36m> Yes^[[0m
^[[39m  No^[[0m
Do you agree to Participate in the Customer Experience Improvement Program?
For more details about the Program, please see http://www.vmware.com/trustvmware/ceip.html
VMware's Customer Experience Improvement Program ("CEIP") provides VMware with information that enables VMware to improve its products and services and fix problems. By choosing to participate in CEIP, you agree that VMware may collect technical information about your use of VMware products and services on a regular basis. This information does not personally identify you.

It will also have an impact on OS packages that setup shell completion before the user ever uses tanzu. Also, if a user adds source <(tanzu completion bash) to their .bashrc file and at one point removes the config file, it will break their shell startup.

I suggest we disable this prompt for the completion and __complete commands.

.github/workflows/cli_core_e2e_test.yaml Outdated Show resolved Hide resolved
- User would be prompted for CEIP Opt-In on any first tanzu command. Users choice would be persisted in the tanzu configuration file. Users can skip the prompt by providing their choice(yes/no) using the environment variable (TANZU_CLI_CEIP_OPT_IN_PROMPT_ANSWER) on the first use
- Also added commands(experimental) "tanzu ceip-participation set" and "tanzu ceip-participation get" to get and set the CEIP Opt-In status

Signed-off-by: Prem Kumar Kalle <pkalle@vmware.com>
@prkalle
Copy link
Contributor Author

prkalle commented Apr 3, 2023

It will also have an impact on OS packages that setup shell completion before the user ever uses tanzu. Also, if a user adds source <(tanzu completion bash) to their .bashrc file and at one point removes the config file, it will break their shell startup.

I suggest we disable this prompt for the completion and __complete commands.

@marckhouzam thanks for pointing out. Updated the PR as you suggested.

Copy link
Contributor

@chandrareddyp chandrareddyp left a comment

Choose a reason for hiding this comment

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

LGTM!

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 @prkalle

@prkalle prkalle merged commit 3ea91ae into vmware-tanzu:main Apr 3, 2023
@vuil vuil added the kind/feature Categorizes issue or PR as related to a new feature label Apr 7, 2023
@marckhouzam marckhouzam added this to the v0.90.0 milestone Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha-testing-prereq cla-not-required kind/feature Categorizes issue or PR as related to a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add CEIP Opt-In support
7 participants