owid / etl

A compute graph for loading and transforming OWID's data
https://docs.owid.io/projects/etl
MIT License
58 stars 18 forks source link

:bug: Use latest approval for chart-diff #2864

Closed Marigold closed 1 week ago

Marigold commented 1 week ago

chart-sync ran on my latest merged PR here. In it, I rejected all the chart-diffs, yet one of them was migrated to PROD. You can see I rejected all of them here: http://staging-site-news/etl/wizard/chart-diff.

@lucasrodes this is the fix. I noticed that in MySQL that chart was first rejected and then approved

mysql> select * from chart_diff_approvals;
+----+---------+---------------------+-----------------+---------------------+----------+
| id | chartId | sourceUpdatedAt     | targetUpdatedAt | updatedAt           | status   |
+----+---------+---------------------+-----------------+---------------------+----------+
|  1 |    7906 | 2024-06-18 20:34:20 | NULL            | 2024-06-19 12:47:50 | rejected |
|  2 |    7906 | 2024-06-18 20:34:20 | NULL            | 2024-06-19 12:47:56 | approved |
|  3 |    7904 | 2024-06-18 20:26:58 | NULL            | 2024-06-19 12:48:13 | rejected |
|  4 |    7903 | 2024-06-18 17:14:15 | NULL            | 2024-06-19 12:48:15 | rejected |
|  5 |    7905 | 2024-06-18 20:31:41 | NULL            | 2024-06-19 12:48:17 | rejected |
+----+---------+---------------------+-----------------+---------------------+----------+

chart-diff was using the first one and chart-sync the second (correctly). So it thought it's approved and synced it.

owidbot commented 1 week ago
Quick links (staging server): Site Admin Wizard

Login: ssh owid@staging-site-fix-chart-diff-ordering

chart-diff: ✅ No charts for review.

Edited: 2024-06-20 18:10:07 UTC Execution time: 3.73 seconds