Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Reformat messages that are displayed for REST request errors #993

Merged
merged 26 commits into from
Jun 27, 2023

Conversation

gejohnston
Copy link
Member

What It Does

The intent is to highlight the information that is relevant to the end user, and to appropriately categorize the additional details that are displayed. The enhancement was motivated by issue #935.

Because this could be considered a breaking change, The user enables this new behavior by setting the environment variable named ZOWE_V3_ERR_FORMAT to "true". Once Zowe V3 is released, the environment variable will no longer be needed. Zowe CLI will only display this new format in V3.

How to Test

Additional changes from the v3-err-format branch of zowe-cli must also be merged into master before all V3 error format changes are complete. To really test, the v3-err-format branches of both imperative and zowe-cli would have to be built locally (and CLI linked to the local imperative source) to get the exact results below.

One command that generates an error and demonstrates the behavior is zowe zos-files list all-members "DATASET.DOES.NOT.EXIST".

Running that command will display the following results.

image

Set ZOWE_V3_ERR_FORMAT to "true". Running the same command again will display the following results.

image

Review Checklist
I certify that I have:

Additional Comments

The imperative branch must be merged into master before the CLI pipeline can successfully build. I am opening up this imperative PR for review while I complete automated tests for the CLI branch. Once both PRs are approved, the CLI branch should be merged as soon as possible after the imperative branch.

Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Display HTTP response error message.

Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
to NextVerFeatures to avoid circular dependency.

Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
@codecov
Copy link

codecov bot commented Jun 20, 2023

Codecov Report

Patch coverage: 98.03% and project coverage change: +0.04 🎉

Comparison is base (721362b) 89.68% compared to head (ac509fd) 89.73%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #993      +/-   ##
==========================================
+ Coverage   89.68%   89.73%   +0.04%     
==========================================
  Files         210      211       +1     
  Lines       11431    11471      +40     
  Branches     2541     2554      +13     
==========================================
+ Hits        10252    10293      +41     
+ Misses       1179     1178       -1     
Impacted Files Coverage Δ
packages/rest/src/client/AbstractRestClient.ts 87.63% <93.75%> (+0.91%) ⬆️
packages/cmd/src/CommandProcessor.ts 88.91% <100.00%> (+0.39%) ⬆️
packages/utilities/index.ts 100.00% <100.00%> (ø)
packages/utilities/src/NextVerFeatures.ts 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@KevinLoesch1 KevinLoesch1 left a comment

Choose a reason for hiding this comment

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

LGTM, but a question regarding the sonarcloud failure. The code that is being flagged has not changed in years. Was that originally checked in before sonarcloud scanning was required?

@gejohnston
Copy link
Member Author

Re SonarCloud failure: This code was probably created before our use of SonarCloud. It certainly was in the code before I added anything. I guess the perspective is "you touched it, you own it". Even though this is a piece of test-code that is supposed to crash, I will take a swing at appeasing SonarCloud.

Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Copy link
Contributor

@adam-wolfe adam-wolfe left a comment

Choose a reason for hiding this comment

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

LGTM.

Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
@sonarcloud
Copy link

sonarcloud bot commented Jun 21, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 15 Code Smells

89.7% 89.7% Coverage
0.0% 0.0% Duplication

@gejohnston gejohnston merged commit 6210d32 into master Jun 27, 2023
@gejohnston gejohnston deleted the v3-err-format branch June 27, 2023 14:22
@gejohnston gejohnston added the release-minor Indicates a minor feature has been added label Jun 27, 2023
@github-actions
Copy link

Release succeeded for the master branch. 🎉

The following packages have been published:

  • npm: @zowe/imperative@5.15.0

Powered by Octorelease 🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-minor Indicates a minor feature has been added released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants