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

Bug 198027

Summary: reassigning doesn't work with Bugzilla 3.1
Product: z_Archived Reporter: Albert Ting <altlist>
Component: MylynAssignee: Frank Becker <eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P5 CC: robert.elves
Version: unspecifiedKeywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
mylyn/context/zip
none
patch with fix for Bugzilla 3.1
none
mylyn/context/zip
none
correted Patch
none
mylyn/context/zip none

Description Albert Ting CLA 2007-07-26 17:01:53 EDT
I am not able to reassign a ticket with bugzilla 3.1.  Main issue is that 3.1 uses a different flow for reassigning a ticket, rather than setting the status knob to "reassign".

This may be tied to bug 189209 and the new customized workflow.
Comment 1 Robert Elves CLA 2007-07-29 23:53:21 EDT
Bugzilla 3.1 stream isn't currently supported but we will need to resolve this at some point. 
Comment 2 Mik Kersten CLA 2007-08-13 23:10:10 EDT
We could take a contribution if anyone is interested.
Comment 3 Frank Becker CLA 2007-08-19 15:19:48 EDT
Hi I work on this and have now the question.

How can I detected the Bugzilla version from BugzillaTaskEditor, this should be used to generate two ways to generate the peopleLayout.
Comment 4 Frank Becker CLA 2007-08-19 15:24:20 EDT
Created attachment 76397 [details]
mylyn/context/zip
Comment 5 Frank Becker CLA 2007-08-20 15:54:32 EDT
Created attachment 76485 [details]
patch with fix for Bugzilla 3.1

Please see if this can be used as a fix for this bug
Comment 6 Frank Becker CLA 2007-08-20 15:54:34 EDT
Created attachment 76486 [details]
mylyn/context/zip
Comment 7 Robert Elves CLA 2007-08-20 20:41:31 EDT
 (In reply to comment #3)
> How can I detected the Bugzilla version from BugzillaTaskEditor, this should be
> used to generate two ways to generate the peopleLayout.

Sorry I didn't get back to you sooner Frank. Looks like you found your way to the repository configuration for the version though. ;)

When you post a patch, we've been adding the [patch] label to the beginning of the summary. By doing this your patch will get attention sooner.

Patch is looking good. Only problem I found were the changes to BugzillaTaskDataHandler. This effectively drops the reassign capability (at least for < 3.1 repositories).

Reassigning to you Frank...
Comment 8 Frank Becker CLA 2007-08-21 00:44:11 EDT
(In reply to comment #7)
>  (In reply to comment #3)
> > How can I detected the Bugzilla version from BugzillaTaskEditor, this should be
> > used to generate two ways to generate the peopleLayout.
> 
> Sorry I didn't get back to you sooner Frank. Looks like you found your way to
> the repository configuration for the version though. ;)
> 
> When you post a patch, we've been adding the [patch] label to the beginning of
> the summary. By doing this your patch will get attention sooner.
> 
> Patch is looking good. Only problem I found were the changes to
> BugzillaTaskDataHandler. This effectively drops the reassign capability (at
> least for < 3.1 repositories).
You are right. It is my mistake, I forgot to look how I get the repository version within BugzillaTaskDataHandler. Actually I must go to work (it is morning in germany). I look at this, but this will not be before 11 pm today.
> 
> Reassigning to you Frank...
> 

Comment 9 Frank Becker CLA 2007-08-21 23:19:09 EDT
Created attachment 76605 [details]
correted Patch

Here is the corrected Patch.

BTW here some questiones

Do I need to add some JUnit Tests?
Is it OK that I only add a JavaDoc in AbstractRepositoryTaskEditor.java for addAssignedTo?
Is BugzillaCorePlugin.getRepositoryConfiguration(repository, false).getInstallVersion() the right way to test the Bugzilla Version?
Comment 10 Frank Becker CLA 2007-08-21 23:19:15 EDT
Created attachment 76606 [details]
mylyn/context/zip
Comment 11 Robert Elves CLA 2007-08-22 16:50:28 EDT
Great. Patch applied, ip log updated. Verified against 3.0 but unable to test against 3.1 here.
 
 (In reply to comment #9)
> Do I need to add some JUnit Tests?
Yes, this is a perfect example of a patch that should ideally be accompanied with a unit test. It would test bug reassignment against both mylyn.eclipse.org/bugs222 and mylyn.eclipse.org/bugs31 (the latter doesn't exist yet though since we don't officially support 3.1). 

Ideally all patches should come with a unit test with the exception of some ui related code that can be tricky to test (although we can usually find a way).

> Is it OK that I only add a JavaDoc in AbstractRepositoryTaskEditor.java for
> addAssignedTo?
Yes, documenting new public api is good.

> Is BugzillaCorePlugin.getRepositoryConfiguration(repository,
> false).getInstallVersion() the right way to test the Bugzilla Version?
Yes, though note that this could block if the configuration hasn't yet been retrieved so needs to be used with that in mind. By the time the editor is opening the configuration would have been retrieved. Worst case scenario here is they don't have a configuration and the editor takes an unusually long time to open. 
Comment 12 Frank Becker CLA 2007-08-23 17:35:09 EDT
> (In reply to comment #9)
> > Do I need to add some JUnit Tests?
> Yes, this is a perfect example of a patch that should ideally be accompanied
> with a unit test. It would test bug reassignment against both
> mylyn.eclipse.org/bugs222 and mylyn.eclipse.org/bugs31 (the latter doesn't exist
> yet though since we don't officially support 3.1).
> 
This is the first time I create an JUnit test.
So please tell me in which JUnitfile a find an good starting example for do the test with mylyn.eclipse.org/bugs222.
Comment 13 Robert Elves CLA 2007-08-23 20:06:12 EDT
See BugzillaRepositoryConnectorTest, you could append your tests there.
Comment 14 Frank Becker CLA 2007-08-25 01:15:09 EDT
 (In reply to comment #13)
> See BugzillaRepositoryConnectorTest, you could append your tests there.

Sorry I have some questions:

Should I create an new bug in the testbugzilla and how is this done(can't fond code for this)
Is it allowed to submit a new bug with every the test run

Comment 15 Robert Elves CLA 2007-08-27 13:28:45 EDT
You can just pick a more recently created bug report that isn't already being used by automated tests and use it for reassign tests. This test may be a bit tricky to write though since you may need to use two accounts (so you can reassign it back). We may want to hold off on this until we have a 3.1 repository setup as well.