Code Review Analytics: Review Time calculation
Summary
Based on #38062 (comment 269477889)
In order to properly sort MRs list on review time we should store "first non-author comment creation date" timestamp, so we can effectively calculate actual review time for any given MR.
Proposal
Fill first_comment_at
field in merge_request_metrics
table when non-author posts any comment on a MR. Recalculate first_comment_at
when comment deletion happens.
Open questions
What should we do if user deletes first comment some time later? Should we recalculate for newfirst_comment_at
date or no?-
What about data migration? CurrentlyOUT OF SCOPEfirst_comment_at
field is filled for "merged" MRs only, so there will be no data filled for open MRs leaving us with no data right after CRA deploy. Currently we have about 4.8mln open MRs at gitlab.com -
What should happen if a client moves group\instance from free to Starter+ license? Should we trigger data migration to backfill data of all open MRs?OUT OF SCOPE -
Considering plans to extend list of MRs to merged\closed MRs data migration can have wider scope in future.OUT OF SCOPE
Edited by Pavel Shutsin