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

Remove the 'zowe profiles' command group #2013

Merged
merged 70 commits into from
Jan 19, 2024
Merged

Remove the 'zowe profiles' command group #2013

merged 70 commits into from
Jan 19, 2024

Conversation

gejohnston
Copy link
Member

@gejohnston gejohnston commented Jan 9, 2024

What It Does

This PR removes the command definitions for the zowe profiles command group. Thus, end-users will no longer be able to run any command from the profiles command group. It also removes the initialization of the profiles directory that previously occurred in the Imperative.init() function.

The majority of the changes in this PR come from re-implementing all automated tests that created a V1 profile in order to perform a desired operation.

This PR also fixes numerous system tests that failed due to changes to the Zowe error message format.

How to Test

  1. Run a profiles command, and see that zowe tells you that such a command does not exist. For example:
    > zowe profiles create zosmf-profile YourZosmfProfileName --host YourHost --port 123 --user YourUser --pass "YourPassword"
    Unable to perform this operation due to the following problem.
    Command failed due to improper syntax
    Unknown group: profiles
    Did you mean: files create zos-file-system?
    
    Command entered: "profiles create zosmf-profile YourZosmfProfileName --host YourHost --port 123 --user YourUser --pass YourPassword"
    Use "zowe --help" to view groups, commands, and options.
    
  2. Place some existing V1 profiles into the ZOWE_CLI_HOME\profiles directory and run a command to successfully convert those profiles to a team config.
    zowe config convert-profiles
    

Review Checklist
I certify that I have:

Additional Comments

gejohnston and others added 30 commits November 30, 2023 17:56
…neratedCommands

Remove call to CliProfileManager.initialize from Imperative.init.
Remove BasicProfileManager.initialize.
Remove AbstractProfileManager.createProfileTypeDirectory

Signed-off-by: Gene Johnston <[email protected]>
Signed-off-by: Gene Johnston <[email protected]>
Signed-off-by: Gene Johnston <[email protected]>
Signed-off-by: Gene Johnston <[email protected]>
Signed-off-by: Andrew W. Harn <[email protected]>
Signed-off-by: Andrew W. Harn <[email protected]>
Signed-off-by: Andrew W. Harn <[email protected]>
@gejohnston
Copy link
Member Author

Regarding the failure of the codecov check:

All of the identified 'failures' are related to new code that was added to properly pass system test failures. So, clearly that code is being tested. Those tests are just not being counted as part of the code coverage metric.

Further, these updates address fixes related to the new error format. Our new error format is not the objective of this pull request.

For these reasons, I feel justified in not addressing the failure of the codecov check in this Pull request.

Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

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

Changes LGTM so far! 😋

I'm still missing about 20 files to review, but I should probably provide feedback now and then continue with the rest 😋

Copy link
Member

@t1m0thyj t1m0thyj left a comment

Choose a reason for hiding this comment

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

Thanks @gejohnston and @awharn for all your work on this! Appreciate the improvements to our tests that were made along the way like better error handling in Bash scripts and reducing usage of snapshots 🙂 Left a few comments

Comment on lines +11 to +14
Response From Service
Error: Unknown arguments: foo-bar, fooBar

Diagnostic Information
Copy link
Member

Choose a reason for hiding this comment

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

It seems odd to me to show the "Unknown arguments" error in the "Response From Service" category. There is no response from the service if client-side validation fails before a request is issued. And the error message is duplicated in the "Diagnostic Information" below. Is this an intended behavior of the new error formatting in v3?

Copy link
Member Author

@gejohnston gejohnston Jan 12, 2024

Choose a reason for hiding this comment

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

The error format handling typically takes properties from a REST response (or an imperative error) and places them under the most appropriate titles. When we never get to the remote service, values are filled in with the available information.

In the case of the zos-tso command run in this test, here is the output from running the same command interactively:

-> zowe zos-tso start as --foo-bar
Unable to perform this operation due to the following problem.
Unknown arguments: foo-bar, fooBar
Command failed due to improper syntax
Command entered: "zos-tso start as --foo-bar"
Available commands are "address-space".
Use "zowe zos-tso start --help" to view groups, commands, and options.

Response From Service
Error: Unknown arguments: foo-bar, fooBar

Diagnostic Information
Unknown arguments: foo-bar, fooBar

I feel that the objectives of this PR to remove V1 profile definitions (and fix the inability of system test scripts to properly detect newly formatted errors) are being met. I think that additional changes should be handled outside this PR.

It might be valid to open an issue about how the zos-tso command group prepares its error message content (or how the error formatting logic choses to display that content).

It might be informative to run this same command in a V2 installation with old error formatting.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the output of the command in the old error format:

$ zowe zos-tso start as --foo-bar
Command Error:
Unknown arguments: foo-bar, fooBar
Command failed due to improper syntax
Command entered: "zos-tso start as --foo-bar"
Available commands are "address-space".
Use "zowe zos-tso start --help" to view groups, commands, and options.
Error Details:
Unknown arguments: foo-bar, fooBar

@JTonda JTonda requested review from t1m0thyj and zFernand0 January 17, 2024 16:04
Copy link
Member

@zFernand0 zFernand0 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 reusing the exitOnFailure.sh script. It must've been painful to get the right number of ../, so thank you! 😋
Also, thanks for adding descriptions to most/all variables in our test .sh scripts 😋

I think the only thing left to do is the very small change to the .sh script that Timothy suggested (to use the baseCertFile required parameter) 😋

That being said, I do think this PR is ready to be merged since most/all system test worked the last time they ran (internally).


If possible, I would like for this PR to be merged and published on it's own.
That way Zowe Explorer can test with this individual version, unless we think the master update and the imperative flattening should be part of the ZE tests around zowe profiles removal.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

19.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

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

Thanks for addressing Timothy's comments.

Re-approving! LGTM! 😋

Copy link
Member

@traeok traeok 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 @gejohnston and @awharn for your work on this PR!

@gejohnston gejohnston merged commit bb0fcba into next Jan 19, 2024
28 of 30 checks passed
@gejohnston gejohnston deleted the no-v1-profiles branch January 19, 2024 15:06
@gejohnston gejohnston added the release-minor Indicates a minor feature has been added label Jan 19, 2024
@github-actions github-actions bot removed the release-minor Indicates a minor feature has been added label Jan 19, 2024
Copy link

Release failed for the next branch. 😢

Error: The process '/opt/hostedtoolcache/node/20.10.0/x64/bin/npm' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/zowe-actions/octorelease/v1/dist/npm.js:974:21)
    at ExecState.CheckComplete (/home/runner/work/_actions/zowe-actions/octorelease/v1/dist/npm.js:960:16)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/zowe-actions/octorelease/v1/dist/npm.js:863:21)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)

Check the workflow run for more error details.

Powered by Octorelease 🚀

1 similar comment
Copy link

Release failed for the next branch. 😢

Error: The process '/opt/hostedtoolcache/node/20.10.0/x64/bin/npm' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/zowe-actions/octorelease/v1/dist/npm.js:974:21)
    at ExecState.CheckComplete (/home/runner/work/_actions/zowe-actions/octorelease/v1/dist/npm.js:960:16)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/zowe-actions/octorelease/v1/dist/npm.js:863:21)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)

Check the workflow run for more error details.

Powered by Octorelease 🚀

@zFernand0
Copy link
Member

Release failed for the next branch. 😢

Error: The process '/opt/hostedtoolcache/node/20.10.0/x64/bin/npm' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/zowe-actions/octorelease/v1/dist/npm.js:974:21)
    at ExecState.CheckComplete (/home/runner/work/_actions/zowe-actions/octorelease/v1/dist/npm.js:960:16)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/zowe-actions/octorelease/v1/dist/npm.js:863:21)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)

Check the workflow run for more error details.

Powered by Octorelease 🚀

This should be fixed by the following PR:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants