You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
depot_tools/tests
Scott Lee f88b25b610 Reland "presubmit: emit errors instead of warnings for bad copyright headers"
This reverts commit eb60ab38de.

Reason for revert: re-landing with an additional patch

-------------
* Problem
Browser infra runs ci.*-presubmit builders, such as linux-presubmit,
with --all to ensure that the entire chromium/src passes
presubmit checks.

crrev.com/c/6842238 changed the finding type for License Check
from warning to error, but the CI presubmit builders failed because
there are many files without valid CopyRight.

Not only the existing files, all the new files that are added with
`Bypass-Check-License: <reason> footer could also cause the presubmit
builder to fail.

* This CL

In addition to the original patch from crrev.com/c/6842238,
this CL makes additional patches to turn the CopyRight errors into
warnings, if --file or --all is given.

The same approach is used in
https://source.chromium.org/chromium/chromium/tools/depot_tools/+/main:presubmit_canned_checks.py;l=982-987;drc=eb60ab38deeda6975c9b0fef883978f2a9f69120


Bug: 435696543,40237859
Original change's description:
> Revert "presubmit: emit errors instead of warnings for bad copyright headers"
>
> This reverts commit fa62515ecb.
>
> Reason for revert: it seems that the existing files without valid copyright headers are causing linux-presubmit builds to fail. b/438791294
>
> Bug: 435696543,40237859
> Original change's description:
> > presubmit: emit errors instead of warnings for bad copyright headers
> >
> > This is an effective revert of https://crrev.com/c/4895337 with
> > additional patches to support a footer.
> >
> > https://crrev.com/c/3887721 updated CheckLicense() to emit errors
> > for bad copyright headers. However, https://crrev.com/c/4895337
> > was changed the finding type from error to warning, claiming that
> > the check is N/A for moved third files, but it's not so easy
> > to programatiically distinguish moved third-party files.
> >
> > After discussions, it was decided to change the finding type back
> > to error to prevent accidental submissions for new files without
> > correct CopyRight headers.
> >
> > To mitigate moved, third-party files, this CL adds support for
> > "Bypass-Check-License: <reason>" footer.
> >
> > If the check should be ignored in a given CL, CL authors should
> > use the footer instead.
> >
> > Bug: 435696543,40237859
> > Change-Id: I177915c65932a3d76ea60ee6a0e396f726bc400d
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6842238
> > Reviewed-by: Gavin Mak <gavinmak@google.com>
> > Commit-Queue: Scott Lee <ddoman@chromium.org>
>
> Bug: 435696543,40237859
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Change-Id: Ibedf8d13e3742249947e29e625a14cceaf89879c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6852377
> Commit-Queue: Scott Lee <ddoman@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Gavin Mak <gavinmak@google.com>

Bug: 435696543,40237859
Change-Id: Iafdb29b928c016eb3949e29fd43a2ba5f53e0ba0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6852108
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Scott Lee <ddoman@chromium.org>
3 months ago
..
gerrit_util_test.inputs
git_common_test.inputs
gstools
split_cl_test.inputs `git cl split`: Save and load splittings from files 9 months ago
OWNERS
auth_test.py
autoninja_test.py autoninja: disable siso native by --reapi_address= 5 months ago
bazel_test.py
bot_update_coverage_test.py
build_telemetry_test.py
cipd_bootstrap_test.py
create_temp_file_test.py depot_tools: add create_temp_file.py 4 months ago
detect_host_arch_test.py
download_from_google_storage_unittest.py
fetch_test.py
gclient_cipd_smoketest.py
gclient_eval_unittest.py
gclient_gcs_smoketest.py
gclient_git_mutates_smoketest.py
gclient_git_smoketest.py
gclient_no_sync_smoketest.py
gclient_paths_test.py
gclient_scm_test.py Make sure _UpdateMirrorIfNotContains fetches the specified revision 7 months ago
gclient_smoketest.py
gclient_smoketest_base.py
gclient_test.py
gclient_transitions_smoketest.py
gclient_utils_test.py
gerrit_client_test.py
gerrit_util_test.py [gerrit_util] Add CheckShouldUseSSO function 8 months ago
git_auth_test.py [git_auth] Add useHttpPath config for Gerrit auth 3 months ago
git_cache_test.py
git_cl_creds_check_report.txt
git_cl_test.py Remove support for RobotComments, which have been removed from Gerrit. 5 months ago
git_common_test.py Modify git squash-branch to perform reparenting 9 months ago
git_dates_test.py
git_find_releases_test.py
git_footers_test.py
git_hyper_blame_test.py
git_map_test.py Fix git_map_test.py 8 months ago
git_number_test.py
git_rebase_update_test.py Colorize branch names for rebase-update 9 months ago
git_squash_branch_test.py Modify git squash-branch to perform reparenting 9 months ago
git_squash_branch_tree_test.py
gn_helper_test.py
gsutil_test.py Improve ensure_gsutil reliability 7 months ago
hooks_test.py
lockfile_test.py
luci_auth_fido2_plugin_test.py Add luci-auth-fido2-plugin 3 months ago
metrics_test.py
metrics_xml_format_test.py
my_activity_test.py
ninjalog_uploader_test.py
owners_client_test.py Select a minimal number of owners for a set of files 8 months ago
owners_finder_test.py
presubmit_canned_checks_test.py CheckNewDEPSHooksHasRequiredReviewers checks approval from required 8 months ago
presubmit_diff_test.py
presubmit_support_test.py presubmit: add location data to presubmit result 7 months ago
presubmit_unittest.py Reland "presubmit: emit errors instead of warnings for bad copyright headers" 3 months ago
rdb_wrapper_test.py
recipes_test.py
reclient_helper_test.py
roll_dep_test.py Change readme updating to be on by default for roll_dep.py 6 months ago
roll_downstream_gcs_deps_test.py
scm_mock.py
scm_unittest.py
split_cl_test.py split: update SelectReviewersForFiles to work with repository root 7 months ago
subcommand_test.py
subprocess2_test.py
upload_to_google_storage_first_class_unittest.py
upload_to_google_storage_unittest.py
utils_test.py
watchlists_unittest.py