Bug 152065 - add support for deprecating patches
Summary: add support for deprecating patches
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 enhancement with 2 votes (vote)
Target Milestone: 3.1   Edit
Assignee: Frank Becker CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, noteworthy
: 152676 165075 (view as bug list)
Depends on: 153788
Blocks: 211072
  Show dependency tree
 
Reported: 2006-07-27 17:09 EDT by Mik Kersten CLA
Modified: 2009-01-19 19:50 EST (History)
13 users (show)

See Also:


Attachments
mylyn/context/zip (3.77 KB, application/octet-stream)
2007-09-11 17:57 EDT, Eugene Kuleshov CLA
no flags Details
patch (17.30 KB, patch)
2008-11-12 16:56 EST, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (2.93 KB, application/octet-stream)
2008-11-12 16:56 EST, Frank Becker CLA
no flags Details
new patch (18.10 KB, patch)
2008-11-14 17:33 EST, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (15.27 KB, application/octet-stream)
2008-11-14 17:34 EST, Frank Becker CLA
no flags Details
updated patch (18.84 KB, patch)
2008-11-29 17:00 EST, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (15.43 KB, application/octet-stream)
2008-11-29 17:00 EST, Frank Becker CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mik Kersten CLA 2006-07-27 17:09:15 EDT
There is no way to deprecate a patch in our UI, so people are either relying on the web UI to do this or not doing it.
Comment 1 Jeff Pound CLA 2006-08-03 18:56:06 EDT
Any UI suggestions for this?

We could add another wizard page for attachment creation, but that makes 4 with the preview page. (Though this one and the preview are both optional)

An alternative would be to add a table to the attachment details page where users could select attachments which are depricated. This would make the whole dialog larger.
Comment 2 Mik Kersten CLA 2006-08-03 23:53:04 EDT
How about just adding a context menu action to attachments called "Mark Obsolete"?  It varies from the Bugzilla interaction, but I think that it is more obvious, easier to implement, and needs to be there anyway.  Then if enough people complain we can add a table to the wizard page.
Comment 3 Eugene Kuleshov CLA 2006-08-04 00:33:40 EDT
Please alo add "unmark obsolette" too. I suppose it would submit change right away?
Comment 4 Jeff Pound CLA 2006-08-04 00:47:22 EDT
We could make it immediate to be in line with the way that uploading attachments work. However we should establish what is immediate and what is not or users might start getting confused. If I change the priority and bug ownership, its not updated until I hit submit. If I add an attachment or mark one obsolete, it updates immediately... There is a natural reason why w.r.t bugzilla (each of those is its own transaction) but that isn't necessarily obvious to the user.


Un-obsolete is doable as well.
Comment 5 Mik Kersten CLA 2006-08-04 00:59:25 EDT
Excellent point, we need to draw a clear line and I'm probably blurring it too much.  Our current or example, we may want to enable priority setting for repository tasks via the task list, and those should take place immediately.

For now I'm tempted to keep with the eclipse.org convention that everything in the editor does not take effect until it is 'saved', which in our case is a combo of save and submit (e.g. direct actions can only be done via the task list or via a wizard, which is in line with conventions).  So maybe the best thing for you to do for now is to create a page for deprecating patches, and  pop up that single page if "Mark Obsolete" is clicked??
Comment 6 Eugene Kuleshov CLA 2006-08-04 03:10:11 EDT
Hmm. On a second though, wouldn't it make sense to make all the changes without submission and submit everything at once when user hit Submit button? That should include attachments as well. But attachments should immediately appear in the attachments table once they added.

It may also make sense to add an "Obsolete" column with checkboxes that user can uncheck to mark attachments obsolete...
Comment 7 Mik Kersten CLA 2006-08-04 03:36:06 EDT
We'll have to discuss this further before deciding, and should wait for Rob since he has spent a lot of time thinking about the editor interaction.

Jeff: for now just stick with the current interaction and put the deprecation functionality into the wizard, since it will most likely always be needed there.
Comment 8 Eugene Kuleshov CLA 2006-08-04 03:40:08 EDT
(In reply to comment #7)
> Jeff: for now just stick with the current interaction and put the deprecation
> functionality into the wizard, since it will most likely always be needed
> there.

Heh. It would of saved time if that would be done in the attachment table right in the editor. Even if those changes are not submitted immediately... Note that it would also allowed to obsolete existing patches without submitting a new one.
Comment 9 Jeff Pound CLA 2006-08-11 13:50:19 EDT
The IAttachmentHandler API doesn't support a way to depricate patches. How should we handle this? I've implemented everything to be generic in the tasks namespace so far, maybe this should be bugzilla specific? The RepositoryAttachment class has an isObsolete() method so it seems the concept of obsolete attachments is generic to all repo types, perhaps an obsoleteAttachment() method should be added to the IAttachmentHandler instead of making this bugzilla specific.

thoughts?
Comment 10 Robert Elves CLA 2006-08-11 14:21:09 EDT
Since other attributes may change, perhaps we need a more generic method like updateAttachment(...)? That way we don't have methods for each attribute that may change.
Comment 11 Willian Mitsuda CLA 2006-08-11 14:54:54 EDT
Just a thought: we are now discussing about the applicability of the "attachment deprecation" on connectors other than bugzilla.

In fact, there may be other capabilities who are applicable to bugzilla but not in other connector(s), and vice-versa.

The problem here is to define a stable interface not tied to any specific repository connector.

I didn't take a look on the connector architecture used in Mylar, but I presume it is actually based on a interface hierarchy implemented by concrete connectors.

Have you considered adopting a adapter-based architecture like in ECF Container's model?

This way there can be a number of interfaces defining "capabilities" that a connector can have, and each connector implements the interfaces for the capabilities it supports.

In this model, if you want to know if a connector X supports a capability Y, all you have to do is ask it for the corresponding interface via IAdapterManager.

Of course, maybe this can be a complex solution to this specific issue, but it is something that we can face when considering how to evolve the connector architecture in a flexible way.

Just my 0,02 cents...
Comment 12 Jeff Pound CLA 2006-08-14 13:13:46 EDT
The UI components are in place in the wizard (it will be easy enough to add operations to the context menu of the attachment table too if needed). I've filed bug 153788 to track the issue of creating generic API to allow depricating (and other generic operations) on repository attachments.
Comment 13 Erkki Lindpere CLA 2006-11-18 19:30:02 EST
*** Bug 165075 has been marked as a duplicate of this bug. ***
Comment 14 Mik Kersten CLA 2006-11-22 13:52:33 EST
Jeff: I'm assuming that you won't be able to get to this soon.

Would definitely be nice to have, but need to mark as "helpwanted" for now.
Comment 15 Eugene Kuleshov CLA 2006-11-22 14:09:28 EST
By the way, Mik, were you able to finish applying patches trough new 3.3 API?
Comment 16 Willian Mitsuda CLA 2006-11-22 14:10:42 EST
(In reply to comment #14)
> Would definitely be nice to have, but need to mark as "helpwanted" for now.

Mik, do you confirm if the "core" functionality is fully implemented and only the UI is left? (I'm assuming that fixing bug#153788 was sufficient for this).
Comment 17 Mik Kersten CLA 2006-11-22 16:08:30 EST
No, it is not currently implemented for Bugzilla (see BugzillaAttachmentHandler).
Comment 18 Mik Kersten CLA 2006-11-22 16:09:04 EST
Btw, for what it's worth Rob says it shouldn't be that hard to do, because it's just a post with the right ID inserted.
Comment 19 Eugene Kuleshov CLA 2006-11-22 16:21:35 EST
Mik, was it reply to Willian's question or mine?

(comment #15)
> By the way, Mik, were you able to finish applying patches trough new 3.3 API?


Comment 20 Willian Mitsuda CLA 2006-11-22 16:30:53 EST
(In reply to comment #19)
> Mik, was it reply to Willian's question or mine?

He forgot to use the new, fancy, reply button from bug#161479 :)

Sorry, I couldn't resist the joke...
Comment 21 Eugene Kuleshov CLA 2006-11-22 16:34:51 EST
(In reply to comment #20)
> (In reply to comment #19)
> > Mik, was it reply to Willian's question or mine?
> He forgot to use the new, fancy, reply button from bug#161479 :)

I guess he just couldn't see that button on his big screen. It is so small. :-)
Comment 22 Robert Elves CLA 2006-11-22 16:37:17 EST
:)
Comment 23 Mik Kersten CLA 2006-11-22 18:28:06 EST
Hey, it's not that hard to see because we kept the saturated version ;)

 (In reply to comment #15)
> By the way, Mik, were you able to finish applying patches trough new 3.3 API?

He he.  OK, so I got 90% through this (bug 103932) but couldn't make the Apply Patch wizard read in the patch when it was written to a temporary file outside of the workspace.  I may be able to give it a little more time this week but not much.  I pinged Jeff to see if he was interested in helping out on it but no reply.
Comment 24 Eugene Kuleshov CLA 2006-11-22 19:09:44 EST
Hmm. Don't they have resource-based way to get to the patch content? Or something like ISource used for editors...
Comment 25 Karsten Becker CLA 2007-05-29 10:04:34 EDT
I really would like to see that feature. At the moment I use the web ui for it which is not what I really want to do.
Comment 26 Mik Kersten CLA 2007-06-06 10:22:08 EDT
Unfortunately we can't add this to our 2.0 list right now, so it won't make it in without a patch and I'll leave it as helpwanted for now.  Agreed that going to the Web UI for this is a pain right now.
Comment 27 Mik Kersten CLA 2007-06-06 10:24:23 EDT
*** Bug 152676 has been marked as a duplicate of this bug. ***
Comment 28 Chris Aniszczyk CLA 2007-09-11 16:21:25 EDT
A context would be nice for this one.
Comment 29 Eugene Kuleshov CLA 2007-09-11 17:57:50 EDT
I think "deprecate" action need to be added to the popup menu for the attachment table created in AbstractRepositoryTaskEditor.createAttachmentLayout(). Action would call AbstractAttachmentHandler.updateAttachment() which should delegate to new method in BugzillaCleint which would update attachment status.

New test case could go into BugzillaRepositoryConnectorTest, which already have one testcase for attachment reading or into the new test class for BugzillaAttachmentHandler.
Comment 30 Eugene Kuleshov CLA 2007-09-11 17:57:57 EDT
Created attachment 78110 [details]
mylyn/context/zip
Comment 31 Chris Aniszczyk CLA 2007-09-11 18:34:56 EDT
Thanks Eugene, no commitments yet :)

This is irritating me quite a bit so in the spirit of open-source, I may be irritated enough to contribute :)
Comment 32 Raphael Ackermann CLA 2007-11-14 18:32:12 EST
 (In reply to comment #29)
> I think "deprecate" action need to be added to the popup menu for the attachment
> table created in AbstractRepositoryTaskEditor.createAttachmentLayout(). Action
> would call AbstractAttachmentHandler.updateAttachment() which should delegate to
> new method in BugzillaCleint which would update attachment status.

I've done the first few things but got stuck trying to write a method to update the attachment status in the Bugzilla Client. Any pointers as to how this can be done? Do I have to look at the bugzilla documentation or check out similar functionality somewhere in Mylyn?
Comment 33 Robert Elves CLA 2007-11-14 18:53:30 EST
It looks like you'll need to do a HttpPost to attachment.cgi similar to the attachment edit page does. There isn't any support for this in the BugzillaClient but shouldn't be too hard to add.

<form method="post" action="attachment.cgi" onsubmit="normalizeComments();">
  <input type="hidden" name="id" value="78110">
  <input type="hidden" name="action" value="update">
    ...
            <input type="checkbox" id="ispatch" name="ispatch" value="1">
          <label for="ispatch">patch</label>
          <input type="checkbox" id="isobsolete" name="isobsolete" value="1">
          <label for="isobsolete">obsolete</label>
          
         
Comment 34 Shawn Minto CLA 2007-11-14 18:57:52 EST
On this point of deprecating attachments, maybe this should be made more generic to allow for deletion as well.  Many repositories allow for deletion of attachments, where I see deprecation as more of a bugzilla-centric operation.  Is this feasible to add?

209880: add support for deleting attachments
https://bugs.eclipse.org/bugs/show_bug.cgi?id=209880
Comment 35 Nick Boldt CLA 2008-09-29 15:19:37 EDT
+1 for being able to mark patches obsoleted/deprecated by subsequent patches w/o having to hit the website.
Comment 36 Mik Kersten CLA 2008-10-01 21:46:38 EDT
It would be great to have this.

We don't currently have the cycles to put it on the 3.1 plan.  Is anyone interested in contributing it?
Comment 37 Robert Elves CLA 2008-10-03 14:04:35 EDT
Frank, would you be interested in adding this functionality? See comment#33 for a pointer.
Comment 38 Frank Becker CLA 2008-11-12 16:56:14 EST
Created attachment 117720 [details]
patch

first try, please verify.

An jUnit test is included but must changed to an MylynTest Repository.
Comment 39 Frank Becker CLA 2008-11-12 16:56:26 EST
Created attachment 117721 [details]
mylyn/context/zip
Comment 40 Steffen Pingel CLA 2008-11-12 22:34:09 EST
Good stuff! One suggestion for refactoring: I would like to avoid any changes in the tasks framework for this since deprecating patches is a Bugzilla specific feature. Frank, it should be possible to only contribute the action for Bugzilla attachments (e.g. look at how RetrieveContextAttachmentHandler works).

It would also be great if the action supported selection of more than one attachment.
Comment 41 Frank Becker CLA 2008-11-13 15:57:31 EST
(In reply to comment #40)
> Good stuff! One suggestion for refactoring: I would like to avoid any changes
> in the tasks framework for this since deprecating patches is a Bugzilla
> specific feature. Frank, it should be possible to only contribute the action
> for Bugzilla attachments (e.g. look at how RetrieveContextAttachmentHandler
> works).
I looked at comment#34 and was under the impression that update of attachments is not Bugzilla specific. That was the reason for the change of the task framwork.

> 
> It would also be great if the action supported selection of more than one
> attachment.
> 

OK I think I have to create an Job to do this with user feedback.
Comment 42 Frank Becker CLA 2008-11-14 17:33:58 EST
Created attachment 117959 [details]
new patch

(In reply to comment #40)
> Good stuff! One suggestion for refactoring: I would like to avoid any changes in
> the tasks framework for this since deprecating patches is a Bugzilla specific
> feature. Frank, it should be possible to only contribute the action for Bugzilla
> attachments (e.g. look at how RetrieveContextAttachmentHandler works).
Hope that this patch include the things that you want to have.
> It would also be great if the action supported selection of more than one
> attachment.
This is now part of the patch.
Comment 43 Frank Becker CLA 2008-11-14 17:34:11 EST
Created attachment 117960 [details]
mylyn/context/zip
Comment 44 Steffen Pingel CLA 2008-11-26 13:57:06 EST
Rob, the patch looks good to me. The only changes I would suggest is to not modify ReposonseKind but use a Bugzilla specific return type in postUpdateAttachment instead and to generalize the editor refresh in UpdateAttachmentJob (see SynchronizeEditorAction).
Comment 45 Frank Becker CLA 2008-11-29 17:00:10 EST
Created attachment 119082 [details]
updated patch

(In reply to comment #44)
> Rob, the patch looks good to me. The only changes I would suggest is to not
> modify ReposonseKind but use a Bugzilla specific return type in
> postUpdateAttachment instead and to generalize the editor refresh in
> UpdateAttachmentJob (see SynchronizeEditorAction).
> 

This is now included.
Comment 46 Frank Becker CLA 2008-11-29 17:00:24 EST
Created attachment 119083 [details]
mylyn/context/zip
Comment 47 Robert Elves CLA 2008-12-01 21:25:22 EST
Filed CQ:  2867
Comment 48 Frank Becker CLA 2008-12-03 15:50:20 EST
(In reply to comment #47)
> Filed CQ:  2867
> 

All changes in the patch submitted in comment#45 were authored by me and I have the right to contribute this code to Eclipse.
Comment 49 Robert Elves CLA 2008-12-12 19:57:22 EST
The CQ was approved. Patch applied, ip log updated.  Further refinements to this feature will take place on  bug#258717.