Thoughts on Code Coverage Scope in Code Review

· 2 min read

Current CR code scope is by individual branch, by day. Is there duplicate code review in coding practice?

When filtering by a single branch like sprint, we filter yesterday’s code by commit date for review. These commits actually include MRs (Merge Requests), and MRs themselves are commits. MR commits contain commit records that are not from the current day. What does this mean? For example, if you do an MR on the 5th, it might contain code committed on the 4th.

Will we see the same code segment repeatedly?

  1. Dates may appear that are not the target review date. As mentioned above, an MR on the 5th contains Diff from commits on the 4th
  2. Since we look at Diff in CR, if previous code has already entered the branch, when looking at subsequent days, duplicate code naturally doesn’t count in the Diff, so there's no duplicate reviewing of the same code segment

Conclusion

  1. The current mechanism for CR has no issues with code coverage scope

Worth Noting

  1. MR itself is a single commit, but the code seen in MR consists of N commits from other branches associated with the MR
  2. If conflicts exist in the MR itself, then the MR may also contain some Diff modifications that exist solely in this commit
  3. The commit date of the MR itself differs from the commit dates associated with the MR, because the overall commit dates are linear
  4. The order in Git records is by push date, but the dates we see in the record list are commit dates