Phlogiston/Data Model

From MediaWiki.org
Jump to: navigation, search

Vocabulary[edit]

Category: A grouping of tasks within Phlogiston. Categories are defined by <project_name>_recategorization.csv.

Phlogiston Project: A set of tasks that are analyzed as a group, under the assumption that they are the same body of tasks that one team of people work on. A Phlogiston project usually contains all tasks from multiple Phabricator projects.

Phabricator Project: A tag for grouping and labeling tasks in Phabricator.

Source: synonym to Phlogiston Project.

Status: The Phabricator status field. Simplified by generic_make_history.sql.

Tables[edit]

category[edit]

Each row is one category for one Phlogiston scope.

maintenance_delta[edit]

maintenance_week[edit]

maniphest_blocked[edit]

maniphest_blocked_phid[edit]

maniphest_edge[edit]

One row for each edge (relationship) between a task and a project. Notably not partitioned by scope.

maniphest_task[edit]

One row for each task. If a task belongs to multiple Phlogiston scopes, it will appear multiple times (I think).

maniphest_transaction[edit]

One row for each transaction in Phabricator.

open_backlog_size[edit]

Possibly no longer in use and deleteable.

phab_parent_category_edge[edit]

One row for

phabricator_column[edit]

One row for each projectcolumn.

phabricator_project[edit]

One row for each Phabricator project.

recently_closed[edit]

One row per ?. Statistics on recently closed tasks, in the aggregate.

recently_closed_task[edit]

One row per recently closed task per scope.

task_on_date[edit]

One row for each task for each day. Partitioned by scope.

task_on_date_recategorized[edit]

Like task_on_date, but after recategorization.

task_on_date_agg[edit]

Like task_on_date, but aggregated to one row for each unique group of date, category, status, and scope.

velocity[edit]

One row for each category and each of the last weeks, months, and quarters, going back typically 2 quarters I think, partitioned by scope. Holds all of the velocity, history, and forecasting data.

Stored Procedures[edit]

calculate_velocities(scope_prefix)[edit]

Calculate historical velocities; calculate retrocasts and forecasts for past and future, generate all data necessary for charting.

convert_blocked_phid_to_id_sql()[edit]

Insert a row into maniphest_blocked for each row in maniphest_blocked_phid, converting phid to id in the process.

find_descendents(root_id, run_date)[edit]

Returns a list ids of all tasks that are "children" (aka Blockers in Phabricator), as of the specified date.

Limitation: if Task A is a parent of Task B, and Task B is a parent of Task C, and Task A and Task C are tagged with Phabricator projects that are included in Phlogiston Project X, but Task B is not, Task C will not be included in the list.

get_backlog(scope_prefix, status_input, cutoff_range, show_hidden)[edit]

Return a scope's backlog aggregate data, based on specified parameters, combining aggregate data and category info.

get_categories(scope_prefix)[edit]

get_forecast_weeks(scope_prefix)[edit]

get_open_task_list(scope_prefix)[edit]

get_recently_closed_tasks(scope_prefix)[edit]

get_statusReport(scope_prefix, status_report_project, initial_date, final_date)[edit]

get_unpointed_tasks(scope_prefix)[edit]

load_tasks_to_recategorize(scope_prefix)[edit]

populate_recently_closed(scope_prefix, start_date, end_date)[edit]

populate_recently_closed_task(scope_prefix)[edit]

[incomplete list]

Data Model during Phlogiston execution[edit]

The following tables are updated in this order:

Load[edit]

  1. phabricator_project
  2. phabricator_column
  3. maniphest_task
  4. maniphest_blocked_phid
  5. maniphest_transaction
  6. maniphest_blocked

Reconstruct[edit]

  1. maniphest_edge (add project membership many to many table)
  2. task_history (add one row per task per day)
  3. task_milestone (add task ancestor milestone many to many table)
  4. task_history (update with milestone strings)
  5. task_history (update status for special cases involving bad import data)

Report[edit]

  1. task_history_recat (add one row per task per day with consolidated category)
  2. category_list
  3. tall_backlog (add grouped data)
  4. other tables...