zowe / zowe-cli

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

Display messages before prompting for properties #2123

Closed gejohnston closed 2 months ago

gejohnston commented 2 months ago

What It Does

Display informative messages identifying why a user is being prompted for connection properties during a CLI command

How to Test

Create a situation where some connection properties are missing. Run a Zowe command. See the messages before the prompts.

Three scenarios exist in which messages are displayed.

  1. You have no configuration of any type. Note that unless your zosmf port is the default 443 value, the command will fail. This is the pre-existing behavior of Zowe CLI.
    
    zowe zos-files list data-set "SYS1.PARMLIB*"
    No Zowe client configuration exists.
    Therefore, you will be asked for the connection properties
    that are required to complete your command.

Enter the host name of your service: YourHostName Enter the user name for your service (will be hidden): Enter the password for your service (will be hidden):


2. You only have V1 profiles. Same behavior regarding the zosmf port.

zowe zos-files list data-set "SYS1.PARMLIB*" Only V1 profiles exist. V1 profiles are no longer supported. You should convert your V1 profiles to a newer Zowe client configuration. Therefore, you will be asked for the connection properties that are required to complete your command.

Enter the host name of your service: YourHostName Enter the user name for your service (will be hidden): Enter the password for your service (will be hidden):


3. Some properties are missing in your zowe.config.json file. In this example, hostname is missing, and autoStore is true.

zowe zos-files list data-set "SYS1.PARMLIB*" Some required connection properties have not been specified in your Zowe client configuration. Therefore, you will be asked for the connection properties that are required to complete your command.

Enter the host name of your service: YourHostName Stored properties in C:\path\to\your\config\directory\zowe.config.json: host SYS1.PARMLIB SYS1.PARMLIB.ARCHIVE SYS1.PARMLIB.NEW SYS1.PARMLIBN



**Review Checklist**
I certify that I have:
- [x] tested my changes
- [x] added/updated automated tests
- [x] updated the changelog
- [x] followed the [contribution guidelines](https://github.com/zowe/zowe-cli/blob/master/CONTRIBUTING.md)

**Additional Comments**
<!-- Anything else noteworthy about this pull request. This section is optional. -->
codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.98%. Comparing base (f72d69c) to head (1aa48a3). Report is 2 commits behind head on next.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## next #2123 +/- ## ========================================== + Coverage 90.96% 90.98% +0.01% ========================================== Files 618 618 Lines 17473 17484 +11 Branches 3600 3605 +5 ========================================== + Hits 15895 15907 +12 + Misses 1577 1576 -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 Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
89.8% Coverage on New Code
0.0% Duplication on New Code

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: