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

Pull secret validation did not enable Finish button - JBIDE-27064 #1910

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -154,13 +154,10 @@ private String validatePullSecret() {
String errorMessage = pullSecretValidation.validate(pullSecretFile,
(String error) -> {
togglePullSecretDecorator(error);
setComplete(error != null);
if (error != null) {
handle.setMessage(error, IMessageProvider.ERROR);
}
});
// dont complete until job validated pull secret
setComplete(false);
Copy link
Member

Choose a reason for hiding this comment

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

TBH I don't understand the use case as it is working for me. So you removed the setComplete flag management but it looks ok for me. Can you describe the scenario ?

Copy link
Member Author

Choose a reason for hiding this comment

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

You can create CRC adapter without this change?
I can unfortunately reply with the same: TBH I have no idea why it does not work without this change...

Copy link
Member Author

Choose a reason for hiding this comment

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

Problem is that one cannot get finish button enabled even if he uses proper crc binary and pull secret file.

Copy link
Member

Choose a reason for hiding this comment

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

Working good with 14.12.0.AM1.B5884

Copy link
Member Author

Choose a reason for hiding this comment

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

That's before the error occured. Can you please try newer one? I was reproducing this on B5949.

Copy link
Member Author

Choose a reason for hiding this comment

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

It came to me (I did not thoroughly check all the logical paths) that before there was no use of this setComplete method and logic whether enabled the button is here: https://github.com/jbosstools/jbosstools-openshift/blob/master/plugins/org.jboss.tools.openshift.cdk.server/src/org/jboss/tools/openshift/internal/cdk/server/ui/CDKServerWizardFragment.java#L63

Copy link
Member Author

Choose a reason for hiding this comment

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

I am taking back my previous statement. You seems to be right that how it is implemented should be ok and finish should get enabled after validation. BUT, it does not work. I will try to dig a bit more.

Copy link
Member Author

@odockal odockal Feb 25, 2020

Choose a reason for hiding this comment

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

It seems that there is something wrong in the sequence of calling some of CRC100ServerWizardFragment.PullSecretModifyListener#modifyText() -> CDKServerWizardFragment#validate() and CRC100ServerWizardFragment#findError(boolean) and CDKServerWizardFragment#isComplete().

Thing is, if CRC100ServerWizardFragment#findError(boolean) sets every time property complete to false here, it is ok when findError is called from validate, since the validate then sets complete property to correct value but it is not alright then findError is called from isComplete from the parent because the statement combines also super.isComplete which findError before sets to false, it never evaluates to true and finish button is never enabled.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

In short I think it is pointless to toggle completeness in findError at all because if findError method would return anything else than null it would not evaluate isComplete to true anyway.

togglePullSecretDecorator(errorMessage);
return errorMessage;
}
Expand Down