Version 3 (modified by trac, 7 years ago) (diff)


Trac Ticket Queries

In addition to reports, Trac provides support for custom ticket queries, used to display lists of tickets meeting a specified set of criteria.

To configure and execute a custom query, switch to the View Tickets module from the navigation bar, and select the Custom Query link.


When you first go to the query page the default filters will display all open tickets, or if you're logged in it will display open tickets assigned to you. Current filters can be removed by clicking the button to the right with the minus sign on the label. New filters are added from the pulldown list in the bottom-right corner of the filters box. Filters with either a text box or a pulldown menu of options can be added multiple times to perform an or of the criteria.

You can use the fields just below the filters box to group the results based on a field, or display the full description for each ticket.

Once you've edited your filters click the Update button to refresh your results.

Clicking on one of the query results will take you to that ticket. You can navigate through the results by clicking the Next Ticket or Previous Ticket links just below the main menu bar, or click the Back to Query link to return to the query page.

You can safely edit any of the tickets and continue to navigate through the results using the Next/Previous/Back to Query links after saving your results. When you return to the query any tickets which were edited will be displayed with italicized text. If one of the tickets was edited such that it no longer matches the query criteria the text will also be greyed. Lastly, if a new ticket matching the query criteria has been created, it will be shown in bold.

The query results can be refreshed and cleared of these status indicators by clicking the Update button again.

Saving Queries

While Trac does not yet allow saving a named query and somehow making it available in a navigable list, you can save references to queries in Wiki content, as described below.

You may want to save some queries so that you can come back to them later. You can do this by making a link to the query from any Wiki page.

[query:status=new|assigned|reopened&version=1.0 Active tickets against 1.0]

Which is displayed as:

Active tickets against 1.0

This uses a very simple query language to specify the criteria (see Query Language).

Alternatively, you can copy the query string of a query and paste that into the Wiki link, including the leading ? character:

[query:?status=new&status=assigned&status=reopened&group=owner Assigned tickets by owner]

Which is displayed as:

Assigned tickets by owner

Using the [[TicketQuery]] Macro

The TicketQuery macro lets you display lists of tickets matching certain criteria anywhere you can use WikiFormatting.



This is displayed as:

No results

Just like the query: wiki links, the parameter of this macro expects a query string formatted according to the rules of the simple ticket query language.

A more compact representation without the ticket summaries is also available:

[[TicketQuery(version=0.6|0.7&resolution=duplicate, compact)]]

This is displayed as:

No results

Finally if you wish to receive only the number of defects that match the query using the count parameter.

[[TicketQuery(version=0.6|0.7&resolution=duplicate, count)]]

This is displayed as:


Customizing the table format

You can also customize the columns displayed in the table format (format=table) by using col=<field> - you can specify multiple fields and what order they are displayed by placing pipes (|) between the columns like below:


This is displayed as:

Full rows

In table format you can also have full rows by using rows=<field> like below:


This is displayed as:

Results (1 - 3 of 9360)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#12733 fixed Orphan hashes are not being propagated correctly ezyang

In Phab:D2607, simonpj asked why we didn't also put class instances in the export hash. Why indeed. In the course of investigating, I discovered another bug in how we handle orphan recompilation.

Unfortunately, this bug needs two packages to manifest.

-- p/P.hs
module P where
instance Show (a -> b) where
--instance Show (IO a) where

-- q/Q.hs
module Q where
import P

-- q/Q2.hs
module Q2 where
import Q

Put in some default Cabal files, with q depending on p, and then build the entire kaboodle. Then edit p/P.hs to uncomment the second orphan instance. Rebuild.

ezyang@sabre:~/Dev/labs/orph$ cabal new-build q -w ghc-head
In order, the following will be built (use -v for more details):
 - p- (lib) (file P.hs changed)
 - q- (lib) (dependency rebuilt)
Preprocessing library p-
[1 of 1] Compiling P                ( P.hs, /srv/code/labs/orph/dist-newstyle/build/x86_64-linux/ghc-8.1.20161016/p- )

P.hs:2:10: warning: [-Wmissing-methods]
    • No explicit implementation for
        either ‘showsPrec’ or ‘show’
    • In the instance declaration for ‘Show (a -> b)’

P.hs:3:10: warning: [-Wmissing-methods]
    • No explicit implementation for
        either ‘showsPrec’ or ‘show’
    • In the instance declaration for ‘Show (IO a)’
module Q2 where
Preprocessing library q-
[1 of 2] Compiling Q                ( Q.hs, /srv/code/labs/orph/dist-newstyle/build/x86_64-linux/ghc-8.1.20161016/q- ) [P changed]

Notice: Q2 never got rebuilt. This is wrong wrong wrong: P changed, and we need to rebuild Q2!

Here are the hashes for Q.hi before and after:

-- Before
interface Q 80120161016
  interface hash: 2ffc06a1552565a73c888110ab4cf8df
  ABI hash: b2768862866252ea5a63401d2aa05aaa
  export-list hash: 092acc280445a8bcc96904afb8b766b0
  orphan hash: 693e9af84d3dfcc71e640e005bdc5e2e
  flag hash: f01bb78d3c47152bc5253f256b2a60d3

-- After
interface Q 80120161016
  interface hash: 009db9e5ecbe49e36b7bf38e02087e75
  ABI hash: b2768862866252ea5a63401d2aa05aaa
  export-list hash: 092acc280445a8bcc96904afb8b766b0
  orphan hash: 693e9af84d3dfcc71e640e005bdc5e2e
  flag hash: f01bb78d3c47152bc5253f256b2a60d3

The ABI hash didn't get updated.

At the moment, when we compute the export hash, we only consider the orphan hashes from the home package. Here's the comment justifying it:

   -- the export hash of a module depends on the orphan hashes of the
   -- orphan modules below us in the dependency tree.  This is the way
   -- that changes in orphans get propagated all the way up the
   -- dependency tree.  We only care about orphan modules in the current
   -- package, because changes to orphans outside this package will be
   -- tracked by the usage on the ABI hash of package modules that we import.

It is true that we know to rebuild Q.hs when P.hs changes. But that is not much solace for Q2.hs...

#12722 duplicate Compile bug when upgrading stack-1.2.0 on Mac OS X pisomojado

output from stack upgrade:

michael@gelato:~/Code/autorefactorer-site$ stack upgrade
Fetching package index ...remote: Counting objects: 1, done.
remote: Total 1 (delta 0), reused 1 (delta 0), pack-reused 0
Unpacking objects: 100% (1/1), done.
Fetched package index.    
Populated index cache.    
store-core- configure
store-core- build
http-client- configure
http-client- build
optparse-applicative- configure
optparse-applicative- build
path-0.5.8: configure
path-0.5.8: build
store-core- copy/register
th-lift-instances-0.1.7: configure
path-0.5.8: copy/register
th-lift-instances-0.1.7: build
path-io-1.1.0: configure
path-io-1.1.0: build
th-lift-instances-0.1.7: copy/register
th-orphans-0.13.1: configure
path-io-1.1.0: copy/register
th-orphans-0.13.1: build
unicode-transforms- configure
unicode-transforms- build
unicode-transforms- copy/register
optparse-applicative- copy/register
th-orphans-0.13.1: copy/register
optparse-simple-0.0.3: configure
optparse-simple-0.0.3: build
th-utilities- configure
th-utilities- build
optparse-simple-0.0.3: copy/register
http-client- copy/register
http-client-tls-0.3.0: configure
http-client-tls-0.3.0: build
http-client-tls-0.3.0: copy/register
http-conduit-2.2.0: configure
http-conduit-2.2.0: build
th-utilities- copy/register
store- configure
store- build
http-conduit-2.2.0: copy/register
store- copy/register
stack-1.2.0: configure
[1 of 1] Compiling Main             ( /private/var/folders/vy/td7mc44s36g6b_wvdz7258rw0000gn/T/stack-upgrade19320/stack-1.2.0/Setup.hs, /private/var/folders/vy/td7mc44s36g6b_wvdz7258rw0000gn/T/stack-upgrade19320/stack-1.2.0/.stack-work/dist/x86_64-osx/Cabal- )
Linking /private/var/folders/vy/td7mc44s36g6b_wvdz7258rw0000gn/T/stack-upgrade19320/stack-1.2.0/.stack-work/dist/x86_64-osx/Cabal- ...
Configuring stack-1.2.0...
stack-1.2.0: build
Preprocessing library stack-1.2.0...
[ 1 of 96] Compiling Text.PrettyPrint.Leijen.Extended ( src/Text/PrettyPrint/Leijen/Extended.hs, .stack-work/dist/x86_64-osx/Cabal- )
[ 2 of 96] Compiling Stack.Ghci.Script ( src/Stack/Ghci/Script.hs, .stack-work/dist/x86_64-osx/Cabal- )
[ 3 of 96] Compiling Stack.FileWatch  ( src/Stack/FileWatch.hs, .stack-work/dist/x86_64-osx/Cabal- )
[ 4 of 96] Compiling System.Process.PagerEditor ( src/System/Process/PagerEditor.hs, .stack-work/dist/x86_64-osx/Cabal- )
[ 5 of 96] Compiling System.Process.Log ( src/System/Process/Log.hs, .stack-work/dist/x86_64-osx/Cabal- )
[ 6 of 96] Compiling Paths_stack      ( .stack-work/dist/x86_64-osx/Cabal-, .stack-work/dist/x86_64-osx/Cabal- )
[ 7 of 96] Compiling Path.Find        ( src/Path/Find.hs, .stack-work/dist/x86_64-osx/Cabal- )
[ 8 of 96] Compiling Path.Extra       ( src/Path/Extra.hs, .stack-work/dist/x86_64-osx/Cabal- )
[ 9 of 96] Compiling System.Process.Read ( src/System/Process/Read.hs, .stack-work/dist/x86_64-osx/Cabal- )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.10.3 for x86_64-apple-darwin):
        Loading temp shared object failed: dlopen(/var/folders/vy/td7mc44s36g6b_wvdz7258rw0000gn/T/ghc20328_0/libghc_55.dylib, 5): no suitable image found.  Did find:
        /var/folders/vy/td7mc44s36g6b_wvdz7258rw0000gn/T/ghc20328_0/libghc_55.dylib: malformed mach-o: load commands size (47024) > 32768
Please report this as a GHC bug:
Completed 14 action(s).

--  While building package stack-1.2.0 using:
      /private/var/folders/vy/td7mc44s36g6b_wvdz7258rw0000gn/T/stack-upgrade19320/stack-1.2.0/.stack-work/dist/x86_64-osx/Cabal- --builddir=.stack-work/dist/x86_64-osx/Cabal- build lib:stack exe:stack --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
#12719 fixed master branch broken with alex 3.2 bgamari bgamari

The build fails with all sorts of type errors. Need to work out what is going on when there is time.

1 2 3 4 5 6 7 8 9 10 11

Query Language

query: TracLinks and the [[TicketQuery]] macro both use a mini “query language” for specifying query filters. Basically, the filters are separated by ampersands (&). Each filter then consists of the ticket field name, an operator, and one or more values. More than one value are separated by a pipe (|), meaning that the filter matches any of the values.

The available operators are:

= the field content exactly matches the one of the values
~= the field content contains one or more of the values
^= the field content starts with one of the values
$= the field content ends with one of the values

All of these operators can also be negated:

!= the field content matches none of the values
!~= the field content does not contain any of the values
!^= the field content does not start with any of the values
!$= the field content does not end with any of the values

See also: TracTickets, TracReports, TracGuide