make codeowners checks faster

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Bazel
    • None
    • DevProd Test Infrastructure
    • DevProd Test Infra 2026-06-30
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I published a new version of the codeowners binary that speeds up the checks https://github.com/mongodb-forks/codeowners

      Before the binary ran everything sequentially and now it uses go coroutines to speed things up. It also checks file prefixes before checking the whole pattern to skip unrelated files faster. I validated to make sure the output of the program is exactly the same. Here is a chart showing the difference.

      Repo CODEOWNERS rules Files Mode Before After Speedup
      ------ ----------------
      ----------- ------- ------ --------
      mms ~15k lines 80k default 13.91s 0.55s *~25×*
      mms ~15k lines 80k `--tracked` 13.83s 0.59s *~23×*
      mongo3 ~3.9k lines 65k default 5.76s 0.38s *~15×*
      mongo3 ~3.9k lines 65k `--tracked` 3.17s 0.36s *~9×*

      Out current `bazel run codeowners` has to run this codeowners binary twice to get the before/after effect so this speedup is doubled in precommit-hooks/ci tasks.

            Assignee:
            Trevor Guidry
            Reporter:
            Trevor Guidry
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: