Add ci_only validator tool [chromium/src : main]

0 views
Skip to first unread message

Brian Sheedy (Gerrit)

unread,
Jun 8, 2026, 3:16:54 PMJun 8
to Aadarsh Battula, Prakhar Asthana, chromium...@chromium.org
Attention needed from Aadarsh Battula and Prakhar Asthana

Brian Sheedy added 7 comments

File tools/code_coverage/ci_only_validator.py
Line 20, Patchset 21 (Latest): """Discovers all trybots and target groups configuring the test suite."""
Brian Sheedy . unresolved

As mentioned in the other review, please include docstrings with argument and return value information for any non-trivial functions/methods.

Line 51, Patchset 21 (Latest): if len(parts) >= 8 and parts[4] == 'try' and parts[6] == 'targets':
Brian Sheedy . unresolved

This seems overly complicated. The `git grep` command is already filtering to the relevant files, so we shouldn't need to do any more checking?

Line 143, Patchset 21 (Latest): results.append({
'builder': builder_name,
'ci_only': is_ci_only,
})
Brian Sheedy . unresolved

Nit: A named tuple or a dataclass is more fitting if the keys are fixed.

Line 205, Patchset 21 (Latest): f" {len(trybots_and_groups)} configured trybots{revision_msg}...")
Brian Sheedy . unresolved

Single quotes since there aren't any single quotes in the string itself.

File tools/code_coverage/ci_only_validator_test.py
Line 27, Patchset 21 (Latest): @mock.patch('subprocess.run')
Brian Sheedy . unresolved

Handle mocking for commonly used functions like this one in `setUp` instead of applying a decorator everywhere.

Line 32, Patchset 21 (Latest): '\n'
'infra/config/generated/builders/try/android-code-coverage/targets/'
'chromium.coverage.json\n'
'infra/config/generated/builders/try/android-x86-code-coverage/'
'targets/chromium.coverage.json\n'),
Brian Sheedy . unresolved

Use `textwrap.dedent` and a multiline string instead. Relevant here and elsewhere in this file.

Line 118, Patchset 21 (Latest): @mock.patch('pathlib.Path.read_text')
Brian Sheedy . unresolved

Shouldn't be necessary with `pyfakefs`.

Open in Gerrit

Related details

Attention is currently required from:
  • Aadarsh Battula
  • Prakhar Asthana
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4081490e7aaeb70c9545e33a3e9b658f39a55965
Gerrit-Change-Number: 7904638
Gerrit-PatchSet: 21
Gerrit-Owner: Aadarsh Battula <aada...@google.com>
Gerrit-Reviewer: Brian Sheedy <bsh...@chromium.org>
Gerrit-Reviewer: Prakhar Asthana <past...@google.com>
Gerrit-Attention: Aadarsh Battula <aada...@google.com>
Gerrit-Attention: Prakhar Asthana <past...@google.com>
Gerrit-Comment-Date: Mon, 08 Jun 2026 19:16:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Aadarsh Battula (Gerrit)

unread,
Jun 8, 2026, 4:45:51 PMJun 8
to Prakhar Asthana, Brian Sheedy, chromium...@chromium.org
Attention needed from Brian Sheedy

Aadarsh Battula added 7 comments

File tools/code_coverage/ci_only_validator.py
Line 20, Patchset 21: """Discovers all trybots and target groups configuring the test suite."""
Brian Sheedy . resolved

As mentioned in the other review, please include docstrings with argument and return value information for any non-trivial functions/methods.

Aadarsh Battula

Marked as resolved.

Line 51, Patchset 21: if len(parts) >= 8 and parts[4] == 'try' and parts[6] == 'targets':
Brian Sheedy . resolved

This seems overly complicated. The `git grep` command is already filtering to the relevant files, so we shouldn't need to do any more checking?

Aadarsh Battula

Marked as resolved.

Line 143, Patchset 21: results.append({

'builder': builder_name,
'ci_only': is_ci_only,
})
Brian Sheedy . resolved

Nit: A named tuple or a dataclass is more fitting if the keys are fixed.

Aadarsh Battula

Marked as resolved.

Line 205, Patchset 21: f" {len(trybots_and_groups)} configured trybots{revision_msg}...")
Brian Sheedy . resolved

Single quotes since there aren't any single quotes in the string itself.

Aadarsh Battula

Marked as resolved.

File tools/code_coverage/ci_only_validator_test.py
Line 27, Patchset 21: @mock.patch('subprocess.run')
Brian Sheedy . resolved

Handle mocking for commonly used functions like this one in `setUp` instead of applying a decorator everywhere.

Aadarsh Battula

Marked as resolved.


'infra/config/generated/builders/try/android-code-coverage/targets/'
'chromium.coverage.json\n'
'infra/config/generated/builders/try/android-x86-code-coverage/'
'targets/chromium.coverage.json\n'),
Brian Sheedy . resolved

Use `textwrap.dedent` and a multiline string instead. Relevant here and elsewhere in this file.

Aadarsh Battula

Marked as resolved.

Line 118, Patchset 21: @mock.patch('pathlib.Path.read_text')
Brian Sheedy . resolved

Shouldn't be necessary with `pyfakefs`.

Aadarsh Battula

Marked as resolved.

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Sheedy
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I4081490e7aaeb70c9545e33a3e9b658f39a55965
    Gerrit-Change-Number: 7904638
    Gerrit-PatchSet: 22
    Gerrit-Owner: Aadarsh Battula <aada...@google.com>
    Gerrit-Reviewer: Brian Sheedy <bsh...@chromium.org>
    Gerrit-Reviewer: Prakhar Asthana <past...@google.com>
    Gerrit-Attention: Brian Sheedy <bsh...@chromium.org>
    Gerrit-Comment-Date: Mon, 08 Jun 2026 20:45:39 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Brian Sheedy <bsh...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Brian Sheedy (Gerrit)

    unread,
    Jun 8, 2026, 5:20:19 PMJun 8
    to Aadarsh Battula, Prakhar Asthana, chromium...@chromium.org
    Attention needed from Aadarsh Battula

    Brian Sheedy added 2 comments

    File tools/code_coverage/ci_only_validator.py
    Line 12, Patchset 22 (Latest):from typing import Any, Callable, Dict, List, NamedTuple, Optional
    Brian Sheedy . unresolved

    We should be on a new enough Python version that `dict` and `list` support subscripts, so the `typing` imports should be unneeded. Is this related to this directory using an older version of pylint that doesn't support newer Python features?

    Line 12, Patchset 22 (Latest):from typing import Any, Callable, Dict, List, NamedTuple, Optional
    Brian Sheedy . unresolved

    Similarly, we should support `| None` instead.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Aadarsh Battula
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I4081490e7aaeb70c9545e33a3e9b658f39a55965
      Gerrit-Change-Number: 7904638
      Gerrit-PatchSet: 22
      Gerrit-Owner: Aadarsh Battula <aada...@google.com>
      Gerrit-Reviewer: Brian Sheedy <bsh...@chromium.org>
      Gerrit-Reviewer: Prakhar Asthana <past...@google.com>
      Gerrit-Attention: Aadarsh Battula <aada...@google.com>
      Gerrit-Comment-Date: Mon, 08 Jun 2026 21:20:00 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aadarsh Battula (Gerrit)

      unread,
      Jun 8, 2026, 5:26:43 PMJun 8
      to Prakhar Asthana, Brian Sheedy, chromium...@chromium.org
      Attention needed from Brian Sheedy

      Aadarsh Battula added 2 comments

      File tools/code_coverage/ci_only_validator.py
      Line 12, Patchset 22:from typing import Any, Callable, Dict, List, NamedTuple, Optional
      Brian Sheedy . resolved

      We should be on a new enough Python version that `dict` and `list` support subscripts, so the `typing` imports should be unneeded. Is this related to this directory using an older version of pylint that doesn't support newer Python features?

      Aadarsh Battula

      Python version: 3.11.9
      Pylint version: 3.2.7

      Just removed the typing imports for Dict and List.

      Line 12, Patchset 22:from typing import Any, Callable, Dict, List, NamedTuple, Optional
      Brian Sheedy . resolved

      Similarly, we should support `| None` instead.

      Aadarsh Battula

      Got it, just updated it in the necessary function headers

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Brian Sheedy
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I4081490e7aaeb70c9545e33a3e9b658f39a55965
        Gerrit-Change-Number: 7904638
        Gerrit-PatchSet: 22
        Gerrit-Owner: Aadarsh Battula <aada...@google.com>
        Gerrit-Reviewer: Brian Sheedy <bsh...@chromium.org>
        Gerrit-Reviewer: Prakhar Asthana <past...@google.com>
        Gerrit-Attention: Brian Sheedy <bsh...@chromium.org>
        Gerrit-Comment-Date: Mon, 08 Jun 2026 21:26:23 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Brian Sheedy <bsh...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Brian Sheedy (Gerrit)

        unread,
        Jun 8, 2026, 5:36:27 PMJun 8
        to Aadarsh Battula, Prakhar Asthana, chromium...@chromium.org
        Attention needed from Aadarsh Battula

        Brian Sheedy voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Aadarsh Battula
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I4081490e7aaeb70c9545e33a3e9b658f39a55965
          Gerrit-Change-Number: 7904638
          Gerrit-PatchSet: 23
          Gerrit-Owner: Aadarsh Battula <aada...@google.com>
          Gerrit-Reviewer: Brian Sheedy <bsh...@chromium.org>
          Gerrit-Reviewer: Prakhar Asthana <past...@google.com>
          Gerrit-Attention: Aadarsh Battula <aada...@google.com>
          Gerrit-Comment-Date: Mon, 08 Jun 2026 21:36:07 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Aadarsh Battula (Gerrit)

          unread,
          Jun 9, 2026, 6:24:20 PMJun 9
          to Brian Sheedy, Prakhar Asthana, chromium...@chromium.org, ayman...@chromium.org, mdjone...@chromium.org, yuezhang...@chromium.org
          Attention needed from Brian Sheedy and Prakhar Asthana

          Message from Aadarsh Battula

          Set Ready For Review

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Brian Sheedy
          • Prakhar Asthana
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I4081490e7aaeb70c9545e33a3e9b658f39a55965
            Gerrit-Change-Number: 7904638
            Gerrit-PatchSet: 26
            Gerrit-Owner: Aadarsh Battula <aada...@google.com>
            Gerrit-Reviewer: Brian Sheedy <bsh...@chromium.org>
            Gerrit-Reviewer: Prakhar Asthana <past...@google.com>
            Gerrit-Attention: Prakhar Asthana <past...@google.com>
            Gerrit-Attention: Brian Sheedy <bsh...@chromium.org>
            Gerrit-Comment-Date: Tue, 09 Jun 2026 22:24:07 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Brian Sheedy (Gerrit)

            unread,
            Jun 9, 2026, 6:27:02 PMJun 9
            to Aadarsh Battula, Prakhar Asthana, chromium...@chromium.org, ayman...@chromium.org, mdjone...@chromium.org, yuezhang...@chromium.org
            Attention needed from Aadarsh Battula and Prakhar Asthana

            Brian Sheedy voted Code-Review+1

            Code-Review+1
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Aadarsh Battula
            • Prakhar Asthana
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement is not satisfiedCode-Review
              • requirement satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I4081490e7aaeb70c9545e33a3e9b658f39a55965
              Gerrit-Change-Number: 7904638
              Gerrit-PatchSet: 26
              Gerrit-Owner: Aadarsh Battula <aada...@google.com>
              Gerrit-Reviewer: Brian Sheedy <bsh...@chromium.org>
              Gerrit-Reviewer: Prakhar Asthana <past...@google.com>
              Gerrit-Attention: Aadarsh Battula <aada...@google.com>
              Gerrit-Attention: Prakhar Asthana <past...@google.com>
              Gerrit-Comment-Date: Tue, 09 Jun 2026 22:26:50 +0000
              Gerrit-HasComments: No
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Prakhar Asthana (Gerrit)

              unread,
              4:04 PM (2 hours ago) 4:04 PM
              to Aadarsh Battula, Code Review Nudger, Brian Sheedy, chromium...@chromium.org, ayman...@chromium.org, mdjone...@chromium.org, yuezhang...@chromium.org
              Attention needed from Aadarsh Battula and Brian Sheedy

              Prakhar Asthana voted and added 1 comment

              Votes added by Prakhar Asthana

              Code-Review+1

              1 comment

              File tools/code_coverage/ci_only_validator.py
              Line 89, Patchset 28 (Latest):def read_disk(src_root: pathlib.Path, rel_path: str) -> str | None:
              Prakhar Asthana . unresolved

              read_local

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Aadarsh Battula
              • Brian Sheedy
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Owners
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              • requirement satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I4081490e7aaeb70c9545e33a3e9b658f39a55965
              Gerrit-Change-Number: 7904638
              Gerrit-PatchSet: 28
              Gerrit-Owner: Aadarsh Battula <aada...@google.com>
              Gerrit-Reviewer: Brian Sheedy <bsh...@chromium.org>
              Gerrit-Reviewer: Prakhar Asthana <past...@google.com>
              Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
              Gerrit-Attention: Aadarsh Battula <aada...@google.com>
              Gerrit-Attention: Brian Sheedy <bsh...@chromium.org>
              Gerrit-Comment-Date: Wed, 08 Jul 2026 20:04:36 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Aadarsh Battula (Gerrit)

              unread,
              4:21 PM (1 hour ago) 4:21 PM
              to Prakhar Asthana, Code Review Nudger, Brian Sheedy, chromium...@chromium.org, ayman...@chromium.org, mdjone...@chromium.org, yuezhang...@chromium.org
              Attention needed from Brian Sheedy and Prakhar Asthana

              Aadarsh Battula added 1 comment

              File tools/code_coverage/ci_only_validator.py
              Line 89, Patchset 28:def read_disk(src_root: pathlib.Path, rel_path: str) -> str | None:
              Prakhar Asthana . resolved

              read_local

              Aadarsh Battula

              Marked as resolved.

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Brian Sheedy
              • Prakhar Asthana
              Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement satisfiedCode-Owners
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedReview-Enforcement
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I4081490e7aaeb70c9545e33a3e9b658f39a55965
                Gerrit-Change-Number: 7904638
                Gerrit-PatchSet: 29
                Gerrit-Owner: Aadarsh Battula <aada...@google.com>
                Gerrit-Reviewer: Brian Sheedy <bsh...@chromium.org>
                Gerrit-Reviewer: Prakhar Asthana <past...@google.com>
                Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
                Gerrit-Attention: Prakhar Asthana <past...@google.com>
                Gerrit-Attention: Brian Sheedy <bsh...@chromium.org>
                Gerrit-Comment-Date: Wed, 08 Jul 2026 20:21:15 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                Comment-In-Reply-To: Prakhar Asthana <past...@google.com>
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Brian Sheedy (Gerrit)

                unread,
                4:28 PM (1 hour ago) 4:28 PM
                to Aadarsh Battula, Prakhar Asthana, Code Review Nudger, chromium...@chromium.org, ayman...@chromium.org, mdjone...@chromium.org, yuezhang...@chromium.org
                Attention needed from Aadarsh Battula and Prakhar Asthana

                Brian Sheedy voted Code-Review+1

                Code-Review+1
                Open in Gerrit

                Related details

                Attention is currently required from:
                • Aadarsh Battula
                • Prakhar Asthana
                Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement satisfiedReview-Enforcement
                  Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                  Gerrit-MessageType: comment
                  Gerrit-Project: chromium/src
                  Gerrit-Branch: main
                  Gerrit-Change-Id: I4081490e7aaeb70c9545e33a3e9b658f39a55965
                  Gerrit-Change-Number: 7904638
                  Gerrit-PatchSet: 29
                  Gerrit-Owner: Aadarsh Battula <aada...@google.com>
                  Gerrit-Reviewer: Brian Sheedy <bsh...@chromium.org>
                  Gerrit-Reviewer: Prakhar Asthana <past...@google.com>
                  Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
                  Gerrit-Attention: Aadarsh Battula <aada...@google.com>
                  Gerrit-Attention: Prakhar Asthana <past...@google.com>
                  Gerrit-Comment-Date: Wed, 08 Jul 2026 20:28:03 +0000
                  Gerrit-HasComments: No
                  Gerrit-Has-Labels: Yes
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy
                  Reply all
                  Reply to author
                  Forward
                  0 new messages