Modify

Opened 4 months ago

Last modified 4 months ago

#11950 new defect

The tag TracLink doesn't allow trailing arguments

Reported by: rjollos Owned by: hasienda
Priority: normal Component: TagsPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

When using the wiki TracLink I can append a query string: wiki:TracGuide@2?action=diff. Note that wiki:TracGuide?action=diff also works, showing the diff between the latest and previous revision.

I tried to use tag:license?wiki=on: tag:license?wiki=on?. Since it doesn't work, the alternative is to use: [/tags/license?wiki=on]: tags/license.

I suppose the challenge with tag:license?wiki=on? is that we can't know whether the ? is part of the tag name or the start of a query string. Maybe there is a better way to limit the search using the tag TracLink?

Attachments (0)

Change History (7)

comment:1 Changed 4 months ago by hasienda

Seems like there is a problem with tags query (regression?), because tags:'license realm:wiki' is valid query syntax and should even be preferred over the query string syntax.

comment:2 Changed 4 months ago by hasienda

  • Type changed from enhancement to defect

Maybe this was not advertised, but I feel this should still work for consistency. After all you provided a valid use case for realm selection in tag links.

comment:3 Changed 4 months ago by hasienda

In 14148:

TagsPlugin: Fix tags link resolver for tag query expressions, refs #11950.

comment:4 in reply to: ↑ description ; follow-up: Changed 4 months ago by hasienda

Replying to rjollos:

Maybe there is a better way to limit the search using the tag TracLink?

I think that supporting tag query syntax with 'realm:<realm>' attributes in tag links is consistent and rather straight-forward. Do you agree?

Btw, I've tweaked the tag link rendering to indicate zero-result tag queries too. Isn't that nice? :-)

comment:5 in reply to: ↑ 4 ; follow-up: Changed 4 months ago by rjollos

Replying to hasienda:

Replying to rjollos:

Maybe there is a better way to limit the search using the tag TracLink?

I think that supporting tag query syntax with 'realm:<realm>' attributes in tag links is consistent and rather straight-forward. Do you agree?

It does the job so that is good. The syntax is a bit different than anything that is used in the core. That isn't meant negatively, since it's good to consider ways to expand the syntax, and if we find something that works well it could be used in the core (see for example trac:#11731).

Btw, I've tweaked the tag link rendering to indicate zero-result tag queries too. Isn't that nice? :-)

Are you referring to a change in [14148]? I'm afraid I don't see what you are referring to.

I have a few other related comments about TracLinks, but I'll have to save those for tomorrow when I can better organize my thoughts. I had a suggestion for a small refactoring, so I opened another ticket for that: #11968.

comment:6 in reply to: ↑ 5 Changed 4 months ago by hasienda

Replying to rjollos:

Replying to hasienda:

Replying to rjollos:

Maybe there is a better way to limit the search using the tag TracLink?

I think that supporting tag query syntax with 'realm:<realm>' attributes in tag links is consistent and rather straight-forward. Do you agree?

It does the job so that is good. The syntax is a bit different than anything that is used in the core. That isn't meant negatively, since it's good to consider ways to expand the syntax, and if we find something that works well it could be used in the core (see for example trac:#11731).

I know, that current tag query syntax is different from anything in Trac core, where you get used to equal-sign expressions, but OTOH it is explained on /tags right below the input field for ages. The question-mark is leaning towards parameter suffixed URLs, and the '<realm>=on' can be deduced from URLs generated by the plugin itself, but it is undocumented, hence not guaranteed to work forever. Only support pipe-list expressions like realm=ticket|wiki, where you need to write today realm:ticket or realm:wiki would make me change my mind.

Btw, I've tweaked the tag link rendering to indicate zero-result tag queries too. Isn't that nice? :-)

Are you referring to a change in [14148]? I'm afraid I don't see what you are referring to.

Yes, indeed. You'll find the relevant change, if you look closer. I had to preserve the query string for conditional formatting, that will switch to 'missing' class, if there is neither a tag nor a query match found for the tag link expression. A dedicated unit test for this feature plus some user documentation in the wiki would be much better than advertising in changeset commit message and changelog file, I know. Will try to make that available before tractags-0.8 release, that I'm pushing towards.

comment:7 Changed 4 months ago by hasienda

In 14158:

TagsPlugin: Test generator for emptyness instead of totally consuming it, refs #3624 and #11950.

Made it just as light as needed for something like a formatter method.

Add Comment

Modify Ticket

Action
as new The owner will remain hasienda.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.