zowe / zowe-cli

Zowe CLI
Eclipse Public License 2.0
108 stars 85 forks source link

Provide a new ConvertV1Profiles class for converting V1 profiles #2113

Closed gejohnston closed 2 months ago

gejohnston commented 2 months ago

What It Does

The new ConvertV1Profiles class enables apps to convert V1 profiles into a current Zowe client configuration file.

The primary function of the convert profiles command remains the same. The following changes were introduced:

The ConvertV1Profiles.convert API was written to work better for apps that are not a command line program.

How to Test

The impact on end-users can be tested by running the convert profiles command in various scenarios. Because V1 profiles can no longer be created in V3, it can be difficult to create useful test data. The following screenshots demonstrate several known scenarios.

In a simple situation the output looks like the screenshot below. In this scenario, the V1 SCS plugin was already installed, and the convert profiles command uninstalled that plugin.

image

When you also ask to delete your old profiles, you are prompted to confirm the deletion. The output looks like this:

image

When an error occurs, the output looks like this:

image

When the old V1 SCS plugin is configured as the CredentialManager for Zowe, the .zowe\settings\imperative.json looks like this:

{
  "overrides": {
    "CredentialManager": "@zowe/secure-credential-store-for-zowe-cli"
  }
}

When configured like this, ALL zowe commands will display a warning that the Credential Manager is not in the list of known credential managers. The command then attempts its operation. An example of a zowe-files list command shows this behavior.

image

Also, when configured like this, the plugins uninstall @zowe/secure-credential-store-for-zowe-cli command (like all Zowe commands) displays the same CredentialManager warning. It also display a set of NPM warnings when uninstalling the V1 SCS plugin, even though it successfully uninstalls the SCS plugin.

image

The warnings above are not a result of the convert profiles command, but they do affect the convert profiles command because:

  1. It is a zowe command and all zowe commands get the CredentialManager warnings in this scenario.
  2. It automatically uninstalls the SCS plugin, so it gets the NPM warnings that occur from the plugins uninstall operation.

Despite the warnings in such a configuration, the convert profiles command converts the V1 profiles, uninstalls the SCS plugin, and restores the Zowe built-in CredentialManager.

image

As proof that the convert profiles command has restored the built-in CredentialManager, when you now run the zos-files list command, you no longer get the CredentialManager warning.

image

Review Checklist I certify that I have:

Additional Comments

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 99.68051% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 90.96%. Comparing base (03d99c8) to head (f72d69c). Report is 2 commits behind head on next.

Files Patch % Lines
...g/cmd/convert-profiles/convert-profiles.handler.ts 97.50% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## next #2113 +/- ## ========================================== + Coverage 90.91% 90.96% +0.05% ========================================== Files 616 618 +2 Lines 17376 17473 +97 Branches 3590 3600 +10 ========================================== + Hits 15797 15895 +98 + Misses 1578 1577 -1 Partials 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sonarcloud[bot] commented 2 months ago

Quality Gate Failed Quality Gate failed

Failed conditions
3.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

github-actions[bot] commented 2 months ago

Release succeeded for the next branch. :tada:

The following packages have been published:

Powered by Octorelease :rocket: