Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 172085

Summary: [api] generalize repository validation
Product: z_Archived Reporter: Willian Mitsuda <wmitsuda>
Component: MylynAssignee: Steffen Pingel <steffen.pingel>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: robert.elves, steffen.pingel
Version: 1.0   
Target Milestone: 2.0 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
generalize repository validation
none
mylar/context/zip none

Description Willian Mitsuda CLA 2007-01-29 18:19:04 EST
The "Validate" button does nothing on Web connector. If I'm not wrong I remember someone said once it does nothing on Jira (or Trac?) too.

This is confusing because users think that if there is a "Validate" button, it is because it works.

See bug#171907 comment#3 for a recent case.
Comment 1 Eugene Kuleshov CLA 2007-01-30 00:26:00 EST
Not true for JIRA. It does verify credentials there. You probably misinterpreted the comment I made to Mik that workaround to call validate does nothing. I was referring to the fact that validate is not invalidating the login token.
Comment 2 Mik Kersten CLA 2007-02-01 20:24:08 EST
It should still be removed for the web connector, where it does not do anything.
Comment 3 Eugene Kuleshov CLA 2007-02-01 20:42:07 EST
(In reply to comment #2)
> It should still be removed for the web connector, where it does not do
> anything.

Agreed. 

I thought I already suggested to replace a validate method with method that would return validator instance. So, connector can choose to return null and then abstract dialog can disable button. That should also allow to move lots of error reporting into the abstract class.

Comment 4 Mik Kersten CLA 2007-02-01 22:14:25 EST
Sounds good to me.  Are you proposing to do that?  If so you can do it on this bug, but it should be tagged [api].
Comment 5 Eugene Kuleshov CLA 2007-02-01 22:21:28 EST
 (In reply to comment #4)
Mik, I was hoping that you or Rob could do that because it will affect all connectors and this change is quite straightforward.

At some point Steffen also had some objections to the unified way to present errors.
Comment 6 Steffen Pingel CLA 2007-02-18 13:15:31 EST
I think we should switch to displaying the status in the wizard message area for all connectors. With latest milestone the warning dialogs look rather awkward and their focus is blocked by other modal dialogs (on my Linux box). 

Eugene, are you currently working on this? I have already implemented a Validator class for Trac which I could generalize and move to AbstractRepositorySettingsPage. Feel free to assign this task to me.
Comment 7 Mik Kersten CLA 2007-02-19 14:02:01 EST
That would be a nice improvement Steffen, over to you.
Comment 8 Eugene Kuleshov CLA 2007-02-19 14:27:21 EST
I am not working on it. Please generalize away. :-)
Comment 9 Steffen Pingel CLA 2007-02-19 18:03:19 EST
Created attachment 59327 [details]
generalize repository validation

API for repository validation and implementation for Trac and JIRA. Rob, I'll leave Bugzilla to you, so you can check if the API makes sense :). The patch does not break previous validation implementations but requires the implementation of getValidator() which may return null. I have also added a capability for validations so the validate button is not displayed for web repositories anymore.
Comment 10 Steffen Pingel CLA 2007-02-19 18:03:21 EST
Created attachment 59328 [details]
mylar/context/zip
Comment 11 Mik Kersten CLA 2007-02-19 18:17:50 EST
Rob: please review.
Comment 12 Robert Elves CLA 2007-02-19 20:54:30 EST
Patch applied. Looks good Steffen. I was able to easily rework Bugzilla to use the new api.
Comment 13 Steffen Pingel CLA 2007-02-19 22:19:53 EST
Great, closing report.