Improve and simplify API and impl of action_utils [chromium/src : main]

1 view
Skip to first unread message

Alexei Svitkine (Gerrit)

unread,
Jan 5, 2026, 10:39:26 AM (8 days ago) Jan 5
to Andrzej Fiedukowicz, Code Review Nudger, Luc Nguyen, Alicja Opalinska, Gleb Nikolaev, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, asvitkine...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com
Attention needed from Alicja Opalinska, Andrzej Fiedukowicz and Luc Nguyen

Alexei Svitkine voted and added 1 comment

Votes added by Alexei Svitkine

Code-Review+1

1 comment

File tools/metrics/actions/action_utils.py
Line 118, Patchset 12 (Latest): token: a Token object to get the key from.
Alexei Svitkine . unresolved

Add pydoc for the return.

Open in Gerrit

Related details

Attention is currently required from:
  • Alicja Opalinska
  • Andrzej Fiedukowicz
  • Luc Nguyen
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: I2d0e4e8086c39ed7a0f48d5713a55ba549a5022a
Gerrit-Change-Number: 7280929
Gerrit-PatchSet: 12
Gerrit-Owner: Andrzej Fiedukowicz <af...@google.com>
Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
Gerrit-Reviewer: Alicja Opalinska <aopal...@google.com>
Gerrit-Reviewer: Luc Nguyen <lucn...@google.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: Gleb Nikolaev <gnik...@chromium.org>
Gerrit-Attention: Alicja Opalinska <aopal...@google.com>
Gerrit-Attention: Luc Nguyen <lucn...@google.com>
Gerrit-Attention: Andrzej Fiedukowicz <af...@google.com>
Gerrit-Comment-Date: Mon, 05 Jan 2026 15:39:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Alexei Svitkine (Gerrit)

unread,
Jan 5, 2026, 10:39:42 AM (8 days ago) Jan 5
to Andrzej Fiedukowicz, Code Review Nudger, Luc Nguyen, Alicja Opalinska, Gleb Nikolaev, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, asvitkine...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com
Attention needed from Alicja Opalinska, Andrzej Fiedukowicz and Luc Nguyen

Alexei Svitkine added 1 comment

File tools/metrics/actions/action_utils.py
Line 143, Patchset 12 (Latest): """
Alexei Svitkine . unresolved

Here too.

Gerrit-Comment-Date: Mon, 05 Jan 2026 15:39:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrzej Fiedukowicz (Gerrit)

unread,
Jan 7, 2026, 7:10:13 AM (6 days ago) Jan 7
to Alexei Svitkine, Code Review Nudger, Luc Nguyen, Alicja Opalinska, Gleb Nikolaev, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, asvitkine...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com
Attention needed from Alexei Svitkine, Alicja Opalinska and Luc Nguyen

Andrzej Fiedukowicz added 2 comments

File tools/metrics/actions/action_utils.py
Line 118, Patchset 12: token: a Token object to get the key from.
Alexei Svitkine . resolved

Add pydoc for the return.

Andrzej Fiedukowicz

Done

Line 143, Patchset 12: """
Alexei Svitkine . resolved

Here too.

Andrzej Fiedukowicz

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Alexei Svitkine
  • Alicja Opalinska
  • Luc Nguyen
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: I2d0e4e8086c39ed7a0f48d5713a55ba549a5022a
    Gerrit-Change-Number: 7280929
    Gerrit-PatchSet: 14
    Gerrit-Owner: Andrzej Fiedukowicz <af...@google.com>
    Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
    Gerrit-Reviewer: Alicja Opalinska <aopal...@google.com>
    Gerrit-Reviewer: Luc Nguyen <lucn...@google.com>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-CC: Gleb Nikolaev <gnik...@chromium.org>
    Gerrit-Attention: Alicja Opalinska <aopal...@google.com>
    Gerrit-Attention: Luc Nguyen <lucn...@google.com>
    Gerrit-Attention: Alexei Svitkine <asvi...@chromium.org>
    Gerrit-Comment-Date: Wed, 07 Jan 2026 12:09:58 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Alexei Svitkine <asvi...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Luc Nguyen (Gerrit)

    unread,
    Jan 7, 2026, 3:38:20 PM (6 days ago) Jan 7
    to Andrzej Fiedukowicz, Chromium LUCI CQ, Alexei Svitkine, Code Review Nudger, Alicja Opalinska, Gleb Nikolaev, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, asvitkine...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com
    Attention needed from Alexei Svitkine, Alicja Opalinska and Andrzej Fiedukowicz

    Luc Nguyen added 6 comments

    File tools/metrics/actions/action_utils.py
    Line 115, Patchset 17 (Latest): actions_dict: dict of existing action name to Action object.
    action: an Action object to combine with suffix.
    variant: a Variant object to combine with action.

    token: a Token object to get the key from.
    Luc Nguyen . unresolved

    nit: update this

    Line 144, Patchset 17 (Latest): actions_dict: A dict of existing action name to Action object.
    variants_dict: A dict of variants name to list of Variant objects.
    Luc Nguyen . unresolved

    nit: update this

    Line 155, Patchset 17 (Latest): expanded_actions[action.name] = action
    Luc Nguyen . unresolved

    nit: add `continue` just to be explicit that there's no other work to do

    Line 157, Patchset 17 (Latest): for token in action.tokens:
    for variant in token.variants:
    new_action = _CreateActionFromVariant(action, variant, token)
    expanded_actions[new_action.name] = new_action
    Luc Nguyen . unresolved

    IIUC this doesn't work if the action has multiple variants right? e.g. `Action{Token1}{Token2}`. do we intentionally not support them? i don't see any TODOs and couldn't really find anything in our buglist, and https://chromium.googlesource.com/chromium/src/+/master/tools/metrics/histograms/README.md is pretty lackluster in terms of variants support

    (non-blocking because the previous code is the same)

    File tools/metrics/actions/extract_actions.py
    Line 662, Patchset 17 (Latest): logging.error(
    f'The variants attribute {variants_name} of token key {token_key} '
    f'of action {action_name} does not have a corresponding '
    f'<variants> tag.')
    Luc Nguyen . unresolved

    should this be fatal? since we're now accessing `variants_dict[variants_name]` below

    File tools/metrics/actions/extract_actions_test.py
    Line 232, Patchset 17 (Latest): return extract_actions.PrettyPrint(actions_dict | expanded_actions,
    Luc Nguyen . unresolved

    nit: is the `|` necessary? i see in `CreateActionsFromVariants()` that we leave the actions that don't need expanding untouched:

    ```python
    # If there are no tokens to fill, the action goes to the list as-is.
    if not action.tokens:
    expanded_actions[action.name] = action
    ```
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alexei Svitkine
    • Alicja Opalinska
    • Andrzej Fiedukowicz
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement 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: I2d0e4e8086c39ed7a0f48d5713a55ba549a5022a
      Gerrit-Change-Number: 7280929
      Gerrit-PatchSet: 17
      Gerrit-Owner: Andrzej Fiedukowicz <af...@google.com>
      Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
      Gerrit-Reviewer: Alicja Opalinska <aopal...@google.com>
      Gerrit-Reviewer: Andrzej Fiedukowicz <af...@google.com>
      Gerrit-Reviewer: Luc Nguyen <lucn...@google.com>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-CC: Gleb Nikolaev <gnik...@chromium.org>
      Gerrit-Attention: Alicja Opalinska <aopal...@google.com>
      Gerrit-Attention: Alexei Svitkine <asvi...@chromium.org>
      Gerrit-Attention: Andrzej Fiedukowicz <af...@google.com>
      Gerrit-Comment-Date: Wed, 07 Jan 2026 20:38:11 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Luc Nguyen (Gerrit)

      unread,
      Jan 7, 2026, 3:39:31 PM (6 days ago) Jan 7
      to Andrzej Fiedukowicz, Chromium LUCI CQ, Alexei Svitkine, Code Review Nudger, Alicja Opalinska, Gleb Nikolaev, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, asvitkine...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com
      Attention needed from Alexei Svitkine, Alicja Opalinska and Andrzej Fiedukowicz

      Luc Nguyen added 1 comment

      File tools/metrics/actions/action_utils.py
      Line 157, Patchset 17 (Latest): for token in action.tokens:
      for variant in token.variants:
      new_action = _CreateActionFromVariant(action, variant, token)
      expanded_actions[new_action.name] = new_action
      Luc Nguyen . resolved

      IIUC this doesn't work if the action has multiple variants right? e.g. `Action{Token1}{Token2}`. do we intentionally not support them? i don't see any TODOs and couldn't really find anything in our buglist, and https://chromium.googlesource.com/chromium/src/+/master/tools/metrics/histograms/README.md is pretty lackluster in terms of variants support

      (non-blocking because the previous code is the same)

      Gerrit-Comment-Date: Wed, 07 Jan 2026 20:39:25 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Luc Nguyen <lucn...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Luc Nguyen (Gerrit)

      unread,
      Jan 7, 2026, 3:44:51 PM (6 days ago) Jan 7
      to Andrzej Fiedukowicz, Chromium LUCI CQ, Alexei Svitkine, Code Review Nudger, Alicja Opalinska, Gleb Nikolaev, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, asvitkine...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com
      Attention needed from Alexei Svitkine, Alicja Opalinska and Andrzej Fiedukowicz

      Luc Nguyen added 1 comment

      File tools/metrics/actions/action_utils_test.py
      Line 24, Patchset 17 (Latest): variants_name = f"TypeOf{token.key}"
      Luc Nguyen . unresolved

      nit: what's the purpose of this "TypeOf" prefix?

      Gerrit-Comment-Date: Wed, 07 Jan 2026 20:44:44 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andrzej Fiedukowicz (Gerrit)

      unread,
      Jan 8, 2026, 4:41:03 AM (5 days ago) Jan 8
      to Chromium LUCI CQ, Alexei Svitkine, Code Review Nudger, Luc Nguyen, Alicja Opalinska, Gleb Nikolaev, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, asvitkine...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com
      Attention needed from Alexei Svitkine, Alicja Opalinska and Luc Nguyen

      Andrzej Fiedukowicz added 7 comments

      File tools/metrics/actions/action_utils.py
      Line 115, Patchset 17: actions_dict: dict of existing action name to Action object.

      action: an Action object to combine with suffix.
      variant: a Variant object to combine with action.
      token: a Token object to get the key from.
      Luc Nguyen . resolved

      nit: update this

      Andrzej Fiedukowicz

      Done

      Line 144, Patchset 17: actions_dict: A dict of existing action name to Action object.

      variants_dict: A dict of variants name to list of Variant objects.
      Luc Nguyen . resolved

      nit: update this

      Andrzej Fiedukowicz

      Done

      Line 155, Patchset 17: expanded_actions[action.name] = action
      Luc Nguyen . resolved

      nit: add `continue` just to be explicit that there's no other work to do

      Andrzej Fiedukowicz

      Done

      Line 157, Patchset 17: for token in action.tokens:

      for variant in token.variants:
      new_action = _CreateActionFromVariant(action, variant, token)
      expanded_actions[new_action.name] = new_action
      Luc Nguyen . resolved

      IIUC this doesn't work if the action has multiple variants right? e.g. `Action{Token1}{Token2}`. do we intentionally not support them? i don't see any TODOs and couldn't really find anything in our buglist, and https://chromium.googlesource.com/chromium/src/+/master/tools/metrics/histograms/README.md is pretty lackluster in terms of variants support

      (non-blocking because the previous code is the same)

      Luc Nguyen

      hmm, nvm, i just saw https://chromium-review.googlesource.com/c/chromium/src/+/7277276 :-)

      Andrzej Fiedukowicz

      Yeah, and we actually do support and even have multiple of those already, it was just not added to this utils code leading to unexpected results 😊

      File tools/metrics/actions/action_utils_test.py
      Line 24, Patchset 17: variants_name = f"TypeOf{token.key}"
      Luc Nguyen . resolved

      nit: what's the purpose of this "TypeOf" prefix?

      Andrzej Fiedukowicz

      To not pass the test when the strings gets crossed and we pass Token name as its type or the other way around.

      File tools/metrics/actions/extract_actions.py
      Line 662, Patchset 17: logging.error(

      f'The variants attribute {variants_name} of token key {token_key} '
      f'of action {action_name} does not have a corresponding '
      f'<variants> tag.')
      Luc Nguyen . resolved

      should this be fatal? since we're now accessing `variants_dict[variants_name]` below

      Andrzej Fiedukowicz

      Good point, done!

      File tools/metrics/actions/extract_actions_test.py
      Line 232, Patchset 17: return extract_actions.PrettyPrint(actions_dict | expanded_actions,
      Luc Nguyen . resolved

      nit: is the `|` necessary? i see in `CreateActionsFromVariants()` that we leave the actions that don't need expanding untouched:

      ```python
      # If there are no tokens to fill, the action goes to the list as-is.
      if not action.tokens:
      expanded_actions[action.name] = action
      ```
      Andrzej Fiedukowicz

      It's for backward compatibility, as the test wants the unexpanded tokens to be in the output. See: BASIC_VARIANT_EXPANDED_XML.

      I think it's a test that doesn't test anything real though. I will review those tests in separate CLs to not mix up to many things here.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Alexei Svitkine
      • Alicja Opalinska
      • Luc Nguyen
      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: I2d0e4e8086c39ed7a0f48d5713a55ba549a5022a
        Gerrit-Change-Number: 7280929
        Gerrit-PatchSet: 18
        Gerrit-Owner: Andrzej Fiedukowicz <af...@google.com>
        Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
        Gerrit-Reviewer: Alicja Opalinska <aopal...@google.com>
        Gerrit-Reviewer: Andrzej Fiedukowicz <af...@google.com>
        Gerrit-Reviewer: Luc Nguyen <lucn...@google.com>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
        Gerrit-CC: Gleb Nikolaev <gnik...@chromium.org>
        Gerrit-Attention: Alicja Opalinska <aopal...@google.com>
        Gerrit-Attention: Luc Nguyen <lucn...@google.com>
        Gerrit-Attention: Alexei Svitkine <asvi...@chromium.org>
        Gerrit-Comment-Date: Thu, 08 Jan 2026 09:40:50 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Luc Nguyen <lucn...@google.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Luc Nguyen (Gerrit)

        unread,
        Jan 8, 2026, 10:59:47 AM (5 days ago) Jan 8
        to Andrzej Fiedukowicz, Chromium LUCI CQ, Alexei Svitkine, Code Review Nudger, Alicja Opalinska, Gleb Nikolaev, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, asvitkine...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com
        Attention needed from Alexei Svitkine, Alicja Opalinska and Andrzej Fiedukowicz

        Luc Nguyen voted and added 3 comments

        Votes added by Luc Nguyen

        Code-Review+1

        3 comments

        File tools/metrics/actions/action_utils_test.py
        Line 24, Patchset 17: variants_name = f"TypeOf{token.key}"
        Luc Nguyen . unresolved

        nit: what's the purpose of this "TypeOf" prefix?

        Andrzej Fiedukowicz

        To not pass the test when the strings gets crossed and we pass Token name as its type or the other way around.

        Luc Nguyen

        can you add a comment?

        File tools/metrics/actions/extract_actions.py
        Line 662, Patchset 17: logging.error(
        f'The variants attribute {variants_name} of token key {token_key} '
        f'of action {action_name} does not have a corresponding '
        f'<variants> tag.')
        Luc Nguyen . unresolved

        should this be fatal? since we're now accessing `variants_dict[variants_name]` below

        Andrzej Fiedukowicz

        Good point, done!

        Luc Nguyen

        sorry, i said fatal, but i meant more generally that the script shouldn't proceed further down -- e.g. i see that the other errors above simply `continue`

        File tools/metrics/actions/extract_actions_test.py
        Line 232, Patchset 17: return extract_actions.PrettyPrint(actions_dict | expanded_actions,
        Luc Nguyen . resolved

        nit: is the `|` necessary? i see in `CreateActionsFromVariants()` that we leave the actions that don't need expanding untouched:

        ```python
        # If there are no tokens to fill, the action goes to the list as-is.
        if not action.tokens:
        expanded_actions[action.name] = action
        ```
        Andrzej Fiedukowicz

        It's for backward compatibility, as the test wants the unexpanded tokens to be in the output. See: BASIC_VARIANT_EXPANDED_XML.

        I think it's a test that doesn't test anything real though. I will review those tests in separate CLs to not mix up to many things here.

        Luc Nguyen

        ah gotcha, sg

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Alexei Svitkine
        • Alicja Opalinska
        • Andrzej Fiedukowicz
        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: I2d0e4e8086c39ed7a0f48d5713a55ba549a5022a
          Gerrit-Change-Number: 7280929
          Gerrit-PatchSet: 22
          Gerrit-Owner: Andrzej Fiedukowicz <af...@google.com>
          Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
          Gerrit-Reviewer: Alicja Opalinska <aopal...@google.com>
          Gerrit-Reviewer: Andrzej Fiedukowicz <af...@google.com>
          Gerrit-Reviewer: Luc Nguyen <lucn...@google.com>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
          Gerrit-CC: Gleb Nikolaev <gnik...@chromium.org>
          Gerrit-Attention: Alicja Opalinska <aopal...@google.com>
          Gerrit-Attention: Alexei Svitkine <asvi...@chromium.org>
          Gerrit-Attention: Andrzej Fiedukowicz <af...@google.com>
          Gerrit-Comment-Date: Thu, 08 Jan 2026 15:59:32 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Luc Nguyen <lucn...@google.com>
          Comment-In-Reply-To: Andrzej Fiedukowicz <af...@google.com>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Andrzej Fiedukowicz (Gerrit)

          unread,
          Jan 8, 2026, 11:10:37 AM (5 days ago) Jan 8
          to Luc Nguyen, Chromium LUCI CQ, Alexei Svitkine, Code Review Nudger, Alicja Opalinska, Gleb Nikolaev, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, asvitkine...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com
          Attention needed from Alexei Svitkine, Alicja Opalinska and Luc Nguyen

          Andrzej Fiedukowicz added 2 comments

          File tools/metrics/actions/action_utils_test.py
          Line 24, Patchset 17: variants_name = f"TypeOf{token.key}"
          Luc Nguyen . resolved

          nit: what's the purpose of this "TypeOf" prefix?

          Andrzej Fiedukowicz

          To not pass the test when the strings gets crossed and we pass Token name as its type or the other way around.

          Luc Nguyen

          can you add a comment?

          Andrzej Fiedukowicz

          Done

          File tools/metrics/actions/extract_actions.py
          Line 662, Patchset 17: logging.error(
          f'The variants attribute {variants_name} of token key {token_key} '
          f'of action {action_name} does not have a corresponding '
          f'<variants> tag.')
          Luc Nguyen . resolved

          should this be fatal? since we're now accessing `variants_dict[variants_name]` below

          Andrzej Fiedukowicz

          Good point, done!

          Luc Nguyen

          sorry, i said fatal, but i meant more generally that the script shouldn't proceed further down -- e.g. i see that the other errors above simply `continue`

          Andrzej Fiedukowicz

          I actually replace it in later CL with exception, so I hope it's fine for now to simplify things.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alexei Svitkine
          • Alicja Opalinska
          • Luc Nguyen
          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: I2d0e4e8086c39ed7a0f48d5713a55ba549a5022a
            Gerrit-Change-Number: 7280929
            Gerrit-PatchSet: 24
            Gerrit-Owner: Andrzej Fiedukowicz <af...@google.com>
            Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
            Gerrit-Reviewer: Alicja Opalinska <aopal...@google.com>
            Gerrit-Reviewer: Andrzej Fiedukowicz <af...@google.com>
            Gerrit-Reviewer: Luc Nguyen <lucn...@google.com>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
            Gerrit-CC: Gleb Nikolaev <gnik...@chromium.org>
            Gerrit-Attention: Alicja Opalinska <aopal...@google.com>
            Gerrit-Attention: Luc Nguyen <lucn...@google.com>
            Gerrit-Attention: Alexei Svitkine <asvi...@chromium.org>
            Gerrit-Comment-Date: Thu, 08 Jan 2026 16:10:24 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Luc Nguyen (Gerrit)

            unread,
            Jan 8, 2026, 12:29:04 PM (5 days ago) Jan 8
            to Andrzej Fiedukowicz, Chromium LUCI CQ, Alexei Svitkine, Code Review Nudger, Alicja Opalinska, Gleb Nikolaev, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, asvitkine...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com
            Attention needed from Alexei Svitkine, Alicja Opalinska and Andrzej Fiedukowicz

            Luc Nguyen voted Code-Review+1

            Code-Review+1
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Alexei Svitkine
            • Alicja Opalinska
            • Andrzej Fiedukowicz
            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: I2d0e4e8086c39ed7a0f48d5713a55ba549a5022a
              Gerrit-Change-Number: 7280929
              Gerrit-PatchSet: 24
              Gerrit-Owner: Andrzej Fiedukowicz <af...@google.com>
              Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
              Gerrit-Reviewer: Alicja Opalinska <aopal...@google.com>
              Gerrit-Reviewer: Andrzej Fiedukowicz <af...@google.com>
              Gerrit-Reviewer: Luc Nguyen <lucn...@google.com>
              Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
              Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
              Gerrit-CC: Gleb Nikolaev <gnik...@chromium.org>
              Gerrit-Attention: Alicja Opalinska <aopal...@google.com>
              Gerrit-Attention: Alexei Svitkine <asvi...@chromium.org>
              Gerrit-Attention: Andrzej Fiedukowicz <af...@google.com>
              Gerrit-Comment-Date: Thu, 08 Jan 2026 17:28:55 +0000
              Gerrit-HasComments: No
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Andrzej Fiedukowicz (Gerrit)

              unread,
              Jan 12, 2026, 3:52:51 AM (yesterday) Jan 12
              to Luc Nguyen, Chromium LUCI CQ, Alexei Svitkine, Code Review Nudger, Alicja Opalinska, Gleb Nikolaev, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, asvitkine...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com
              Attention needed from Alexei Svitkine and Alicja Opalinska

              Andrzej Fiedukowicz added 1 comment

              Patchset-level comments
              File-level comment, Patchset 25 (Latest):
              Andrzej Fiedukowicz . resolved

              @asvi...@chromium.org - kind ping 🙏

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Alexei Svitkine
              • Alicja Opalinska
              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: I2d0e4e8086c39ed7a0f48d5713a55ba549a5022a
              Gerrit-Change-Number: 7280929
              Gerrit-PatchSet: 25
              Gerrit-Owner: Andrzej Fiedukowicz <af...@google.com>
              Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
              Gerrit-Reviewer: Alicja Opalinska <aopal...@google.com>
              Gerrit-Reviewer: Andrzej Fiedukowicz <af...@google.com>
              Gerrit-Reviewer: Luc Nguyen <lucn...@google.com>
              Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
              Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
              Gerrit-CC: Gleb Nikolaev <gnik...@chromium.org>
              Gerrit-Attention: Alicja Opalinska <aopal...@google.com>
              Gerrit-Attention: Alexei Svitkine <asvi...@chromium.org>
              Gerrit-Comment-Date: Mon, 12 Jan 2026 08:52:34 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Alexei Svitkine (Gerrit)

              unread,
              Jan 12, 2026, 10:11:00 AM (20 hours ago) Jan 12
              to Andrzej Fiedukowicz, Luc Nguyen, Chromium LUCI CQ, Code Review Nudger, Alicja Opalinska, Gleb Nikolaev, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, asvitkine...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com
              Attention needed from Alicja Opalinska and Andrzej Fiedukowicz

              Alexei Svitkine voted

              Code-Review+1
              Commit-Queue+2
              Open in Gerrit

              Related details

              Attention is currently required from:
              • Alicja Opalinska
              • Andrzej Fiedukowicz
              Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement satisfiedCode-Owners
                • requirement 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: I2d0e4e8086c39ed7a0f48d5713a55ba549a5022a
                Gerrit-Change-Number: 7280929
                Gerrit-PatchSet: 25
                Gerrit-Owner: Andrzej Fiedukowicz <af...@google.com>
                Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
                Gerrit-Reviewer: Alicja Opalinska <aopal...@google.com>
                Gerrit-Reviewer: Andrzej Fiedukowicz <af...@google.com>
                Gerrit-Reviewer: Luc Nguyen <lucn...@google.com>
                Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
                Gerrit-CC: Gleb Nikolaev <gnik...@chromium.org>
                Gerrit-Attention: Alicja Opalinska <aopal...@google.com>
                Gerrit-Attention: Andrzej Fiedukowicz <af...@google.com>
                Gerrit-Comment-Date: Mon, 12 Jan 2026 15:10:49 +0000
                Gerrit-HasComments: No
                Gerrit-Has-Labels: Yes
                satisfied_requirement
                open
                diffy

                Chromium LUCI CQ (Gerrit)

                unread,
                Jan 12, 2026, 11:05:14 AM (19 hours ago) Jan 12
                to Andrzej Fiedukowicz, Alexei Svitkine, Luc Nguyen, Code Review Nudger, Alicja Opalinska, Gleb Nikolaev, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, asvitkine...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com

                Chromium LUCI CQ submitted the change

                Change information

                Commit message:
                Improve and simplify API and impl of action_utils

                The API of action_utils was error prone with in place modification
                of the passed object. Instead it got refactored to operate by return
                value making it clear which objects are expected in it.

                Additionally the logic was simplified significantly and number of
                arguments to functions reduced.

                This still doesn't work for more then one token in action, but this
                will be fixed in the next CL.

                TESTED=Newly added tests are passing
                Change-Id: I2d0e4e8086c39ed7a0f48d5713a55ba549a5022a
                Reviewed-by: Luc Nguyen <lucn...@google.com>
                Reviewed-by: Alexei Svitkine <asvi...@chromium.org>
                Commit-Queue: Alexei Svitkine <asvi...@chromium.org>
                Cr-Commit-Position: refs/heads/main@{#1567786}
                Files:
                • M tools/metrics/actions/action_utils.py
                • A tools/metrics/actions/action_utils_test.py
                • M tools/metrics/actions/extract_actions.py
                • M tools/metrics/actions/extract_actions_test.py
                Change size: M
                Delta: 4 files changed, 164 insertions(+), 42 deletions(-)
                Branch: refs/heads/main
                Submit Requirements:
                • requirement satisfiedCode-Review: +1 by Alexei Svitkine, +1 by Luc Nguyen
                Open in Gerrit
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: merged
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I2d0e4e8086c39ed7a0f48d5713a55ba549a5022a
                Gerrit-Change-Number: 7280929
                Gerrit-PatchSet: 26
                Gerrit-Owner: Andrzej Fiedukowicz <af...@google.com>
                Gerrit-Reviewer: Alexei Svitkine <asvi...@chromium.org>
                Gerrit-Reviewer: Alicja Opalinska <aopal...@google.com>
                Gerrit-Reviewer: Andrzej Fiedukowicz <af...@google.com>
                Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
                Gerrit-Reviewer: Luc Nguyen <lucn...@google.com>
                open
                diffy
                satisfied_requirement
                Reply all
                Reply to author
                Forward
                0 new messages