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

[WFCORE-6541] Patch high level command should be completely disabled … #5701

Merged
merged 2 commits into from
Oct 12, 2023

Conversation

yersan
Copy link
Collaborator

@yersan yersan commented Oct 5, 2023

…in standalone mode

Jira issue: https://issues.redhat.com/browse/WFCORE-6541

@yersan yersan requested a review from jfdenise October 5, 2023 11:58
@github-actions github-actions bot added the deps-ok Dependencies have been checked, and there are no significant changes label Oct 5, 2023
@yersan yersan added the 22.x label Oct 5, 2023
@yersan yersan marked this pull request as draft October 5, 2023 13:41
@wildfly-ci

This comment was marked as outdated.

// mode to patch legacy host controllers. Therefore, we allow the Help Command to progress with "patch" command
// only in domain mode.
if ("patch".equals(mainCommand) && !ctx.isDomainMode()) {
throw new CommandException("The command is not available in the current context.");
Copy link
Contributor

Choose a reason for hiding this comment

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

This should say something about standalone/domain, as this text isn't helpful enough for 'help' :)

Copy link
Contributor

Choose a reason for hiding this comment

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

@yersan , you added a comment, I am wandering if the Exception message should be evolved with more information?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I misunderstood the first revision from @bstansberry , he was talking about the message thrown by the exception and I thought he was talking about the code comments.

The Exception message is printed directly in the CLI output, so it can also be used to give more context.

So we could use it to show more information. The difficulties are what sort of message we want to add here. I could suggest the following:

"
The 'patch' command is only available in a Domain Mode to patch legacy Host Controllers but is deactivated for standalone or disconnected sessions. See 'help installer' to get more information about how to patch your server.
"

Maybe we could review the "installer" help page to also explain when you have to use the Prospero tool and when the installer. Notice the installer command is not available on embedded Server / Host controllers, basically because we need to restart a running server to apply the update.

I see both options, allowing "help patch" to progress and adding a more descriptive text there sounds also reasonable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jfdenise Could you add your opinion about this one?

I guess, I am just waiting to know whether we want to fix this by describing the information in the "patch" help page without removing the availability of "help patch" or by removing the ability of the "help patch" and showing the above message in the exception

Copy link
Contributor

Choose a reason for hiding this comment

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

@yersan , I feel that I prefer the help doc to be updated. The command exists but is just enabled in some cases. The help doc could explain.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @jfdenise , I've updated the PR accordingly

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jfdenise Could you review again? thanks!

@bstansberry
Copy link
Contributor

@jfdenise approved this so it's fine for now (except my wording comment), but is this how we want 'help' to work in the long run? Or should help not be limited by context like this and it's the help text itself that explains any limitations.

I can see it either way, but my impression is this is the first time we've limited 'help' in this way, despite having other implementations of CommandActivator.

@yersan yersan marked this pull request as ready for review October 5, 2023 17:48
@yersan
Copy link
Collaborator Author

yersan commented Oct 5, 2023

Or should help not be limited by context like this and it's the help text itself that explains any limitations.

That's a good point @bstansberry . If the "patch" command is executed in an invalid context, the second action to take by the user would be to inspect the help to get more information about why. The help can explain why it is not valid for the current context.
The other way around gives the user no additional information; only that the command is not available under the current context. Using the help makes more sense / looks more useful.

@yersan yersan requested a review from jfdenise October 6, 2023 09:49
@yersan yersan added 23.x and removed 22.x labels Oct 6, 2023
@wildfly-ci
Copy link

Core -> Full Integration Build 13121 outcome was UNKNOWN using a merge of 147934b
Summary: Canceled (Tests passed: 1457, ignored: 22; exit code 143 (Step: Build & test full (Maven)) (new)) Build time: 00:10:12

@wildfly-ci
Copy link

Core -> Full Integration Build 12897 outcome was UNKNOWN using a merge of 147934b
Summary: Canceled (Tests passed: 290, ignored: 6; exit code 1 (Step: Build & test full (Maven)) (new)) Build time: 00:10:17

@wildfly-ci

This comment was marked as off-topic.

@yersan yersan added the ready-for-merge This PR is ready to be merged and fulfills all requirements label Oct 12, 2023
@yersan yersan merged commit eb66796 into wildfly:main Oct 12, 2023
1 check passed
@yersan yersan deleted the WFCORE-6541 branch October 12, 2023 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deps-ok Dependencies have been checked, and there are no significant changes ready-for-merge This PR is ready to be merged and fulfills all requirements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants