Migrate the Ci::DailyReportResult table away from EAV model
Summary
This started from !25199 (comment 307886442)
ci_daily_report_results
table was added in !24695 (merged). The structure of the table which follows the EAV model follows the original design of the ci_build_report_results
table from !25199 (closed). But due to the recent discussion of moving that table away from the EAV model, we may need to migrate the ci_daily_report_results
table too, follow whatever ci_build_report_results
ends up with, either using jsonb
or explicit columns.
Improvements
The EAV model is an anti-pattern as pointed out by !25199 (comment 307886442). One benefit of having either jsonb
or explicit columns, is that we save space. Imagine if we have 10 metrics per pipeline, with EAV this would result to 10 rows (assuming all of them are present for the said pipeline).
Risks
As of this writing, #33743 (closed) is the only feature that would use the ci_daily_report_results
table. The backend/frontend are still in development for this feature. It may be good to migrate the table structure now while no feature is still using it yet, the migration plan would be so much simpler. Given, having existing data once we release the actual code coverage graph is just a nice-to-have, we can choose not to worry about existing records in the current ci_daily_report_results
table, so it would take less steps to migrate to the new table structure if we do this now.
The main downside of doing this now, is that this may delay the release of the code coverage graph or even the download CSV feature for it, because we will be blocking the merge of !27094 (merged). It depends on how quick we decide which way to go, jsonb
or explicit columns.