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

Deprecation of Commands Requires Replacement Command #2041

Open
awharn opened this issue Feb 8, 2024 · 2 comments
Open

Deprecation of Commands Requires Replacement Command #2041

awharn opened this issue Feb 8, 2024 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers priority-medium Not functioning - next quarter if capacity permits severity-low Bug that makes the usage of the Zowe less convenient but doesn't impact key use cases

Comments

@awharn
Copy link
Member

awharn commented Feb 8, 2024

Describe the bug

If a command is deprecated, the functionality in Imperative only handles if a command was deprecated with a suggested replacement. With the deprecation of IMS, there is no replacement for any of these commands. The function should be able to take in an empty string for the recommended replacement, and if the string is empty, it should not display the recommended replacement message.

public static showMsgWhenDeprecated(handlerParms: IHandlerParameters) {
if (handlerParms.definition.deprecatedReplacement) {
// form the command that is deprecated
let oldCmd: string;
if (handlerParms.positionals.length >= 1) {
oldCmd = handlerParms.positionals[0];
}
if (handlerParms.positionals.length >= 2) {
oldCmd = oldCmd + " " + handlerParms.positionals[1];
}
// display the message
handlerParms.response.console.error("\nWarning: The command '" + oldCmd + "' is deprecated.");
handlerParms.response.console.error("Recommended replacement: " +
handlerParms.definition.deprecatedReplacement);
}
}

Additional context

This could also be considered an enhancement, but with V2 entering maintenance soon, I believe this should qualify as a bug fix. This will allow extenders to add this message to any deprecated plug-ins / commands that may go away in the future, and potentially begin to warn consumers in V2. There is currently no way to warn consumers of a deprecated command without a replacement, aside from displaying the line Recommended replacement: none.

@awharn awharn added bug Something isn't working new The issue wasn't triaged yet labels Feb 8, 2024
Copy link

github-actions bot commented Feb 8, 2024

Thank you for creating a bug report.
We will investigate the bug and evaluate its impact on the product.
If you haven't already, please ensure you have provided steps to reproduce the bug and as much context as possible.

@gejohnston
Copy link
Member

Would it be beneficial to the consumer if apps supply replacement text that is similar to the following text?
"Obsolete component. No replacement exists."

@JTonda JTonda added good first issue Good for newcomers priority-medium Not functioning - next quarter if capacity permits severity-low Bug that makes the usage of the Zowe less convenient but doesn't impact key use cases and removed new The issue wasn't triaged yet labels Feb 12, 2024
@adam-wolfe adam-wolfe mentioned this issue Apr 19, 2024
23 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers priority-medium Not functioning - next quarter if capacity permits severity-low Bug that makes the usage of the Zowe less convenient but doesn't impact key use cases
Projects
Status: Medium Priority
Development

No branches or pull requests

3 participants