Bug 263528 - display a repository service message to warn users of problems, updates, and other relevant information
Summary: display a repository service message to warn users of problems, updates, and ...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 enhancement (vote)
Target Milestone: 3.4   Edit
Assignee: Robert Elves CLA
QA Contact: Robert Elves CLA
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2009-02-03 15:05 EST by Mik Kersten CLA
Modified: 2010-06-04 16:13 EDT (History)
6 users (show)

See Also:


Attachments
v1 (32.67 KB, text/plain)
2010-05-07 15:10 EDT, Robert Elves CLA
no flags Details
v1 (32.90 KB, patch)
2010-05-07 15:28 EDT, Robert Elves CLA
no flags Details | Diff
mylyn/context/zip (1.18 MB, application/octet-stream)
2010-05-07 15:28 EDT, Robert Elves CLA
no flags Details
v1 Screenshot (6.07 KB, image/png)
2010-05-07 15:29 EDT, Robert Elves CLA
no flags Details
v2 (49.74 KB, patch)
2010-05-22 17:44 EDT, Robert Elves CLA
no flags Details | Diff
mylyn/context/zip (413.97 KB, application/octet-stream)
2010-05-22 17:44 EDT, Robert Elves CLA
no flags Details
v3 (56.11 KB, patch)
2010-05-22 22:45 EDT, Steffen Pingel CLA
no flags Details | Diff
v4 (86.17 KB, patch)
2010-05-24 18:08 EDT, Robert Elves CLA
no flags Details | Diff
mylyn/context/zip (281.36 KB, application/octet-stream)
2010-05-24 18:08 EDT, Robert Elves CLA
no flags Details
v4 repost (52.63 KB, patch)
2010-05-24 19:14 EDT, Robert Elves CLA
no flags Details | Diff
v5 (54.00 KB, patch)
2010-05-25 15:01 EDT, Robert Elves CLA
no flags Details | Diff
v6 (8.01 KB, patch)
2010-05-25 17:01 EDT, Robert Elves CLA
no flags Details | Diff
initial message (25.31 KB, image/png)
2010-05-31 21:00 EDT, Steffen Pingel CLA
no flags Details
screenshot 2 (9.81 KB, image/png)
2010-06-03 13:01 EDT, Robert Elves CLA
no flags Details
patch to disable service message job and preferences (13.49 KB, patch)
2010-06-03 23:05 EDT, Robert Elves CLA
no flags Details | Diff
mylyn/context/zip (110.22 KB, application/octet-stream)
2010-06-03 23:05 EDT, Robert Elves 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 2009-02-03 15:05:17 EST
As per the discussion on bug 244441, this will help insulate us from incompatibilities between the our rich client and the server.

Sits at <repo-url>/service-message.xml, e.g., https://bugs.eclipse.org/bugs/service-message.xml

Suggested format:
<message>
	<id>2009-09-03</id>
	<type>{warning, info, error}</type>
	<connector>bugzilla</connector>
	<version-repository>3.2.0</version-repository>
	<version-mylyn>3.0.3</version-mylyn>
	<summary>Bugzilla 3.2.0 not fully supported, click here to update.</summary>
	<details>... HTML formatted message pointing to update site, etc ...</details>
</message>

Message is checked whenever the repository configuration is updated.

When the Mylyn version is smaller or equal to "version-mylyn" AND the task repository version is smaller than or equal to "version-repository" the "summary" String is displayed in the task editor's header, as the appropriate type, for each editor opened for that repository, unless user has asked to ignore messages.

When user clicks the hyperlink for the message, dialog opens showing HTML-formatted summary of the message, and offers to not display again.
Comment 1 Mik Kersten CLA 2009-02-03 15:07:56 EST
We might need to consider this for 3.0.4/3.0.5.
Comment 2 Mik Kersten CLA 2009-06-11 13:41:26 EDT
If this goes on the backlog I think it should be a P1, since every year we encounter problems which eat up a lot of time, and could be addressed with such a message.
Comment 3 Mik Kersten CLA 2010-01-07 13:09:31 EST
API suggestion: AbstractRepositoryConnectorUi.getServiceMessage(), can return something ServiceMessage.OK if all is good.
Comment 4 Frank Becker CLA 2010-01-11 14:59:00 EST
Should I start with the implementation of the core code for this?

1) RepostioryConfiguration	: add support for store the message
2) Bugzilla Client					: add methods to get the xml file
3) RepostioryConfiguration	: evaluate the ServiceMessage state
Comment 5 Mik Kersten CLA 2010-01-18 18:11:07 EST
I accidentally changed this from P1 to P4.

Frank: We discussed the design of this on the Mylyn call, so Rob will fill you in on that.  Thanks for stepping up, this will be a very valuable feature.
Comment 6 Robert Elves CLA 2010-01-18 18:43:34 EST
(In reply to comment #4)
> Should I start with the implementation of the core code for this?
> 
> 1) RepostioryConfiguration	: add support for store the message
> 2) Bugzilla Client					: add methods to get the xml file
> 3) RepostioryConfiguration	: evaluate the ServiceMessage state

Since this will just be an additional xml file hosted on the server, is doesn't necessarily need to be part of the repository configuration (just retrieved at the same time perhaps). Might also want to consider using the preference store for maintaining the last read timestamp vs the configuration. This would make it easier to eventually pull up into the framework for other connectors to use.
Comment 7 Steffen Pingel CLA 2010-01-19 08:21:53 EST
I am in favor of storing per repository information on the corresponding TaskRepository object. It makes the life-cycle management easier and the same API available to all connectors. We already have several per-task/repository preferences that are not properly cleaned up when repositories are deleted or URLs are changed (e.g. editor mementos).
Comment 8 Robert Elves CLA 2010-01-19 15:56:43 EST
Good call Steffen, the TaskRepository properties is a perfect spot for this.
Comment 9 Mik Kersten CLA 2010-04-30 00:13:18 EDT
I think we can use this for our recently discussed feature of showing users when a Mylyn update is available, etc.  So instead of the task editor, let's show this on the Task List view.

Rob: shawn has some code in Tasktop that we can use for showing a nice gradient region at the bottom of the view.  We just need a close icon on that, which we can take from the desktop notifications popup.  I think the component itself should go into ..mylyn.commons.ui.  In terms of UI, I think it should look like this: 

pre. 
[32px image] [bold title]
						 [message text, up to 140 characters]

Frank: I assume it makes sense to take this off your plate since you've got other important 3.4 stuff underway.
Comment 10 Robert Elves CLA 2010-05-06 20:17:21 EDT
Just need to do some testing and will have a rough first pass done at this.
Comment 11 Robert Elves CLA 2010-05-07 15:10:56 EDT
Created attachment 167544 [details]
v1

First pass at this. Numerous things to consider and still a layout/wrapping issue with the ui. This version is rudimentary in
Comment 12 Robert Elves CLA 2010-05-07 15:28:43 EDT
Created attachment 167547 [details]
v1

First pass at this. Numerous things to consider and still a layout/wrapping issue with the ui. The message xml format is relatively simple at this point (see below) and uses a string identifier to add a standard message dialog icon in the top left. A close button is on the top right (but doesn't layout correctly when the task list is resized). The long description doesn't wrap either.  Closing a message will result in that message not being displayed again.  The message is currently retrieved from eclipse.org/mylyn/message.xml.

<ServiceMessage> 
<id>1</id> 
<description>140 character description here....</description> 
<title>Mylyn 3.4 now available!</title> 
<url>http://eclipse.org/mylyn/downloads</url> 
<image>dialog_messasge_info_image</image> 
</ServiceMessage>
Comment 13 Robert Elves CLA 2010-05-07 15:28:52 EDT
Created attachment 167548 [details]
mylyn/context/zip
Comment 14 Robert Elves CLA 2010-05-07 15:29:42 EDT
Created attachment 167550 [details]
v1 Screenshot
Comment 15 Robert Elves CLA 2010-05-13 13:27:30 EDT
Points from UI review:
* Include preference for disablement
* Include Mylyn version number at a minimum in order to ensure appropriate messages are displayed
* Further investigation required to fix layout issue
Comment 16 Robert Elves CLA 2010-05-18 13:32:14 EDT
* ETag support
Comment 17 Robert Elves CLA 2010-05-22 17:44:04 EDT
Created attachment 169594 [details]
v2

Includes Etag support, a preference for disablement, and ability to only display when installed Mylyn version is <= version specified in message xml.  Layout issue remains.
Comment 18 Robert Elves CLA 2010-05-22 17:44:17 EDT
Created attachment 169595 [details]
mylyn/context/zip
Comment 19 Robert Elves CLA 2010-05-22 17:47:28 EDT
Steffen, I need fresh eyes to look at the layout issue and review the progress made here if you get a chance.
Comment 20 Steffen Pingel CLA 2010-05-22 22:45:53 EDT
Created attachment 169603 [details]
v3
Comment 21 Steffen Pingel CLA 2010-05-22 22:46:24 EDT
This looks pretty good Rob! 

I have applied a couple of changes:
* The servicemessage package is now called notifications and exported as x-internal. Please make sure you have API tooling setup with a current base line to catch errors of this sort.
* The enum identifiers in ServiceMessage are now all upper case to follow convention.
* I replaced MylynVersion by the corresponding OSGi version and made the XML version a range. The element is now called version and not mylynVersion.
* Why did the patch change the labels for weekStartCombo in TasksUiPreferencesPage? I have reverted that.
* I changed the error logging to only occur once per session.
* I removed the check for the content length header and instead handled 404 (i.e. no message available). You can not assume that server will always return a content length, e.g. when chunked encoding is used.
* I added support for parsing of multiple message, e.g. if there are separate messages for different Mylyn versions
* I unregistered the message listener on Task List dispose.
* I used shared form colors for the rendering.

Outstanding issues:
* There needs to be a preference listener to disable the service control and to stop the job. Using a null message to handle that is not obvious and Go Into can actually make the message re-appear.
* Polling every two hours is way too frequently.  Isn't once a session/once a week sufficient?
* I am a little concerned that control is always constructed even if a message is never displayed. How difficult would it be to construct and dispose the control as messages are displayed and hidden?
* I managed to make the control visible without a valid message which caused null pointers. Some checks are missing.
* Shouldn't there be a way to disable message from the message control?
* What is the reason for nesting informationComp? Why not use head directly as a parent for the controls?
Comment 22 Robert Elves CLA 2010-05-23 09:03:32 EDT
Wow, overhaul appreciated! ;)  I expect to have time to pick this up again this evening or tomorrow.  (In reply to comment #21)

> Outstanding issues:
> * There needs to be a preference listener to disable the service control and to
> stop the job. Using a null message to handle that is not obvious and Go Into can
> actually make the message re-appear.

Yes this would be ideal.

> * Polling every two hours is way too frequently.  Isn't once a session/once a
> week sufficient?

Debatable. Maybe twice a week? Should of course be using pubsub...

> * I am a little concerned that control is always constructed even if a message
> is never displayed. How difficult would it be to construct and dispose the
> control as messages are displayed and hidden?

This could be done, I'll look into that.

> * I managed to make the control visible without a valid message which caused
> null pointers. Some checks are missing.

Okay.

> * Shouldn't there be a way to disable message from the message control?

How about a check box lower left in a smaller font?    [x] Disable

> * What is the reason for nesting informationComp? Why not use head directly as a
> parent for the controls?
This is likely left over from some layout refactoring. Speaking of which, did you notice the layout issue I mentioned?
Comment 23 Steffen Pingel CLA 2010-05-23 11:52:31 EDT
> > * What is the reason for nesting informationComp? Why not use head directly as
> a
> > parent for the controls?
> This is likely left over from some layout refactoring. Speaking of which, did
> you notice the layout issue I mentioned?

Yes, GridLayout does not work well with wrapping. I changed it to a TableWrapLayout which seemed to fix it.
Comment 24 Robert Elves CLA 2010-05-24 18:07:42 EDT
Patch (below) has the following addressed:

* -There needs to be a preference listener to disable the service control and to stop the job.-
* -I am a little concerned that control is always constructed even if a message is never displayed. How difficult would it be to construct and dispose the control as messages are displayed and hidden?-
* -I managed to make the control visible without a valid message which caused null pointers. Some checks are missing.-
* -What is the reason for nesting informationComp? Why not use head directly as a parent for the controls?-

Outstanding issues:
* Polling every two hours is way too frequently.  Isn't once a session/once a week sufficient?
* Shouldn't there be a way to disable message from the message control?
Comment 25 Robert Elves CLA 2010-05-24 18:08:03 EDT
Created attachment 169740 [details]
v4
Comment 26 Robert Elves CLA 2010-05-24 18:08:07 EDT
Created attachment 169741 [details]
mylyn/context/zip
Comment 27 Robert Elves CLA 2010-05-24 19:14:27 EDT
Created attachment 169747 [details]
v4 repost

should have less cross contamination
Comment 28 Steffen Pingel CLA 2010-05-25 01:13:58 EDT
Thanks Rob. I found two potential problems in a quick review (I wasn't able to test due to overlap with bug 302907):

* Handling of the stop event in TaskListServiceMessageControl.handleEvent() needs to check for control disposal and such
* TaskListServiceMessageControl does not check if control was already created in setMessage(). What happens if it's called twice?

Apart from the technical issues I would like to discuss the following things before this goes live:

* What is the process for updating the message and who decides what gets displayed?
* What is a good checking interval (2 hours is way too frequently)?
* Is it acceptable that this feature is opt out considering that a network connection is made automatically without user interaction? 
* Is sufficient to have preference for integrators to disable this feature, e.g. if Mylyn is bundled in another tools that already has a notification mechanism?

As far as I understand the discussion, the purpose of this feature is to notify the user when an important update is available. Currently, messages can include a URL which is opened in a browser but do not support other interactions such as installing the update which limits is usefulness. Particularly with EPP packages where Mylyn is not installed as a root IU and a check for updates only succeeds when the actual package is updated (bug 311319).
Comment 29 Robert Elves CLA 2010-05-25 15:01:20 EDT
Created attachment 169882 [details]
v5

Mintor update to address the technical issues raisedL:

* -Handling of the stop event in TaskListServiceMessageControl.handleEvent() needs to check for control disposal and such-
* -TaskListServiceMessageControl does not check if control was already created in setMessage(). What happens if it's called twice?-
Comment 30 Mik Kersten CLA 2010-05-25 15:50:56 EDT
(In reply to comment #28)
> Apart from the technical issues I would like to discuss the following things
> before this goes live:
> 
> * What is the process for updating the message and who decides what gets displayed?

For now, we assume that committers need to vote for a message before it can be pushed.  I'll write this up, since we will also need to decide on an interval (eg, max 1 message/month unless a service disruption).

> * What is a good checking interval (2 hours is way too frequently)?

Let's go with 1 day for the RC phase.  At the next meeting lets decide on an interval that's less frequent (eg, 7 days)

> * Is it acceptable that this feature is opt out considering that a network
> connection is made automatically without user interaction?

Yes, following the precedent of Firefox and other tools that need to inform the user of important fixes or updates, I think it is.  Will write this up.

> * Is sufficient to have preference for integrators to disable this feature, e.g.
> if Mylyn is bundled in another tools that already has a notification mechanism?

Yes, a preference seems like the right way, and better than forcing them to exclude a bundle.
Comment 31 Robert Elves CLA 2010-05-25 17:01:07 EDT
Created attachment 169902 [details]
v6

As committed. Service messages retrieved every 24hrs.
Comment 32 Steffen Pingel CLA 2010-05-29 15:22:56 EDT
As discussed we want to try the following to improve the new user experience: When the task list is empty (i.e. has never been interacted with) show a message that has a link to the wizard for adding a task repository.

The message control should also show a wrench icon to the left of the X that brings up the preference page for disabling messages.
Comment 33 Robert Elves CLA 2010-05-31 17:33:11 EDT
An initial service message now displayed that opens the new wizard dialog. Currently this is hard coded. Looked into making this available as part of the xml from the server but would require implementing caching/paging client side. Something I don't think we have time for at this point.  Added preference button top right next to close button.
Comment 34 Steffen Pingel CLA 2010-05-31 21:00:44 EDT
Created attachment 170600 [details]
initial message
Comment 35 Steffen Pingel CLA 2010-05-31 21:33:07 EDT
I don't think it makes sense to show the initial message for users who have already used Mylyn and created repositories. Can we add a check if any user created repositories exist and not show the message in that case?
Comment 36 Robert Elves CLA 2010-05-31 22:54:29 EDT
(In reply to comment #35)
> I don't think it makes sense to show the initial message for users who have
> already used Mylyn and created repositories. Can we add a check if any user
> created repositories exist and not show the message in that case?
Agreed. Fix is now in head.
Comment 37 Mik Kersten CLA 2010-06-02 21:03:35 EDT
Nits:
* Use the the same color as the notifications popup (dark blue by default on Windows) since that's computed correctly.
* The "x" for close should be in the top right, as with the notification popup.
Comment 38 Robert Elves CLA 2010-06-02 21:29:42 EDT
(In reply to comment #37)
> Nits:
> * Use the the same color as the notifications popup (dark blue by default on
> Windows) since that's computed correctly.

Done.

> * The "x" for close should be in the top right, as with the notification popup.
Done.
Comment 39 Robert Elves CLA 2010-06-03 13:01:50 EDT
Created attachment 170980 [details]
screenshot 2
Comment 40 Steffen Pingel CLA 2010-06-03 15:44:29 EDT
*** Bug 315235 has been marked as a duplicate of this bug. ***
Comment 41 Steffen Pingel CLA 2010-06-03 17:47:07 EDT
As discussed on the call today I would like to disable remote polling of the message for now until we have figured out whether this should be opt-in and if we have sufficient infrastructure capacity for polling. We also need to revisit the update story for SR1 to ensure that if an update message is presented users can easily install it.

Since 3.4 will only display a single message on startup of a clean workspace we can remove the wrench for this release. Rob, can you comment that out for now? It's likely that we will want to bring it back for SR1 though.
Comment 42 Robert Elves CLA 2010-06-03 23:05:23 EDT
Created attachment 171059 [details]
patch to disable service message job and preferences

Patch as committed to disable job, wrench icon, and tasklist preference.
Comment 43 Robert Elves CLA 2010-06-03 23:05:26 EDT
Created attachment 171060 [details]
mylyn/context/zip
Comment 44 Steffen Pingel CLA 2010-06-04 16:13:33 EDT
Thanks! Looks like we are done here then.