# Copyright (C) 2001-2009, Parrot Foundation.
# $Id: ticket_triaging.pod 42784 2009-11-22 04:26:22Z jkeenan $

=pod

=head1 NAME

docs/project/ticket_triaging.pod - Managing Tickets

=head1 DESCRIPTION

This document attempts to outline a set of best practices for dealing with
tickets in Parrot's tracking system.  It is targeted at Parrot developers and
Ticket Wranglers and is I<not> intended as advice or instruction for end users.
Ticket filing procedures for end users are documented in
F<docs/submissions.pod>.

=head1 WHAT ABOUT TRAC?

Our preferred method of bug tracking at this point is trac:
L<https://trac.parrot.org/>

All Parrot developers are expected to pitch in and help keep the ticket tracker
in a healthy state.  I<This means you!> Most of the document below still makes
sense in terms of activities in trac, but the specifics are of course different
with the new system.

Our previous bug tracking system was RT.  In November 2009 all remaining RT
tickets were closed, with many being reopened in Trac.  No new issues should
be opened in RT, but the old system is available at L<https://rt.perl.org>.
The Parrot issues are in the queue I<parrot>.

=head1 TICKET HANDLING PROCEDURES

=head2 New Tickets

Where I<New> refers to a pre-existing ticket sitting in the Parrot queue with a
status of C<new>.

=head3 Bug Triage

Involves deciding whether the ticket is a real bug, a feature request, a
duplicate, or spam.

It is especially important to check that all C<new> bugs which are marked
[TODO], [PATCH], or [CAGE] really are bugs of the given class.  This is because
some bugs, such as [TODO] and [CAGE], get their status set to C<open> to
indicate that something should be done, rather than that someone is doing
something.

=over 4

=item Is this spam?

Assign the issue to the queue I<spam>. Note that if this is successful, you
will no longer have permissions to view the ticket.

=item Is this a duplication of an existing ticket?

Under the Action section, chose the "resolve as" option and select "duplicate"
from the dropdown.  Add a comment to the ticket along the lines of "Duplicate
of Ticket #123".

=item Is there enough information?

If not, ask for more input.

=item Is it a [TODO] ticket?

Is the subject line in the format C<"[TODO] subsystem - issue>?

Change the status of C<[TODO]> tickets to C<open> to prevent them from
appearing in a listing of C<new> tickets.

=item Is it a [PATCH] ticket?

Is the subject line in the format C<"[PATCH] subsystem - issue>?

Make sure that there is actually a patch attached to the ticket. If you've
applied a patch, be sure to include the revision in your response when closing
the ticket.

=item * Is it a [CAGE] bug?

Is the subject line in the format C<"[CAGE] subsystem - issue>?

C<[CAGE]> bugs should have their status changed to C<open> to prevent them from
appearing in a listing of C<new> bugs.

=item * Assign the bug to someone if at all possible.

=back

=head2 TODO Tickets

=over 4

=item Claim ownership or interest ( CC ) of the ticket.

This way you will receive further correspondence about the ticket.

=item Run the test suite

=item make manitest

=item add the patch author to F<CREDITS> or update the author's entry

=item add correspondence to the ticket stating that the patch was applied.
Include the SVN revision number in your response.

=item make sure that the ticket's 'Tag' includes 'Patch'

=item set the ticket's 'Patch status' to 'Applied'

=item set the ticket's 'resolve as' to 'resolved'

=back

=head2 Old Tickets

If the ticket is more then I<1 month> old, then it's I<old>.

=over 4

=item Ping the requestor

Give the requestor at least I<1 week> to respond.  If you receive no response,
add a comment to the ticket saying that it is stalled because of no response
from the requestor. Change the status to C<stalled>.

If it's a [PATCH] ticket, it's possible that the patch was applied but the
ticket/patch status was never changed.   Also, not all list traffic regarding a
ticket ends up in the tracker.  Look at the SVN repo to attempt to determine if
the ticket was resolved.

=item Review of stalled tickets

Sometimes tickets are C<stalled> because there's no hope if fixing them soon.
Sometimes, no response is available from the requestor, or no one can verify
the report.  Review these tickets periodically.  When possible, change their
status to C<open> or C<closed> as appropriate.

=back

=head3 Necessary Information

As alluded to earlier, tickets are much easier to resolve when they include
sufficient information.  For bugs, this is:

=over 4

=item Specific error messages.

These can come from Parrot or the operating system.  Copied and pasted messages
are best; the exact wording is often important.

=item Platform details.

These include operating system and version, compiler information, processor
architecture, and versions of included libraries.  The file
F<parrot_config.pasm> may be useful.

=item Steps to reproduce.

At what point did you see the failure?  Can you reproduce it?  Do you have a
small PIR program which demonstrates the problem?

=item Failure diagnostics.

Verbose diagnostics from C<prove -v> -- including all error messages and
diagnostics -- are often necessary to resolve test failures.

=item Backtraces.

Segfaults and other crashes within Parrot are much easier to resolve given a
backtrace on a Parrot built with debugging symbols.

=back

[PATCH] tickets for code almost always need tests and often need documentation.
Feel free to ask the submitter to work on both, or to contact another committer
for help in identifying and creating the appropriate tests and documentation.

=head3 Severity Guidelines

Occasionally the severity of a problem may govern how volunteers direct their
resources to resolving tickets.  Here are several criteria by which to
determine the severity of a report.

=over

=item Is there an exploitable security problem?

Can a malicious user destroy data, access sensitive information, or obtain
undesired permissions to the rest of the system?  If so, this is a high
priority ticket.

=item Is there a crash from a pure-PIR program?

Users should never be able to crash Parrot writing normal PIR code.  Such
problems need high priority tickets.

=item Does the defect prevent a successful configuration, build, or
installation of Parrot?

If Parrot cannot build, install, or run, the ticket has a high priority.

=item Does the defect cause test failures on a core platform?

All tests should pass on all core platforms in all releases of Parrot (as well
as on trunk).  Test failures, with the appropriate diagnostic information, are
moderate priority.

=item Is the defect reproducable in the current development version?

Reproducable defects have a normal priority.  Unreproducable tickets have a
lower priority.

=item Does the defect affect a core platform?

Defects affecting non-core platforms have a lower priority (which reflects that
we probably lack the expertise to deal with that platform).

=item Is there a test case suitable for the test suite?

A defect reported with a patch to the test suite (or a test case easily added
to the test suite) may have a higher priority; it's much easier to diagnose and
fix such problems.

=back

=head1 TIPS FOR CORRESPONDENCE

=head2 Be Nice

Remember that every word you type into the ticket tracker is I<On The Record>.
Try not to say anything that could offend or hurt the feelings of I<anyone>.
That includes the ticket submitter and other developers.  When, as a Parrot
developer with commit rights, you send correspondence you are representing the
Parrot project and, by proxy, The Parrot Foundation.  If in doubt, either send
the message privately or not at all.

=head2 Say thank you!

Try to add a little token of appreciation to every message you send in response
to a ticket.  Ticket requestors are doing labor for free!  The least you can do
is let them know that you appreciate their efforts.

Something like:

    Thanks,

    Thanks for following up.

    Thanks for reporting.

    Thanks for X!

... can work wonders.  If you can make someone feel good about themselves maybe
they'll submit another ticket/patch/whatever or perhaps some day become a
Parrot developer.

=head2 Make it clear why the ticket status has changed

Always note why you're changing a ticket's status, particularly if you're
closing or rejecting it.  Nothing will irritate people more then letting them
think that their ticket was unimportant or ignored.

=head2 Example Correspondence

    Hi,

    Can you retest for this ticket with the latest sources from SVN and confirm
    that this still an open issue?

    Thanks,

    -J

or

    Hi,

    Would you mind retesting with the latest sources from SVN?

    Thanks,

    -J

or

    Hi,

    Can you resubmit this patch against SVN trunk?

    Thanks,

    -J

or

    Patch applied as rXXX.  Thanks for submitting.

    -J

or

    No response for requestor.  Ticket being marked as 'rejected'.
    Thanks for reporting.

    -J

or

    This doesn't appear to be an issue anymore.
    Thanks for submitting.

    -J

or

    Marking this ticket as 'resolved' because it seems to have fixed itself.
    Thanks for following up.

    -J

=head1 SVN USAGE TIPS

=head2 Commit messages

=over 4

=item Put a subsystem identifier out the front

  [json]: commit message

=item If related to a Trac ticket, use the ticket number

  [json]: Resolve #731

=item Add a "Courtesy of <foo>" if supplied by someone else

  Courtesy of A. U. Thor <author@cpan.org>

=item Detailed commit messages are preferred

Make it clear what your intent is when committing. It makes future maintenance
much easier.

  [PGE]:
  * Switched "PGE::Regex" to be "PGE::Grammar", to be more accurate.
  * Moved default rules from PGE::Regex into PGE::Match.
  * Updated various languages and tools to match.

=item Commit file names

You don't need to include the filename in the commit message as that's part of
the commit itself. However, if your commit affects multiple directories, you
may mention that, especially if it's part of a group of commits.

  [PDD07]: whitespace -- part 5
  ~ removed trailing spaces and tabs from t/exit/, t/dynpmc/, t/dynoplibs/

=item Group similar commits by parts

If all commits are much the same and require basically the same commit
message, it can be useful to number the commit messages. For example:

  [tools]: smartlink functionality -- part 3
  ~ added regex attribute to Keyphrase class
  ~ filled in some more SmartLinkServer attribute init code
  ~ expanded LinkTree class functionality
  still TODO: merge smartlink and spec info, emit html, improve cmdline
  option code

You may optionally include items that are still todo, as it helps make your
intentions clear.

=item More ideas

Look at past commit messages, and L<http://cia.navi.cx/stats/project/parrot>
for more best practices.

=back

=cut
