[PSA] Changes in presubmit API

0 views
Skip to first unread message

'Josip Sokcevic' via infra-announce

unread,
Jul 21, 2020, 2:54:50 PM7/21/20
to infra-a...@chromium.org

Hi all,


tl;dr Please update your PRESUBMIT checks to use the new API parameters by September 15th.


In order to align with Inclusive Chromium Code, we recently added inclusive parameters to our presubmit API. Note that old parameter names are still available, but we plan to remove them by the end of Q3 2020. We will start issuing warnings when old parameters are used in early August.


Here is overview of relevant changes (diff input_api, diff canned_checks):


Changes in constant names

input_api.DEFAULT_ALLOW_LIST -> input_api.DEFAULT_FILES_TO_CHECK

input_api.DEFAULT_BLACK_LIST -> input_api.DEFAULT_FILES_TO_SKIP


Changes in named parameters

input_api.FilterSourceFile, white_list -> files_to_check, black_list -> files_to_skip

input_api.canned_checks.GetUnitTestsInDirectory, whitelist -> files_to_check, blacklist -> files_to_skip

input_api.canned_checks.GetUnitTestsRecursively, whitelist -> files_to_check, blacklist -> files_to_skip

input_api.canned_checks.GetPylint, white_list -> files_to_check, black_list -> files_to_skip


- Chops source team

--
You received this message because you are subscribed to the Google Groups "infra-announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to infra-announc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/infra-announce/CAJiyOihEA96LVOzbt58zT06t932_PJ1%2Bo%3DTj7MjOfZ2%2Bgze%3DPQ%40mail.gmail.com.

'Josip Sokcevic' via infra-announce

unread,
Aug 3, 2020, 5:35:44 PM8/3/20
to infra-a...@chromium.org
Hi all,

The warning will be implemented in the next few weeks. To make the transition easier, you can execute attached bash script in repositories that your team owns. Note that the script is very basic and may produce undesired results so double check them.

#!/bin/bash
set -e

# Find potential usages
files=$(git grep -w -l \
  -e DEFAULT_ALLOW_LIST \
  -e DEFAULT_BLACK_LIST \
  -e DEFAULT_BLOCK_LIST \
  -e DEFAULT_WHITE_LIST \
  -e DEFAULT_WHITE_LIST \
  -e DEFAULT_WHITE_LIST \
  -e FilterSourceFile \
  -e GetUnitTestsInDirectory \
  -e GetUnitTestsRecursively \
  -e GetPylint)

for f in $files; do
  echo "Processing file $f"
  sed -i \
    -e 's/DEFAULT_ALLOW_LIST/DEFAULT_FILES_TO_CHECK/g' \
    -e 's/DEFAULT_WHITE_LIST/DEFAULT_FILES_TO_CHECK/g' \
    -e 's/DEFAULT_BLACK_LIST/DEFAULT_FILES_TO_SKIP/g' \
    -e 's/DEFAULT_BLOCK_LIST/DEFAULT_FILES_TO_SKIP/g' \
    -e 's/\bwhite_list\b/files_to_check/g' \
    -e 's/\bwhitelist\b/files_to_check/g' \
    -e 's/\bblack_list\b/files_to_skip/g' \
    -e 's/\bblacklist\b/files_to_skip/g' \
    $f
done


On Tue, Jul 21, 2020 at 11:54 AM Josip Sokcevic <sokc...@google.com> wrote:

Hi all,


tl;dr Please update your PRESUBMIT checks to use the new API parameters by September 15th.


In order to align with Inclusive Chromium Code, we recently added inclusive parameters to our presubmit API. Note that old parameter names are still available, but we plan to remove them by the end of Q3 2020. We will start issuing warnings when old parameters are used in early August.


Here is overview of relevant changes (diff input_api, diff canned_checks):


Changes in constant names

input_api.DEFAULT_ALLOW_LIST -> input_api.DEFAULT_FILES_TO_CHECK

input_api.DEFAULT_BLACK_LIST -> input_api.DEFAULT_FILES_TO_SKIP


Changes in named parameters

input_api.FilterSourceFile, white_list -> files_to_check, black_list -> files_to_skip

input_api.canned_checks.GetUnitTestsInDirectory, whitelist -> files_to_check, blacklist -> files_to_skip

input_api.canned_checks.GetUnitTestsRecursively, whitelist -> files_to_check, blacklist -> files_to_skip

input_api.canned_checks.GetPylint, white_list -> files_to_check, black_list -> files_to_skip


- Chops source team



--
Josip Sokcevic

--
You received this message because you are subscribed to the Google Groups "infra-announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to infra-announc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/infra-announce/CAJiyOiiMO95h8Y%2BE4uy6%2Bk9FUWb21so4mNxKR%3D1Q9geufCxERQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages