Skip to content

Commit

Permalink
Merge pull request #1856 from zowe/removeDeprecatedImp
Browse files Browse the repository at this point in the history
Remove deprecated imperative constants, options, and methods - Imperative
  • Loading branch information
zFernand0 authored Nov 14, 2023
2 parents 31baeca + 9de50fa commit ad2f748
Show file tree
Hide file tree
Showing 50 changed files with 89 additions and 3,517 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"commandModuleGlobs": [
"**/*.definition!(.d).*s"
],
"pluginHealthCheck": "./lib/HealthCheck.handler",
"rootCommandDescription": "CA Endevor SCM plug-in for listing Endevor environment information, working with elements and packages located in specified Endevor instance.",
"envVariablePrefix": "ENDEVOR",
"defaultHome": "C:\\Users\\ej608771/.endevor",
Expand Down Expand Up @@ -309,7 +308,6 @@
"commandModuleGlobs": [
"**/cli/*/*.definition!(.d).*s"
],
"pluginHealthCheck": "C:\\Users\\ej608771\\.zowe\\plugins\\installed\\node_modules\\@broadcom\\jclcheck-for-zowe-cli\\lib/healthCheck.handler",
"pluginSummary": "JCLCheck plugin",
"pluginAliases": [
"jck"
Expand Down
15 changes: 15 additions & 0 deletions packages/imperative/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

All notable changes to the Imperative package will be documented in this file.

## Recent Changes

- LTS Breaking: Removed the following previously deprecated items:
- `flattenCommandTreeWithAliases()` -- Use `CommandUtils.flattenCommandTree()` instead
- `AbstractAuthHandler.getPromptParams()` -- Use `getAuthHandlerApi()` instead
- `BaseAuthHandler.getPromptParams()` -- Use `getAuthHandlerApi()` instead
- `promptForInput()` -- Use the asynchronous method `readPrompt()` instead
- `promptWithTimeout()` -- Use `readPrompt` instead which supports more options
- `Imperative.envVariablePrefix` -- Use `ImperativeConfig.instance.envVariablePrefix` instead
- `pluginHealthCheck()` -- Plugins that want to perform a health check can
specify the `pluginLifeCycle` property to load a class from the plugin.
The plugin can implement the `postInstall()` function of that class to perform
a health check, or any other desired operation.
- `IProfOpts.requireKeytar` -- removing the default implementation of `require("keytar")` from the caller app's node_modules folders

## `8.0.0-next.202311141517`

- LTS Breaking: Replaced the previously deprecated function AbstractCommandYargs.getBrightYargsResponse - use AbstractCommandYargs.getZoweYargsResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,88 +247,6 @@ describe("Validate plugin", () => {
expect(result.status).toEqual(1);
});

// TODO: remove this test in V3, when pluginHealthCheck is removed
it("missing pluginHealthCheck property", () => {
const testPlugin = "missing_pluginHealthCheck";
const fullPluginPath = join(testPluginDir, "error_plugins", testPlugin);

let cmd = `plugins install ${fullPluginPath}`;
let result = T.executeTestCLICommand(cliBin, this, cmd.split(" "));
expect(result.stdout).toContain(`Installed plugin name = '${testPlugin}'`);

cmd = `plugins validate ${testPlugin}`;
result = T.executeTestCLICommand(cliBin, this, cmd.split(" "));
result.stderr = removeNewline(result.stderr);
expect(result.stdout).toContain(testPlugin);
expect(result.stdout).toContain("This plugin was successfully validated. Enjoy the plugin.");
expect(result.stdout).not.toContain("Warning");
expect(result.stdout).not.toContain("The plugin's configuration does not contain an 'imperative.pluginHealthCheck' property.");
expect(result.stderr).not.toContain("Problems detected during plugin validation.");
expect(result.status).toEqual(0);
});

// TODO: remove this test in V3, when pluginHealthCheck is removed
it("missing pluginHealthCheck property - warning", () => {
const testPlugin = "missing_pluginHealthCheck";
const fullPluginPath = join(testPluginDir, "error_plugins", testPlugin);

let cmd = `plugins install ${fullPluginPath}`;
let result = T.executeTestCLICommand(cliBin, this, cmd.split(" "));
expect(result.stdout).toContain(`Installed plugin name = '${testPlugin}'`);

cmd = `plugins validate ${testPlugin} --fail-on-warning`;
result = T.executeTestCLICommand(cliBin, this, cmd.split(" "));
result.stderr = removeNewline(result.stderr);
expect(result.stdout).toContain(testPlugin);
expect(result.stdout).toContain("This plugin was successfully validated. Enjoy the plugin.");
expect(result.stdout).not.toContain("Warning");
expect(result.stdout).not.toContain("The plugin's configuration does not contain an 'imperative.pluginHealthCheck' property.");
expect(result.stderr).not.toContain("Problems detected during plugin validation.");
expect(result.status).toEqual(0);
});

// TODO: remove this test in V3, when pluginHealthCheck is removed
it("missing pluginHealthCheck handler", () => {
const testPlugin = "missing_healthcheck_handler";
const fullPluginPath = join(testPluginDir, "error_plugins", testPlugin);

let cmd = `plugins install ${fullPluginPath}`;
let result = T.executeTestCLICommand(cliBin, this, cmd.split(" "));
expect(result.stdout).toContain(`Installed plugin name = '${testPlugin}'`);

cmd = `plugins validate ${testPlugin} --no-fail-on-error`;
result = T.executeTestCLICommand(cliBin, this, cmd.split(" "));
result.stderr = removeNewline(result.stderr);
expect(result.stdout).toContain(testPlugin);
expect(result.stdout).toContain("This plugin was successfully validated. Enjoy the plugin.");
expect(result.stdout).not.toContain("Error");
expect(result.stdout).not.toContain(`The program for the 'imperative.pluginHealthCheck' property does not exist:`);
expect(result.stdout).not.toContain("This plugin has configuration errors. No component of the plugin will be available");
expect(result.stderr).not.toContain("Problems detected during plugin validation.");
expect(result.status).toEqual(0);
});

// TODO: remove this test in V3, when pluginHealthCheck is removed
it("missing pluginHealthCheck handler - error", () => {
const testPlugin = "missing_healthcheck_handler";
const fullPluginPath = join(testPluginDir, "error_plugins", testPlugin);

let cmd = `plugins install ${fullPluginPath}`;
let result = T.executeTestCLICommand(cliBin, this, cmd.split(" "));
expect(result.stdout).toContain(`Installed plugin name = '${testPlugin}'`);

cmd = `plugins validate ${testPlugin}`;
result = T.executeTestCLICommand(cliBin, this, cmd.split(" "));
result.stderr = removeNewline(result.stderr);
expect(result.stdout).toContain(testPlugin);
expect(result.stdout).toContain("This plugin was successfully validated. Enjoy the plugin.");
expect(result.stdout).not.toContain("Error");
expect(result.stdout).not.toContain(`The program for the 'imperative.pluginHealthCheck' property does not exist:`);
expect(result.stdout).not.toContain("This plugin has configuration errors. No component of the plugin will be available");
expect(result.stderr).not.toContain("Problems detected during plugin validation.");
expect(result.status).toEqual(0);
});

it("missing peerDependencies properties", () => {
const testPlugin = "missing_dependencies";
const fullPluginPath = join(testPluginDir, "error_plugins", testPlugin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "chained-handler-plugin",
"rootCommandDescription": "imperative working test plugin",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./lib/sample-plugin/healthCheck.handler",
"pluginAliases": [
"chp",
"chainedhandlerp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "definition_bad_chained_handler",
"rootCommandDescription": "definition bad chained handler",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./dummy.handler",
"definitions": [
{
"name": "foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "definition_empty_array",
"rootCommandDescription": "definition empty array",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./dummy.handler",
"definitions": []
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "definition_empty_chained_handler",
"rootCommandDescription": "definition empty chained handler",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./dummy.handler",
"definitions": [
{
"name": "foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "definition_missing_chained_handler",
"rootCommandDescription": "definition missing chained handler",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./dummy.handler",
"definitions": [
{
"name": "foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "definition_missing_description",
"rootCommandDescription": "definition missing description",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./dummy.handler",
"definitions": [
{
"name": "foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "definition_missing_handler",
"rootCommandDescription": "definition missing handler",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./dummy.handler",
"definitions": [
{
"name": "foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "definition_missing_name",
"rootCommandDescription": "definition missing name",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./dummy.handler",
"definitions": [
{
"description": "dummy foo command",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "definition_missing_type",
"rootCommandDescription": "definition missing type",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./dummy.handler",
"definitions": [
{
"name": "foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "definition_type_group_without_children",
"rootCommandDescription": "definition type group without children",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./dummy.handler",
"definitions": [
{
"name": "foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "plugins",
"rootCommandDescription": "duplicated base cli command",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./dummy.handler",
"definitions": [
{
"name": "foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "normal-plugin",
"rootCommandDescription": "duplicated installed plugin command",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./dummy.handler",
"definitions": [
{
"name": "foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "incompatible_imperative_version",
"rootCommandDescription": "imperative working test plugin",
"pluginBaseCliVersion": "^2.0.0",
"pluginHealthCheck": "./dummy.handler",
"definitions": [
{
"name": "foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "missing_command_handler",
"rootCommandDescription": "imperative working test plugin",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./dummy.handler",
"definitions": [
{
"name": "foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"imperative": {
"name": "missing_definitions",
"rootCommandDescription": "missing definitions",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./dummy.handler"
"pluginBaseCliVersion": "^1.0.0"
},
"peerDependencies": {
"@zowe/imperative": "1.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "missing_dependencies",
"rootCommandDescription": "imperative working test plugin",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./dummy.handler",
"definitions": [
{
"name": "foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "missing_healthcheck_handler",
"rootCommandDescription": "imperative working test plugin",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./non_existing_path",
"definitions": [
{
"name": "foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"imperative": {
"name": "missing_pluginBaseCliVersion",
"rootCommandDescription": "imperative working test plugin",
"pluginHealthCheck": "./dummy.handler",
"definitions": [
{
"name": "foo",
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"imperative": {
"name": "missing_rootCommandDescription",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./dummy.handler",
"definitions": [
{
"name": "foo",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"imperative": {
"rootCommandDescription": "missing name plugin",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./dummy.handler",
"definitions": [
{
"name": "foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "normal-plugin",
"rootCommandDescription": "imperative working test plugin",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./lib/sample-plugin/healthCheck.handler",
"pluginAliases": [
"np",
"normalp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "normal-plugin-2",
"rootCommandDescription": "imperative working test plugin 2",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./lib/sample-plugin/healthCheck.handler",
"definitions": [
{
"name": "foo",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "normal-plugin-misc",
"rootCommandDescription": "imperative working test plugin",
"pluginBaseCliVersion": "^1.0.0",
"pluginHealthCheck": "./lib/sample-plugin/healthCheck.handler",
"pluginAliases": [
"misc"
],
Expand Down
Loading

0 comments on commit ad2f748

Please sign in to comment.