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

Conversation

odockal
Copy link
Member

@odockal odockal commented Feb 19, 2020

Signed-off-by: Ondrej Dockal odockal@redhat.com

Pull Request Checklist

General

  • Is this a blocking issue or new feature? If yes, QE needs to +1 this PR

Code

  • Are method-/class-/variable-names meaningful?
  • Are methods concise, not too long?
  • Are catch blocks catching precise Exceptions only (no catch all)?

Testing

  • Are there unit-tests?
  • Are there integration tests (or at least a jira to tackle these)?
  • Is the non-happy path working, too?
  • Are other parts that use the same component still working fine?

Function

  • Does it work?

Signed-off-by: Ondrej Dockal <odockal@redhat.com>
@sonarcloud
Copy link

sonarcloud bot commented Feb 19, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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.

@jeffmaury
Copy link
Member

I managed to reproduce from master. The problem with your PR is that Finish button is enabled as soon as you select the CRC binary. I figured out that the problem was that:

  1. complete was set to true if there was an error from the validating job (should be the opposite)
  2. validating job was not spawned the first first (ie pullSecretFile is null)
  3. upon spawning validating job setComplete was always set to false where it should be based on the returned error message.

See my PR #1912

@odockal
Copy link
Member Author

odockal commented Feb 26, 2020

Closed in favor of #1912.

@odockal odockal closed this Feb 26, 2020
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.

None yet

2 participants