wiki:TracQuery
Last modified 5 years ago Last modified on 01/10/2013 10:00:08 AM

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.

Filters

When you first go to the query page the default filter will display tickets relevant to you:

  • If logged in then all open tickets it will display open tickets assigned to you.
  • If not logged in but you have specified a name or email address in the preferences then it will display all open tickets where your email (or name if email not defined) is in the CC list.
  • If not logged and no name/email defined in the preferences then all open issues are displayed.

Current filters can be removed by clicking the button to the left with the minus sign on the label. New filters are added from the pulldown lists at the bottom corners of the filters box ('And' conditions on the left, 'Or' conditions on the right). 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

Trac allows you to save the query as a named query accessible from the reports module. To save a query ensure that you have Updated the view and then click the Save query button displayed beneath the results. You can also save references to queries in Wiki content, as described below.

Note: one way to easily build queries like the ones below, you can build and test the queries in the Custom report module and when ready - click Save query. This will build the query string for you. All you need to do is remove the extra line breaks.

Note: you must have the REPORT_CREATE permission in order to save queries to the list of default reports. The Save query button will only appear if you are logged in as a user that has been granted this permission. If your account does not have permission to create reports, you can still use the methods below to save a query.

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.

Example:

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

This is displayed as:

#18
Installation instructions need a list of prerequisites
#58
Algorithm for propagating mask bits during convolution
#70
DC2 Upgrade to LsstException to maintain the exception history during an unwind.
#114
MaskedImage.readFits/writeFits gets scaling wrong on some images
#115
concise access to boost library name mangler would be helpful
#233
swig apparently does not handle va_list for Trace properly on Linux64
#283
DiaSource and Source should inherit from common base class, and become Citizens
#310
Unit tests for imageproc SVD
#355
Implement conservation of diffim kernel integral
#376
Please allow users to add std::strings and boost::formats to ExceptionStacks
#377
Please make exception traceback more useful
#410
Persisting Sources from WCS/ImagePipeline
#422
Allow packages to easily define their own LSST-compatible exceptions
#425
recipe how to synchronize objects between releases
#509
create class for spatial modeling
#512
Need testcase for testing Exposure formatters
#533
Update afw/formatters/Utils to use `PropertySet`
#535
Implement Selected Additional ISR Stages
#553
scons -c raises python exception
#565
setup often sets up the wrong package due to over-zealous implementation of ">="
#569
boost 1.36.0+1 does not fully build on MacOS X
#589
trac 'submit' operations switching from lsstcorp to ncsa URL
#593
lsstpkg install -C LSSTPipe almost immediately gave up when trying to update an existing stack
#653
Abort in python constructing an Exposure from a MaskedImage constructed from a single Image
#761
Please provide a way to match lists of Sources
#777
ctrl_dc3pipe.table missing a version for ip_diffim
#780
Please cut activemqcpp 2.2.6+2 with "missing _extern" patch
#789
Fix ip_diffim tests and add some more
#834
Redesign C++ Source/DIASource/Object classes
#863
Create EA UML Infrastructure Diagrams
#864
Add fringe correction to ISR
#911
Modify stats to work with NaN edge bits
#946
Cost Sheet: Update Base and soDAC with new storage model
#981
clipboard.put with key=None corrupts clipboard
#1065
Attempting to load a None key into a clipboard should raise an exception
#1066
.paf files interpret foo: None as the string "None"
#1077
policy.getXXX(item) should raise an exception if item is not found
#1128
Exception when no description in stage dictionary
#1222
Sub-policies in a dictionary cannot have a description
#1304
memory corruption when creating an Exposure
#1346
Eliminate Kernel default constructors
#1406
TemplateNotFound: Template "developer/prefs_developer.html" not found
#1454
afw.geom.PointD constructor in python doesn't work as expected
#1472
FITS header order not preserved
#1521
Source IDs should be set ONCE, when they are created, and never touched
#1532
Add component 'pipette'
#1534
Wcs doesn't handle SDSS WCS correctly (with ra/dec switched legally but confusingly)
#1587
lsst::afw::geom::Coord default is degrees instead of radians
#1604
automating purging of mysql general log
#1649
ImagePca does not return orthonormal Images
#1678
Extend selfcal solver to include flat errors
#1701
Box2I == raises an exception in Python with non-Box2I
#1704
Creation of Policy from a string hangs
#1775
Adjust eigen components here, not in ImagePca
#1834
Qserv master needs sanity checks for MySQL config
#1839
disallow access to internal tables
#1869
more FITS code sharing between afw/image and afw/table
#1873
killing queries in qserv
#1875
PropertyList.toString() segfault
#1889
"scons install declare" fails when threaded
#1891
Please upgrade wcslib to 4.9
#1893
Aperture correction configuration should depend on photometry configuration
#1933
Integrating Ref*Match into qserv
#1947
Track partitioning parameters for tables and database ownership of tables
#1948
Test new xrootd client
#1952
Improve speed of partitioner via C++ implementation
#1959
Qserv should check for loaded spatial UDFs
#1998
store most measurements as single-precision
#2036
segfault in PropertyList.toString() in python
#2039
afw::table::SourceCatalog::readFits leaks three Citizens with clang++ 3.0
#2071
automate qserv-based test setup
#2102
unify definition of various constants
#2175
submitRelease sometimes tries to release the wrong +N version
#2256
remove config directory from pipe_tasks
#2295
Org. the subchunk and chunk col. names in code.
#2296
Move env. variable values into config values
#2350
support more forced photometry modes out-of-the-box
#2357
Metadata in source catalogues
#2368
Add DiaSource to Source matching in imageDifference
#2369
clean up python importing in qserv master
#2397
provide an option to specify tests that should not be built
#2405
Centralize hardcoded constants
#2406
swig doesn't parse Eigen typedefs in afw::geom
#2422
Zeropoint-scale per coaddTempExp instead of per calexp.
#2423
Update activemq broker and activemqcpp library to latest versions
#2468
Implement record persistence for PcaPsf
#2482
implement ExposureRecord/Table/Catalog
#2488
scons for qserv needs major rework
#2501
Unify database and table metadata store - qserv-master side
#2513
Squash more afw swig warnings
#2528
change header extensions and add namespaces
#2538
In-memory structure inside qserv for metadata
#2559
Prototype conversion of lua dependencies into EUPS
#2589
Change measurement-ordering control field from "priority" to something better
#2610
Remapping filter names doesn't work for errors
#2612
Remove NaiveCentroid
#2614
RHEL6 Clang build of pipe_tasks is failing unit tests
#2635
Buildbot demo2012 transiently fails due to bus error
#2718
write test cases for W13 schema
#2719
write test cases for W13 schema
#2720
write test cases for W13 schema
#2728
please make patch data IDs numeric
#2740
pare down default measurement algorithms
#2757
confusing error message (non-existing column referenced)
#2806
Test metadata client
#2813
deblender assert when processing coadds
#2819
Background interpolation should operate on NaNs
#2820
Background interpolation should operate on NaNs
#2837
integrate qms into install scripts
#2853
restarting mysqld breaks qserv
#2906
Segfault in processCoadd.py
#2941
Update test cases for new parser framework
#2942
Qserv master needs logging system
#2977
Qserv should catch syntax problems earlier
#3009
CatSim output files should give quantities in degrees
#3057
eups distrib create lsstbuild confused by meas_extensions_photometryKron
#3087
implement Central State System
#3089
Rework Camera Geom
#3104
add state accessors to Random
#3134
Standards: should not shadow python built-in functions
#3153
implement "scons install --prefix=INSTALLDIR" in Qserv-core build procedure
#3163
nested control defaults not respected
#3165
xrootd initialization should abort if mysql connection fails

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. This also allows displaying the link and description of a single ticket:

[[TicketQuery(id=123)]]

This is displayed as:

#123
fw kernel and function: add test cases and finish python interface

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

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

This is displayed as:

#18, #58, #70, #114, #115, #233, #283, #310, #355, #376, #377, #410, #422, #425, #509, #512, #533, #535, #553, #565, #569, #589, #593, #653, #761, #777, #780, #789, #834, #863, #864, #911, #946, #981, #1065, #1066, #1077, #1128, #1222, #1304, #1346, #1406, #1454, #1472, #1521, #1532, #1534, #1587, #1604, #1649, #1678, #1701, #1704, #1775, #1834, #1839, #1869, #1873, #1875, #1889, #1891, #1893, #1933, #1947, #1948, #1952, #1959, #1998, #2036, #2039, #2071, #2102, #2175, #2256, #2295, #2296, #2350, #2357, #2368, #2369, #2397, #2405, #2406, #2422, #2423, #2468, #2482, #2488, #2501, #2513, #2528, #2538, #2559, #2589, #2610, #2612, #2614, #2635, #2718, #2719, #2720, #2728, #2740, #2757, #2806, #2813, #2819, #2820, #2837, #2853, #2906, #2941, #2942, #2977, #3009, #3057, #3087, #3089, #3104, #3134, #3153, #3163, #3165

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

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

This is displayed as:

123

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:

[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter)]]

This is displayed as:

Results (1 - 3 of 2636)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#3171 move examineTestData.py to an example jbosch pgee
#3168 fixed Why is the deblender taking so long on large deblend families? dstn dstn
#3167 fixed Config equality fails on NaN price price
1 2 3 4 5 6 7 8 9 10 11

Full rows

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

[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter,rows=description)]]

This is displayed as:

Results (1 - 3 of 2636)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#3171 move examineTestData.py to an example jbosch pgee
Description

I checked in the move to examples.

When you have reviewed it, feel free to merge it to master before clobbering tests/data

#3168 fixed Why is the deblender taking so long on large deblend families? dstn dstn
Description

With HSC data --id visit=905516 ccd=22 we are seeing a deblend family with >6000 peaks, and it's taking forever, even with maxNumberOfPeaks set. What's up?

#3167 fixed Config equality fails on NaN price price
Description

If a Config contains a value that is NaN, then it fails to compare properly with itself (due to NaNs not comparing; at config.py:751). This is generally not the behaviour that is expected.

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. To include a literal & or | in a value, escape the character with a backslash (\).

The available operators are:

= the field content exactly matches 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

The date fields created and modified can be constrained by using the = operator and specifying a value containing two dates separated by two dots (..). Either end of the date range can be left empty, meaning that the corresponding end of the range is open. The date parser understands a few natural date specifications like "3 weeks ago", "last month" and "now", as well as Bugzilla-style date specifications like "1d", "2w", "3m" or "4y" for 1 day, 2 weeks, 3 months and 4 years, respectively. Spaces in date specifications can be left out to avoid having to quote the query string.

created=2007-01-01..2008-01-01 query tickets created in 2007
created=lastmonth..thismonth query tickets created during the previous month
modified=1weekago.. query tickets that have been modified in the last week
modified=..30daysago query tickets that have been inactive for the last 30 days

See also: TracTickets, TracReports, TracGuide