Ticket #7856 (closed enhancement: fixed)

Opened 3 years ago

Last modified 6 months ago

[patch] Temporary workaround for regression in Tag query funcionality

Reported by: hasienda Assigned to: rjollos
Priority: normal Component: KeywordSuggestPlugin
Severity: major Keywords: regression
Cc: rjollos Trac Release: 0.11

Description

I've upgraded TagsPlugin to latest trunk version with following devastating effect:

  • NotImplementedError on any ticket page - full DoS
  • NotImplementedError on any wiki page, as soon as I try to edit - partial DoS

Analysis the provided Traceback led quite straight-forward to disabling the KeywordSuggestPlugin installed there as well. Effect: Full recovery minus keyword suggest functionality, naturally.

This seems to be a regression in Tag query functionality, but as our users really like/need this for everyday work to prevent tag bloat by misspelling/casing-only differences/etc. I've made a quick hack to restore it.

Publishing this is mainly for reference to serve a temporary solution. To fix this inside the TagsPlugin will be the preferred way, but much harder to be done, as the query module there is a different piece of cake, or I've just not tried hard enough.

Attachments

keywordsuggest_workaround-for-tags-regression.patch (0.5 kB) - added by hasienda on 10/19/10 00:15:02.
quick fix for utilizing Tag query in an insane way, that just works for now

Change History

10/19/10 00:15:02 changed by hasienda

  • attachment keywordsuggest_workaround-for-tags-regression.patch added.

quick fix for utilizing Tag query in an insane way, that just works for now

10/19/10 00:35:20 changed by hasienda

  • type changed from defect to enhancement.
  • summary changed from Temporary workaround for regression in Tag query funcionality to [patch] Temporary workaround for regression in Tag query funcionality.

This issue has been reported as #7857 for TagsPlugin to get it fixed there.

From the perspective of KeywordSuggestPlugin(s maintainer) this might even be seen just as an enhancement request.? Anyway, we should have a solution here while KeywordSuggestPlugin remainings incompatible with TagsPlugin breaking the nearly the whole Trac application.

11/25/11 00:33:23 changed by rjollos

  • status changed from new to assigned.
  • owner changed from scratcher to rjollos.

11/25/11 01:12:46 changed by rjollos

I'll push this to the trunk along with the patch in #4201.

Sorry this ticket sat here for so long!

11/25/11 01:17:51 changed by rjollos

While working on applying the patch in #4201 to the trunk, and working with the TagsPlugin trunk @ r10800, prior to applying your patch I was seeing:

File "/home/rjollos/Workspace/th4201/trac-0.11-stable/trac/web/main.py", line 450, in _dispatch_request
  dispatcher.dispatch(req)
File "/home/rjollos/Workspace/th4201/trac-0.11-stable/trac/web/main.py", line 227, in dispatch
  data, content_type)
File "/home/rjollos/Workspace/th4201/trac-0.11-stable/trac/web/chrome.py", line 745, in render_template
  stream |= self._filter_stream(req, method, filename, stream, data)
File "/home/rjollos/Workspace/th4201/genshi-trunk/genshi/core.py", line 132, in __or__
  return Stream(_ensure(function(self)), serializer=self.serializer)
File "/home/rjollos/Workspace/th4201/trac-0.11-stable/trac/web/chrome.py", line 848, in inner
  data)
File "/home/rjollos/Workspace/keywordsuggestplugin/0.11/keywordsuggest/keywordsuggest.py", line 45, in filter_stream
  for resource, tags in query_result:
File "/home/rjollos/Workspace/tagsplugin/trunk/tractags/api.py", line 250, in query
  for m in self._realm.finditer(query.as_string()):
File "/home/rjollos/Workspace/tagsplugin/trunk/tractags/query.py", line 360, in as_string
  return _convert(self)
File "/home/rjollos/Workspace/tagsplugin/trunk/tractags/query.py", line 359, in _convert
  raise NotImplementedError

11/25/11 01:51:46 changed by hasienda

Seem, like I've lost track of this ticket.

I think there is a real solution on the way to fix this without my ugly work-around. But do it anyway, as it can easily get reverted when applying a more elaborated fix of the TagsQuery code, as I'm working on #7857.

11/25/11 02:43:10 changed by rjollos

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [10935]) Refs #4201, Fixes #7856: Version 0.4: Added support for TagsPlugin. Tags from the TagsPlugin will be used whenever the TagsPlugin is installed. In the future, an option might be added to determine whether or not to use the TagsPlugin when it is installed. The changes here were derived from the source as modified by georgesoon, keywordsuggest.py in #4201.

These changes have been lightly tested, so please open a new ticket if you encounter any issues.

Compatibility note: Previously, the separator option was defined in quotes, e.g. ', '. Now, the separator is just defined as a character, without quotes. A space is added to all separators.

11/27/12 23:23:00 changed by hasienda

(In [12392]) TagsPlugin: Make query without arguments a valid query expression, refs #7856 and #7857.

Fixes NotImplementedError meaning a regression, because it has been parsed gracefully before, even got used as valid 'all tags' expression in former plugin versions, and i.e. KeywordSuggestPlugin even relied on this behavior.

Thanks to Itamar Ostricher for contributing the key changes of this changeset.

Some code and template clean-up is done as well.

11/27/12 23:29:04 changed by hasienda

So the hot-fix has been made obsolete 1 year later. Not a short fix, but at least done now. Thanks for your patience.


Add/Change #7856 ([patch] Temporary workaround for regression in Tag query funcionality)




Change Properties
Action