Open DavidDudas-Intuitial opened 9 hours ago
Here's what I see in my local db after running the past several days of data into the new schema:
app=# select id, ghid, title from gh_issue where ghid like '%2887';
id | ghid | title
-------+------------------------------------+------------------------------------------------------------------------
10588 | HHS/simpler-grants-gov/issues/2887 | Add new columns to analytics database to enable sprint burndown charts
(1 row)
app=# select issue_id, status, is_closed, points, d_effective, project_id, sprint_id from gh_issue_history where issue_id = 10588 order by project_id, d_effective;
issue_id | status | is_closed | points | d_effective | project_id | sprint_id
----------+-------------+-----------+--------+-------------+------------+-----------
10588 | Icebox | 0 | 0 | 2024-11-18 | 1 |
10588 | Icebox | 0 | 0 | 2024-11-19 | 1 |
10588 | Icebox | 0 | 0 | 2024-11-20 | 1 |
10588 | Done | 1 | 1 | 2024-11-21 | 1 | 3
10588 | In Progress | 0 | 3 | 2024-11-18 | 2 | 26
10588 | In Review | 0 | 3 | 2024-11-19 | 2 | 26
10588 | In Review | 0 | 3 | 2024-11-20 | 2 | 26
10588 | Done | 1 | 3 | 2024-11-21 | 2 | 26
(8 rows)
Summary
Fixes #2927
Time to review: 5 mins
Changes proposed
gh_issue_history
table to add columnsproject_id
andsprint_id
, and updates the issue transform/load step accordinglygh_issue_history
from(issue_id, d_effective)
to(issue_id, project_id, d_effective)
thereby allowing an issue to be mapped to concurrent sprints in separate projectsContext for reviewers
The current schema does not allow for an issue to be mapped to multiple concurrent sprints (e.g. sprint 1.4 in project 13 and sprint 1.4 in project 17). The limitation causes minor calculation errors in percent complete metrics. This PR removes the limitation by extending the schema and the transform/load logic.
Note: With this PR, the table
gh_issue_sprint_map
becomes obsolete, but it still exists in the database and transform/load is still writing to it. After the new iteration ofgh_issue_history
is verified to be sufficient for percent complete metrics calculation, the obsolete table and code will be deleted.Additional information
In schema version 4,
gh_issue_history
looks like this:In schema version 5,
gh_issue_history
looks like this: