Bug 291084 - make time tracking optional and opt-in
Summary: make time tracking optional and opt-in
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P1 enhancement (vote)
Target Milestone: 3.3   Edit
Assignee: Robert Elves CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks:
 
Reported: 2009-10-01 14:34 EDT by Mik Kersten CLA
Modified: 2009-10-13 20:04 EDT (History)
3 users (show)

See Also:


Attachments
first pass (20.76 KB, patch)
2009-10-07 21:15 EDT, Robert Elves CLA
no flags Details | Diff
mylyn/context/zip (463.96 KB, application/octet-stream)
2009-10-07 21:16 EDT, Robert Elves CLA
no flags Details
Updated Patch (33.95 KB, patch)
2009-10-08 17:37 EDT, Robert Elves CLA
no flags Details | Diff
mylyn/context/zip (87.79 KB, application/octet-stream)
2009-10-08 17:37 EDT, Robert Elves CLA
no flags Details
update (35.08 KB, patch)
2009-10-08 22:16 EDT, Robert Elves CLA
no flags Details | Diff
mylyn/context/zip (108.25 KB, application/octet-stream)
2009-10-08 22:16 EDT, Robert Elves CLA
no flags Details
in progress (29.78 KB, patch)
2009-10-09 21:21 EDT, Steffen Pingel CLA
no flags Details | Diff
patch (64.03 KB, patch)
2009-10-12 04:41 EDT, Steffen Pingel CLA
no flags Details | Diff
updated patch (63.69 KB, patch)
2009-10-12 19:04 EDT, Steffen Pingel CLA
no flags Details | Diff
show scheduling information in header (12.59 KB, patch)
2009-10-13 17:34 EDT, Steffen Pingel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mik Kersten CLA 2009-10-01 14:34:15 EDT
While time tracking is optional in the sense that you currently don't need to use it, and the information is private, but you cannot use both focusing and time tracking since we don't have a separate preference.  Proposal:
* On the "Tasks" preference page add a check box that says "Track time spent on active task".  
* Make this new preference off by default so that we give developers a better sense of control by opting into this functionality.
* If the option is off, do not show the "Active" text on the Private task editor section.
* If the option is off, do not write the heartbeat events that we use to determine time tracking information.
Comment 1 Robert Elves CLA 2009-10-01 16:06:38 EDT
This seems like a significant change. All existing users would be pretty surprised to no longer have their time tracked per task activation. Should task activation now be accompanied by a PONT dialog suggesting they enable time tracking of active task?
Comment 2 Mik Kersten CLA 2009-10-07 13:29:42 EDT
That seems overly disruptive.  We can instead put a hyperlink in the private section that says "Enable Time Tracking".  The preference page entry should clearly document that this is only time tracked when active in Eclipse.  We'll also need to document this very clearly in the New & Noteworthy, stating the reasons (eg, that there are legal concerns of tracking time in some countries like Germany so we decided to give the developer more control).
Comment 3 Robert Elves CLA 2009-10-07 21:15:52 EDT
Created attachment 149078 [details]
first pass

Note that this has the potential to clear past interaction history since history date externalization is disabled by default.
Comment 4 Robert Elves CLA 2009-10-07 21:16:01 EDT
Created attachment 149079 [details]
mylyn/context/zip
Comment 5 Robert Elves CLA 2009-10-08 17:37:10 EDT
Created attachment 149177 [details]
Updated Patch
Comment 6 Robert Elves CLA 2009-10-08 17:37:14 EDT
Created attachment 149178 [details]
mylyn/context/zip
Comment 7 Robert Elves CLA 2009-10-08 22:16:48 EDT
Created attachment 149197 [details]
update

If activity exists, preference enabled initially, otherwise disabled.  Enablement ui needs refinement.
Comment 8 Robert Elves CLA 2009-10-08 22:16:52 EDT
Created attachment 149198 [details]
mylyn/context/zip
Comment 9 Steffen Pingel CLA 2009-10-09 21:21:37 EDT
Created attachment 149287 [details]
in progress
Comment 10 Steffen Pingel CLA 2009-10-12 04:41:30 EDT
Created attachment 149345 [details]
patch
Comment 11 Steffen Pingel CLA 2009-10-12 04:43:34 EDT
Shawn, can you take a look at the changes to these classes?
* ContextCorePlugin
* ContextUiPlugin
* MonitorUiPlugin
* ActivityExternalizationParticipant
* TaskActivationExternalizationParticipant
* TaskActivityMonitory
* TasksUiPlugin

The UI changes should be fairly straight forward.
Comment 12 Shawn Minto CLA 2009-10-12 13:44:47 EDT
The changes look like they should be OK.  The preferences in monitor and context seem a bit odd, but it looks like it is probably the cleanest way to do it.  Note that the patch didn't apply cleanly due to the changes to the private section.  I have applied the patch locally and will let you know if I see any oddities.
Comment 13 Steffen Pingel CLA 2009-10-12 19:04:49 EDT
Created attachment 149399 [details]
updated patch
Comment 14 Steffen Pingel CLA 2009-10-12 19:10:42 EDT
I have fixed up a race condition that could cause time tracking not to get activated. Based on Shawn's suggestion I have also moved handling of activity tracking enablement from ContextCorePlugin to MonitorUiPlugin.

Please note that the patch causes the activity job to always get started. Previously that required at least a single task activation. Rob, can you explain the reason for this change? 

I have committed the patch please review my changes carefully.
Comment 15 Steffen Pingel CLA 2009-10-13 00:15:13 EDT
Rob, please take a look at this test failure:

junit.framework.ComparisonFailure: expected:<[star]ted> but was:<[activa]ted>
	at junit.framework.Assert.assertEquals(Assert.java:81)
	at junit.framework.Assert.assertEquals(Assert.java:87)
	at org.eclipse.mylyn.java.tests.InteractionContextManagerTest.testShellLifecycleActivityStart(InteractionContextManagerTest.java:110)
Comment 16 Steffen Pingel CLA 2009-10-13 17:34:54 EDT
Created attachment 149482 [details]
show scheduling information in header
Comment 17 Steffen Pingel CLA 2009-10-13 17:35:42 EDT
Done.
Comment 18 Robert Elves CLA 2009-10-13 17:52:18 EDT
(In reply to comment #14) 
> Please note that the patch causes the activity job to always get started.
> Previously that required at least a single task activation. Rob, can you
> explain the reason for this change?
We should consider adding this back. This was a side effect of simplification but comes at the cost of the job allocation for those who don't activate tasks.

(In reply to comment #15)
> Rob, please take a look at this test failure:
> 
> junit.framework.ComparisonFailure: expected:<[star]ted> but was:<[activa]ted>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at junit.framework.Assert.assertEquals(Assert.java:87)
> at
> org.eclipse.mylyn.java.tests.InteractionContextManagerTest.testShellLifecycleActivityStart(InteractionContextManagerTest.java:110)

I'll take a look
Comment 19 Steffen Pingel CLA 2009-10-13 18:09:22 EDT
(In reply to comment #18)
> (In reply to comment #14)
> > Please note that the patch causes the activity job to always get started.
> > Previously that required at least a single task activation. Rob, can you
> > explain the reason for this change?
> We should consider adding this back. This was a side effect of simplification
> but comes at the cost of the job allocation for those who don't activate tasks.

The job should run if there is an interested consumer, e.g. time tracking or task list sync. It should not be based on a preference.
Comment 20 Robert Elves CLA 2009-10-13 18:39:21 EDT
(In reply to comment #19)
> (In reply to comment #18)
> > (In reply to comment #14)
> > > Please note that the patch causes the activity job to always get started.
> > > Previously that required at least a single task activation. Rob, can you
> > > explain the reason for this change?
> > We should consider adding this back. This was a side effect of simplification
> > but comes at the cost of the job allocation for those who don't activate
> tasks.
> 
> The job should run if there is an interested consumer, e.g. time tracking or
> task list sync. It should not be based on a preference.
Agreed. I'll look at adding this now.


As for the failing unit test, when run with TEST_MODE = true, the necessary bits run in the the ui job correctly which results in correct startup and sequence of activity events.  Thoughts on how to test this? Can we run a single test as 'non-test' mode?
Comment 21 Robert Elves CLA 2009-10-13 19:28:37 EDT
(In reply to comment #20)
> (In reply to comment #19)
> > (In reply to comment #18)
> > > (In reply to comment #14)
> > > > Please note that the patch causes the activity job to always get started.
> > > > Previously that required at least a single task activation. Rob, can you
> > > > explain the reason for this change?
> > > We should consider adding this back. This was a side effect of
> simplification
> > > but comes at the cost of the job allocation for those who don't activate
> > tasks.
> >
> > The job should run if there is an interested consumer, e.g. time tracking or
> > task list sync. It should not be based on a preference.
> Agreed. I'll look at adding this now.

We now rely on these events for context externalization and optimization of synchronization so will leave job as is for now.
Comment 22 Steffen Pingel CLA 2009-10-13 20:04:31 EDT
> > The job should run if there is an interested consumer, e.g. time tracking or
> > task list sync. It should not be based on a preference.
> Agreed. I'll look at adding this now.
> 
> As for the failing unit test, when run with TEST_MODE = true, the necessary
> bits run in the the ui job correctly which results in correct startup and
> sequence of activity events.  Thoughts on how to test this? Can we run a single
> test as 'non-test' mode?

We should review that code, maybe the special handling in start() can be removed. I have created bug 292206 to track that.