Bug 298688 - [context] support ant filters for resource monitoring exclusions
Summary: [context] support ant filters for resource monitoring exclusions
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 enhancement (vote)
Target Milestone: 3.4   Edit
Assignee: Shawn Minto CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2009-12-31 14:16 EST by David M. Karr CLA
Modified: 2010-04-23 18:59 EDT (History)
3 users (show)

See Also:


Attachments
mylyn/context/zip (14.84 KB, application/octet-stream)
2010-04-16 18:37 EDT, Shawn Minto CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David M. Karr CLA 2009-12-31 14:16:23 EST
Build Identifier: M20090917-0800

I want to exclude certain file path patterns from being added to the context.  The "Resource Monitoring Exclusions" list will only exclude the file from the context if an entry in this list exactly matches (actually, I can't find any documentation that says exactly how it does the matching).  This really would be more useful if each entry represented an Ant-style path, like "build/**/*.class" or "gen/**/*.java".

Reproducible: Always
Comment 1 Steffen Pingel CLA 2010-01-09 03:23:05 EST
Shawn, what are your thoughts on that?
Comment 2 Shawn Minto CLA 2010-01-11 12:07:29 EST
I think that this is a very interesting idea and it would provide greater flexibility to be able to setup resource exclusions.  The only thing that I would be concerned about is that it can be much more difficult for users to write this type of pattern.
Comment 3 David M. Karr CLA 2010-01-11 12:47:43 EST
"Much more difficult"?  I'd say that's a bit of an exaggeration.  A complicated Ant-path pattern is a complicated pattern.  At this point, the implemented feature doesn't allow any complicated patterns at all :) , so I think it shouldn't be difficult for people to implement patterns corresponding to the weak substring match that is currently available.
Comment 4 Steffen Pingel CLA 2010-01-11 13:52:05 EST
Considering that resource inclusion are an advanced feature I think it's reasonable to support the more powerful ant syntax. We just need to ensure to maintain backwards compatibility or convert existing patterns. 

I'll mark this P2 since there have been frequent requests to improve resource exclusion to support build processes that generate files etc.
Comment 5 Mik Kersten CLA 2010-01-14 12:53:24 EST
+1
Comment 6 Shawn Minto CLA 2010-04-09 14:05:01 EDT
I have started looking into this and have committed performance tests to HEAD and the 3.3.x branch so that we have a baseline of what the current performance of the resource change monitor exclusions is before we start to work on this further.
Comment 7 David M. Karr CLA 2010-04-16 12:15:01 EDT
In case you aren't completely convinced of the value of this yet:

I find that the lack of this feature set is exacerbated by a couple of things:

1. There are certain operations that unexpectedly add a large number of files to the context, that I wish did not happen. I'm not sure exactly what those actions are, but perhaps checking out a project from SVN/CVS.  I often find that my "gen" directories get re-added to the context when I didn't want them to.  My feeling is that "background" or "indirect" actions generally shouldn't add files to the context, but I'm guessing Mylyn has no way (at this point) to know what "context" the action was performed in.

2. Removing a directory tree from the context is painfully slow.
Comment 8 Shawn Minto CLA 2010-04-16 18:37:05 EDT
Thanks for the information David.  I actually just finished adding this support.  Users can now specify ant patterns for filtering resources from automatically being added to the task context from the Resources preference page.  The current exclusions should be migrated to the new form, which will create 4 ant patterns to ensure backwards compatibility.  The unit tests and performance tests have been updated so that we can see what effect this has on the performance of resource monitoring.
Comment 9 Shawn Minto CLA 2010-04-16 18:37:10 EDT
Created attachment 165160 [details]
mylyn/context/zip
Comment 10 Steffen Pingel CLA 2010-04-21 14:05:16 EDT
Looks like two tests started failing. Shawn, could you take a look?

junit.framework.AssertionFailedError: null
	at org.eclipse.mylyn.resources.tests.ResourceChangeMonitorTest.testPathPostfixExclusionPattern(ResourceChangeMonitorTest.java:276)
	at org.eclipse.mylyn.commons.tests.support.ManagedTestSuite.run(ManagedTestSuite.java:127)
	
junit.framework.AssertionFailedError: null
	at org.eclipse.mylyn.resources.tests.ResourceChangeMonitorTest.testPathPrefixExclusionPattern(ResourceChangeMonitorTest.java:258)
	at org.eclipse.mylyn.commons.tests.support.ManagedTestSuite.run(ManagedTestSuite.java:127)
Comment 11 Steffen Pingel CLA 2010-04-21 14:05:29 EDT
Reopening.
Comment 12 Shawn Minto CLA 2010-04-21 16:14:00 EDT
So, it turns out that the implementation of Path is platform dependent, so some of the tests that I wrote were only valid on Windows.  I have fixed the tests so that they make sense on all platforms.  Will leave open until I see that the tests pass on linux.
Comment 13 Shawn Minto CLA 2010-04-23 18:59:48 EDT
Tests now pass again.  Marking resolved.