Make pt-query-advisor output JSON

Registered by Brian Fraser on 2012-02-06

TriasMiguel requested this for a project.

1. Discuss the JSON format with Miguel.

Namely, what it should include, and how it should be like.
Currently we are settled in something like
{"44AAC79F41BCF692":[{"rule": "COL.001", "desc":" ... ","severity":"note"},{"rule": "JOI.001","desc":" ... ","severity":"crit"},{"rule": "JOI.002","desc":" ... ","severity":"crit"}]}

That is
{
   QUERY_ID: [
     # List of rules:
      { rule: RULE_ID, severity: "...", description: "..." },
      ...
   ]
}

2. Write a JSON serializer.

Rather than adding an extra CPAN dependency, though borrowing parts from JSON::PP is likely a good idea.

3. Change the tool to output JSON

print_advice, queue_advice and print_grouped_report -- and possibly others that I might've missed -- should output JSON , or have an option to return something JSONable. We also need to settle on a command line option to enable this.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
Brian Fraser
Direction:
Needs approval
Assignee:
None
Definition:
Drafting
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Brian Fraser
Completed by
Brian Fraser

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.