<<

NAME

Query.pm -- Infrastructure for querying the metadata for project and version-specific properties.

DESCRIPTION

This module provides an internal API for querying the metadata. This functionality externally surfaces through the query and bids commands.

External API

Query::get_fields()

Used to retrieve a list of legal metadata fields. The current value of each field is defined in Constants. This method must be modified to add or remove legal fields.

Query::check_fields(requested_fields)

Checks whether an array of requested fields contains only legal entries. If illegal fields are in the list, the query is killed. The list of legal fields is defined by Query::get_fields().

Query::query_metadata(project_id, [D|C|A], requested_fields)

Queries are executed through this subroutine. Accepts a project ID, accepts a project ID, a flag indicating which bugs to query, and a set of fields. The flag can have values C (only active bugs), D (only deprecated bugs), or A (all bugs). Returns a dictionary associating bug IDs with a dictionary containing values for each requested metadata field. For examples of usage, see d4j-query and d4j-print-bugs.

Internal Helper Subroutines

Query::_read_bug_csv(filename, requested_fields)

Gathers requested data from a designated bugs CSV file. Returns a hash RESULTS [bug_id] = DATA [field] [value] That is, we associate fields with their respective bug_id. Arguments: filename of bugs CSV file, a set of requested fields.

Query::_read_class_list(base_directory, file_extension, bug_ids)

Reads in a class list (loaded/modified classes, relevant tests) and returns the results as a single string, associated with the requested bug IDs.

Query::_read_stack_traces(include_root, base_directory, bug_ids)

Reads in a list of tests and stack traces (trigger/failing tests) and returns the results as a single string, associated with the requested bug IDs. The first argument determines whether the root cause is included or not.

<<