-
-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filter with tags and files not working #884
Comments
My initial reaction would be to have this function merge tables, but I'm concerned that this could result in all sorts of unexpected behaviour. Ultimately, the issue is that this(project-level) has a higher precedence than this(configurations-level), when applied to the file-level configurations here(note that @starkos and/or @tvandijck would have a better idea of what is the "better" way of fixing this, I haven't really touched this section of code before, so it would be a shot in the dark. |
I think this actually a bug indeed in the mergeFilters in that it assumes that values are 'nil' if not set... but for any API value that is a table, this is not true, it is an empty table instead. My guess would be that for any other value like this, the same issue would show up. We've so far been getting away with it, because none of the other criteria values are tables, except for "options", however that is an entirely constant table since it's the command line options, it gets filled up once and never touched again. We'd have to fix up mergeFilters to do something a little more special for the 'tags'. |
"system" and "host" are also tables, on my PC I got |
Well, they are, but they are not really... What might simply be wrong is this part: Instead of merging the filters, we might actually have to create the filters like we do elsewhere. |
All that said. I wish we could somehow 'hash' and 'cache' the filter contexts... In particular the once created in the fileconfig, creates 85000 contexts for our project, of which only 1000 or so are unique. |
As @tvandijck said, using table.merge instead of overriding the tags in mergeFilters solve the problem. The fix is just an if for tags as I am worried about unwanted side effects with system. |
After taking another look, I realized that mergeFilters is not behaving as you could expect from it's name.
This implementation would fix the tags issue and does not cause any side effects as far as I know. Am I missing something that invalidate this solution ? |
If I recall correctly, that's how it used to be implemented, and it was modified to it's current implementation for performance reasons... We'd have to look in the history of that file/function to find that back however. It probably works for most project just fine, until you throw Starcraft 2 at it ;) That said, it is obviously broken, so we should fix it, and look at deal with performance after. I would however like to see some test cases to cover the currently broken state. So we don't break it again. |
Fixed by #889 |
I am using the tags filter to improve readability in some of the complex filters in our projects and came accross this issue.
Here is an example using the the base example from #789.
I am willing to take a look but would appreciate if someone could point me in where I should be looking.
The text was updated successfully, but these errors were encountered: