Opened 17 years ago
Closed 11 years ago
#2429 closed enhancement (fixed)
[Patch] TagsPlugin should handle versioning of wiki tags
Reported by: | Daniel Kahn Gillmor | Owned by: | Steffen Hoffmann |
---|---|---|---|
Priority: | normal | Component: | TagsPlugin |
Severity: | normal | Keywords: | wiki version |
Cc: | lbruno@…, Ryan J Ollos, Jun Omae | Trac Release: | 0.11 |
Description
Currently, tags on wiki pages as implemented by TagsPlugin are either present or not, with no record of who added the tag, when it was added, or if it was removed. Since the tagging table only contains a (tagspace,name,tag)
tuple, there doesn't seem to be room in the current implementation for even storing the "author" of a tag on a certain wiki page, its history, or its destruction.
This seems contrary to the wikinature of the rest of trac, and certainly leaves the tickets (with their automatically revision-tracked keywords) looking much healthier. I'm not sure how one would make the transition for existing systems, but could the TagsPlugin be moved to a more wiki-ish model?
Attachments (4)
Change History (36)
Changed 16 years ago by
Attachment: | patch_for_wiki_tag_versions.txt added |
---|
comment:1 Changed 16 years ago by
Type: | defect → enhancement |
---|
comment:2 follow-up: 31 Changed 16 years ago by
Cc: | lbruno@… added; anonymous removed |
---|
Thanks MfG, I'll be using that patch. I'll also have to make some kind of timeline provider.
comment:3 Changed 15 years ago by
Owner: | changed from Alec Thomas to Michael Renzmann |
---|---|
Summary: | TagsPlugin should handle versioning of wiki tags → [Patch] TagsPlugin should handle versioning of wiki tags |
comment:4 Changed 12 years ago by
Cc: | Steffen Hoffmann added |
---|---|
Keywords: | wiki version added |
comment:5 Changed 11 years ago by
Cc: | Ryan J Ollos added; Steffen Hoffmann removed |
---|---|
Owner: | changed from Michael Renzmann to Steffen Hoffmann |
I wonder, if we really need a new wiki page version.
- Seems a bit overkill and too much overhead for a decent page and just some tags changing.
- Deleting wiki versions will have no easy way to restore previous tags, and I'm not sure, if this would even be desired under all circumstances.
An alternative model would be to introduce versions directly to the default tag store and weave tag revisions into wiki page history like done for attachment changes in ticket change history for a long time. Attachments are not versioned yet, but I feel that the concept could work with versions too. Thought?
comment:6 follow-up: 7 Changed 11 years ago by
i like the idea of introducing versioning information (or just timestamps?) into the default tag store.
what if the tag store was expanded from:
- tagspace
- name
- tag
to:
- tagspace
- name
- tag
- added_by
- added_when
- removed_by
- removed_when
The "by"s refer to users, the "whens" are timestamps, and the "removed"s would initially be null.
you could make a view that matches the current default tag store just by selecting all rows where removed_when is null
.
comment:7 follow-up: 8 Changed 11 years ago by
Replying to dkgdkg:
i like the idea of introducing versioning information (or just timestamps?) into the default tag store.
what if the tag store was expanded ...
I envision a separate db table rather then extending the current table. Among other things it would allow to switch versioning on/off per realm (you likely don't need it for tickets). There should be only one author column, and repeated adding and removing of the same tag should not cause history overwrites. A db schema similar to `ticket_change` would allow for that with a minimal primary key extension and lower column count.
comment:8 follow-up: 9 Changed 11 years ago by
Replying to hasienda:
I envision a separate db table rather then extending the current table. Among other things it would allow to switch versioning on/off per realm (you likely don't need it for tickets).
the tags for the ticketing system are all contained in the ticket keywords anyway, right? the tags table is only used for wiki pages.
There should be only one author column, and repeated adding and removing of the same tag should not cause history overwrites.
Ah right, my proposal was definitely flawed in that regard.
A db schema similar to `ticket_change` would allow for that with a minimal primary key extension and lower column count.
yep, i think this makes sense. if this was implemented, could we drop the tags
table after an upgrade?
comment:9 Changed 11 years ago by
Replying to anonymous:
Replying to hasienda:
I envision a separate db table rather then extending the current table. Among other things it would allow to switch versioning on/off per realm (you likely don't need it for tickets).
the tags for the ticketing system are all contained in the ticket keywords anyway, right? the tags table is only used for wiki pages.
No and no. Ticket keywords are configurable in [tags]
section of trac.ini via the 'ticket_fields' option. 'keywords' is only its default value. Could be any combination of ticket fields (custom fields not supported yet, see #2804). But I don't feel that this is relevant here.
Wiki is not the only other tag-able realm today, there are blog and screenshots, not to speak about tomorrow.
There should be only one author column, and repeated adding and removing of the same tag should not cause history overwrites.
Ah right, my proposal was definitely flawed in that regard.
No problem. We discuss to find the best way.
A db schema similar to `ticket_change` would allow for that with a minimal primary key extension and lower column count.
yep, i think this makes sense. if this was implemented, could we drop the
tags
table after an upgrade?
No. As with ticket_change
this will be only for the change records. It makes a great deal of flexibility to keep these information separately, only joining tables on demand. While it might be technically possible to get the same information from tag_change
by examining tag history of a given resource, this would be far more expensive. Building a view would be another option, but for one this is not easy to do in a generic way (independent of db-backend's SQL flavor), and the Trac db schema is not highly normalized anyway.
comment:10 Changed 11 years ago by
OK, makes sense to me. thanks for the followup and clarification. and thank you for your work on this!
comment:11 Changed 11 years ago by
You're welcome. I guess, that #11205 changed priority of this ticket significantly.
Changed 11 years ago by
Attachment: | 20131028_wiki_tags_version-history_pre-view.png added |
---|
preview at Trac 1.0 wiki change history view with tag revisions enabled
comment:12 Changed 11 years ago by
Cc: | Jun Omae added |
---|
I'll publish a patch for testing soon.
Here is a preview on current look-and-feel of tags version tracking for wiki pages backed by new tags_change
db table. Tag change info in comments mimics keywords field history style in tickets. Links behind stars in version column lead to the wiki page version the tag change has been recorded for. Comments welcome.
Changed 11 years ago by
Attachment: | revision-support.patch added |
---|
patch for an implementation of tag revisions (not only) for wiki pages
comment:13 Changed 11 years ago by
Early adopters beware: This feature requires an additional db table. After installing a TagsPlugin version with this patch you'll need to upgrade your environment. Keep a backup for rolling back later on. Test reports are required to get it into next release tractags-0.7
.
Changed 11 years ago by
Attachment: | 20131102-2318-meta-chars-in-tag.png added |
---|
comment:16 follow-up: 17 Changed 11 years ago by
I've tried it.
If wiki meta characters is uses in tag, those characters would explain as wiki in history view. I guess we should use ITemplateStreamFilter.filter_stream
api.
- Add
1.0 [{{{}}}] bar foo foobar plugin
as tag - Replace the tags with
abc**def bar baz foo
Also, the old version wiki view shows always the latest tags.
comment:17 follow-up: 18 Changed 11 years ago by
Replying to jun66j5:
If wiki meta characters is uses in tag, those characters would explain as wiki in history view. I guess we should use
ITemplateStreamFilter.filter_stream
api.
I see. What you guess, is to escape these characters to keep them visible verbatim instead of interpreted as wiki syntax, right? I'll look into it.
Also, the old version wiki view shows always the latest tags.
I confess, that it even was intentional to not create real, revertible tag revisions at once. The change recording at least is complete, and more functionality could be added from there on as we see the need. But as the '*' suggests, re-tagging does not create a new wiki page revision. So when there is no such hard connection, is it really good to rollback younger tag changes for viewing older wiki page versions?
Of course there is always at least an order by change time. There are even more issues, like line truncating, so larger change sets are not displayed in full. Not that I would ignore it, I'm just unsure, if I can handle this all too soon.
comment:18 Changed 11 years ago by
Replying to hasienda:
If wiki meta characters is uses in tag, those characters would explain as wiki in history view. I guess we should use
ITemplateStreamFilter.filter_stream
api.I see. What you guess, is to escape these characters to keep them visible verbatim instead of interpreted as wiki syntax, right? I'll look into it.
Sorry, I've tried it and it's difficult to solve using filter_stream
. But I found the workaround to replace wiki_to_oneline
, 33babfb.
Also, the old version wiki view shows always the latest tags.
Proposed changes can be found in f41d59c. The changes add tags_version
parameter to query string in history view. The old tags for wiki page are searched by tags_version
or version
parameter.
https://github.com/jun66j5/trac-tagsplugin/compare/ticket2429.
comment:19 follow-up: 20 Changed 11 years ago by
The majority of the recent 7 proposed changes look just fine to me. I've commented them accordingly and invite you kindly to apply them - folded to 6 changes - to trunk
here as well.
Obviously you don't see the need for my "tags change record composition" string. So it is not required for extra flexibility in some languages, isn't it? I thought giving a fixed positional order would be bad, but you do so by appending to the comment in your changeset 33babfb150e8aef86dedca63a27c2d3471d10513.
Thank you very much for these contributions to refine the new feature. I'll update message catalogs after application of these patches to adapt to the i18n-related changes in there.
comment:20 follow-up: 22 Changed 11 years ago by
Obviously you don't see the need for my "tags change record composition" string. So it is not required for extra flexibility in some languages, isn't it?
Indeed. You're right. I've updated ticket2429 branch based on your suggestions, and included some refactoring.
comment:21 Changed 11 years ago by
It did isolated test of most of your changes by now, and I left my comments at GitHub. Would be great to have your contributions in trunk
for the next release to come. Thanks for taking all the precious time to hack it.
comment:22 follow-up: 23 Changed 11 years ago by
Replying to jun66j5:
Obviously you don't see the need for my "tags change record composition" string. So it is not required for extra flexibility in some languages, isn't it?
Indeed. You're right. I've updated ticket2429 branch based on your suggestions, and included some refactoring.
Just for clarity: I have finished the review with comment on afbcd4d in December, and I would appreciated, if you find the time to commit these latest changes to plugin's trunk
branch yourself. If not, I would do it myself in fewer, but still isolated changesets for
- new
RequestsProxy
class, - new private methods in wiki tag provider,
- method signature extension for setting time stamp explicitly and
- other fixes.
comment:23 follow-up: 29 Changed 11 years ago by
Just for clarity: I have finished the review with comment on afbcd4d in December, and I would appreciated, if you find the time to commit these latest changes to plugin's
trunk
branch yourself. If not, I would do it myself in fewer, but still isolated changesets for
- new
RequestsProxy
class,- new private methods in wiki tag provider,
- method signature extension for setting time stamp explicitly and
- other fixes.
Sorry for delay. Thanks for reviewing. I'll push proposed changes to trunk as 0.7 within a few days.
comment:29 follow-up: 30 Changed 11 years ago by
Sorry for delay. Thanks for reviewing. I'll push proposed changes to trunk as 0.7 within a few days.
The changes have been committed. Thanks.
comment:30 Changed 11 years ago by
Replying to jun66j5:
Sorry for delay. Thanks for reviewing. I'll push proposed changes to trunk as 0.7 within a few days.
The changes have been committed. Thanks.
No, it's my pleasure to thank you for your dedication to make this feature complete. Now I feel confident to roll this new release. With this feature and substantial performance improvements this will become a remarkable milestone. I love to develop with such great co-contributors.
I want this feature too. As a first step i can provide a patch which creates a new version of the wiki page if only the tags have changed. So you can see who added or removed tags and when it was done.
Perhaps this helps.
MfG WaTho