This is tricky, because std::ranges::view is allowed but is a prefix of
std::ranges::views, which was causing std::ranges::views to also be
treated as allowed.
Change-Id: I632bb34757ee5776efbc1fe03a9d3e2d72cc084f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6507488
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1456412}
This attaches file location data to each violation of the
IS_DESKTOP_ANDROID ban rule. This data will then be consumed by the
presubmit bots and plumbed to ayeaye to expose the ban rule violation
as a gerrit lint comment, eg:
http://screen/5dcPwjNrtizEVBK
Violations of ban rules that are warning-only are currently only
exposed to the author at git-cl-upload time, and can be ignored. These
lint comments should surface them to reviewers as well, and are harder
to ignore. Similar to current lint comments, they shouldn't be
blocking unless a reviewer clicks "please fix".
The location data plumbing currently supports the specific columns
in each line that contain the violation. We forgo specifying that
extra detail here, and simply flag the entire line as a violation.
This is simply due to laziness around the regex handling of BanRule's
current implementation. Can add that extra location data in a
follow-up if desired.
Bug: 403341439
Change-Id: Id99d3a014ce59d5de34df18ff1b6cb48ff7f7736
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6480470
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1450737}
Before this change we have the extensions::mojom::ExtensionId struct to
validate messages that pass the extensions::ExtensionId string across
mojom. However, we have not way of enforcing new method or reverts
removing that the mojom struct.
After this chang we have some prevention at review time by causing
presubmit warnings when they occur.
Bug: 401499254
Change-Id: I18e5f1b6331346134a0dd0795d80534dbec2ede0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6422689
Feels: Justin Lulejian <jlulejian@chromium.org>
Auto-Submit: Justin Lulejian <jlulejian@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Justin Lulejian <jlulejian@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1441214}
Doing a simpler check, not trying to figure out if the annotation is in the class declaration or on a method declaration. It would be
very rare for a method to be annotation and not the class.
This reverts commit ae8498e751.
Reason for revert: Fixed version
Original change's description:
> Revert "Add _CheckAndroidNullAwayAnnotatedClasses PRESUBMIT check"
>
> This reverts commit cfe861e365.
>
> Reason for revert: Doesn't ignore comments
>
> Original change's description:
> > Add _CheckAndroidNullAwayAnnotatedClasses PRESUBMIT check
> >
> > Warn when a .java file is missing @NullMarked and @NullUnmarked.
> >
> > Temporarily disabled in //android_webview and //chrome while migrating.
> >
> > Bug: 404884589
> > Change-Id: I38e331bcec6f3a3f2147c0999fd4dca8fef145d5
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6373892
> > Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
> > Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1435461}
>
> Bug: 404884589
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Change-Id: I669658f3f21cab9365f0c50b4e0191a1e6a608a0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6377728
> Auto-Submit: Henrique Nakashima <hnakashima@chromium.org>
> Commit-Queue: Andrew Grieve <agrieve@chromium.org>
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1435593}
Bug: 404884589
Change-Id: I11d0ed28bf1941e72df5dcc457fb9d7e62dc89ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6381838
Auto-Submit: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1436182}
Warn when a .java file is missing @NullMarked and @NullUnmarked.
Temporarily disabled in //android_webview and //chrome while migrating.
Bug: 404884589
Change-Id: I38e331bcec6f3a3f2147c0999fd4dca8fef145d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6373892
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1435461}
No change to production behavior. This adds a presubmit check for
IS_DESKTOP_ANDROID. The goal is to confine use of this value to chrome/
layer and other higher layers, but to ban this in content/ layer and
below.
This has "warning" status only so that it can be bypassed in case of
false positive, however the intention is that generally
IS_DESKTOP_ANDROID should only live in higher layers.
Fixed: 401628399
Test: vpython3 PRESUBMIT_test.py
Change-Id: Ice010be105a476100acf5cf70a3d262228916c33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6336803
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1431159}
The check prompted to add an assert(is_chromeos_ash) if not present.
Since we are going to remove is_chromeos_ash in favor of is_chromeos
(due to Lacros removal), change the check to allow both flags and
change the error message so that it mentions is_chromeos.
Also fix an issue in the tests. They were using mock files of the same
name, so only the first one was actually used.
Bug: 373971535
Change-Id: I0510a23df5fc61ac8d4327df1835f9c84bf64392
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5951185
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1371890}
This reverts commit 74e5e087cb.
Reason for reland: Fixed blink & webapk presubmit tests
Original change's description:
> Revert "Improve mocking of os_path.exists() in PRESUBMIT_test.py"
>
> This reverts commit b35a9a9465.
>
> Reason for revert: Manual bisect shows that this is responsible for failures starting in https://ci.chromium.org/ui/p/chromium/builders/ci/linux-presubmit/19822/blamelist. Local repro on Linux: `vpython3 chrome/android/webapk/PRESUBMIT_test.py --verbose`
>
> Original change's description:
> > Improve mocking of os_path.exists() in PRESUBMIT_test.py
> >
> > I need this for an upcoming change, but it turns out it found 2 real
> > bugs:
> > * A .pydeps check that would never be hit due to test mocks returning
> > that deleted files exist
> > * A translations check that would never be hit due to test mocks using
> > local paths when absolute paths were requested.
> >
> > Bug: None
> > Change-Id: I920e4f67b2ff1193b89c7abfd9664d14a94c44bf
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5910106
> > Reviewed-by: Ted Choc <tedchoc@chromium.org>
> > Commit-Queue: Andrew Grieve <agrieve@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1364918}
>
> Bug: None
> Change-Id: Ibcc1931e5709d1a4209e56211595df8b94a35c9a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5913697
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
> Owners-Override: Łukasz Anforowicz <lukasza@chromium.org>
> Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1364999}
Bug: None
Change-Id: I303d4d1abc685e3bad854e9a5ebe8ae2efe48869
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5912982
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Owners-Override: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1365664}
I need this for an upcomping change, but it turns out it found 2 real
bugs:
* A .pydeps check that would never be hit due to test mocks returning
that deleted files exist
* A translations check that would never be hit due to test mocks using
local paths when absolute paths were requested.
Bug: None
Change-Id: I920e4f67b2ff1193b89c7abfd9664d14a94c44bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5910106
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1364918}
Skipping the presubmit, because ironically enough, PRESUBMIT.py and
PRESUBMIT_test.py trigger a number of pre-existing presubmit violations.
No-Presubmit: true
Change-Id: I9aabeb8496a0582d6cb92af90db4ef3b32f70b04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5668998
Reviewed-by: Steinar H Gunderson <sesse@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1321358}
When a new DEP is added, the presubmit check enforces reviews from
the owner of the additional DEP. However, when the DEP is from another
repo, the enforcement becomes trickier especially it is from a different
host.
This patch disables the check if a newly added DEP is from a submodule.
Change-Id: Id7c2feac005c1c769313dedb254d5a0b641ff68b
Bug: 324496840
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5656359
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Scott Lee <ddoman@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1320079}
We intend to exclude only a handful specific sub-directories (for perf
reasons). This CL removes the broad exclusions from the rewriter and
the enforcing clang plugin.
There is a risk that by the time the plugin rolls into Chromium,
someone will add a raw pointer, which will cause the plugin
to error out and block the roll-out. Therefore, add those broad
exclusions into BUILD.gn temporarily -- they'll be removed after
the plugin rolls, once we confirm that all pointers in those
directories are properly rewritten.
In other words, this CL doesn't change the clang plugin enforcement
behavior.
Bug: 40064499, 331846123
Change-Id: Ia95e8df846d167521a5ac43cc63e556002702ee9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5600329
Auto-Submit: Bartek Nowierski <bartekn@chromium.org>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Bartek Nowierski <bartekn@chromium.org>
Reviewed-by: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1312344}
This reverts commit 367476a325.
Reason for revert: Causing presubmit bot failures. See b/345023320, or ask battre@ for more information.
Original change's description:
> [PRESUBMIT] Check if files are written to a dep dir
>
> No files should be written to a directory that's used by CIPD or GCS, as
> defined in DEPS. Git already doesn't allow files to be written to a
> directory that's a gitlink.
>
> Bug: 343199633
> Change-Id: Ica929b7c6e5ca84082f24343869014e9eccfde58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5578422
> Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
> Reviewed-by: Joanna Wang <jojwang@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1310264}
Bug: 343199633
Change-Id: Idab125b2a0e2a7c673927ba6be4627c7ecb3fbe6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5598862
Owners-Override: Bret Sepulveda <bsep@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1310492}
Allow files to be renamed while keeping the same sha256.
The previous version of the presubmit fails when we try to do this as it checks that when a file is removed, the matching hash is also removed from the DEPS file. In the case of renaming the hash stays the same and we want to explicitly allow this.
Change-Id: Iedb384858d45f078b04740b2937650061af1d861
Bug: 312895063
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5575129
Commit-Queue: Rasika Navarange <rasikan@google.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1309836}
We need to move the .sha256 files to a separate directory to the actual
test data. This is because Cog does not support contents of a directory
coming from multiple sources i.e. both Git and GCS. So we need a
separate directory for files coming from GCS from the files coming from
Git.
Change-Id: I16fee14405a2b4faee842e01dd1e94ed2ccf0eec
Bug: 312895063
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5582049
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Rasika Navarange <rasikan@google.com>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1308600}
NATIVE_WIDGET_OWNS_WIDGET
We are refactoring Views code with an eye towards changing the ownership model of widgets to CLIENT_OWNS_WIDGET as the only ownership model. This will warn developers when they are landing code using one of these two ownership models.
Change-Id: I77c8911d3ab5669fb6f148a650465c4f43e2d09b
Bug: 339619005
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5577858
Commit-Queue: Allen Bauer <kylixrd@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/main@{#1306988}
This is a reland of commit 6c8f992499
This reland adds the deps entry for chrome_5672_histograms.pftrace.gz
which was missing in the original CL, causing b/342182426 which caused
the original CL to be reverted.
Original change's description:
> [Chrome Stdlib] Use DEPS to download diff test data
>
> We want to download Perfetto test data via GCS dependencies in DEPS
> rather than Perfetto's test_data script. To make this change we:
>
> 1. Modify the test_data.py script to wrap
> `upload_to_google_storage_first_class.py` instead of Perfetto's
> `test_data` script.
> 2. Add a Presubmit check to ensure the .sha256 files are in sync with
> the deps entries.
> 3. Update docs to give instructions for the new workflow
>
> Change-Id: I20616c95553f93603e338dd9fa47e84facfb60d8
> Bug: 312895063
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5545295
> Reviewed-by: Stephen Nusko <nuskos@chromium.org>
> Commit-Queue: Rasika Navarange <rasikan@google.com>
> Reviewed-by: Dominic Battre <battre@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1304407}
Bug: 312895063
Change-Id: I6bcd74324612e5c49ae59bee3f0b20f673d70b81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5562906
Reviewed-by: Dominic Battre <battre@chromium.org>
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Commit-Queue: Rasika Navarange <rasikan@google.com>
Cr-Commit-Position: refs/heads/main@{#1305095}
This reverts commit 6c8f992499.
Reason for revert: b/342182426
Original change's description:
> [Chrome Stdlib] Use DEPS to download diff test data
>
> We want to download Perfetto test data via GCS dependencies in DEPS
> rather than Perfetto's test_data script. To make this change we:
>
> 1. Modify the test_data.py script to wrap
> `upload_to_google_storage_first_class.py` instead of Perfetto's
> `test_data` script.
> 2. Add a Presubmit check to ensure the .sha256 files are in sync with
> the deps entries.
> 3. Update docs to give instructions for the new workflow
>
> Change-Id: I20616c95553f93603e338dd9fa47e84facfb60d8
> Bug: 312895063
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5545295
> Reviewed-by: Stephen Nusko <nuskos@chromium.org>
> Commit-Queue: Rasika Navarange <rasikan@google.com>
> Reviewed-by: Dominic Battre <battre@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1304407}
Bug: 312895063
Change-Id: I07872d3e5bdc550a6795197d396c11dadbbd3a3d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5558666
Commit-Queue: Zachary Tan <tanzachary@chromium.org>
Auto-Submit: Rasika Navarange <rasikan@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Zachary Tan <tanzachary@chromium.org>
Owners-Override: Zachary Tan <tanzachary@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1304506}
We want to download Perfetto test data via GCS dependencies in DEPS
rather than Perfetto's test_data script. To make this change we:
1. Modify the test_data.py script to wrap
`upload_to_google_storage_first_class.py` instead of Perfetto's
`test_data` script.
2. Add a Presubmit check to ensure the .sha256 files are in sync with
the deps entries.
3. Update docs to give instructions for the new workflow
Change-Id: I20616c95553f93603e338dd9fa47e84facfb60d8
Bug: 312895063
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5545295
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Commit-Queue: Rasika Navarange <rasikan@google.com>
Reviewed-by: Dominic Battre <battre@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1304407}
Presubmit was preventing upload of crrev.com/c/5534806 due to changed
line:
` std::unique_ptr<WebAppInstallInfo>>(`
being interpreted as a call to the unique_ptr constructor. IIUC this was
because the check only looks at the changed lines and missed the extra
">" indicating this was really part of a larger template expression.
Added a condition that suppresses the check when selected brackets are
mismatching (ie. number of < and > are not equal). Added tests for these
cases.
Change-Id: I260b7826eb1f55764a8a93b3402888afa5032eed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5538411
Reviewed-by: Dirk Pranke <dpranke@google.com>
Auto-Submit: Glen Robertson <glenrob@chromium.org>
Commit-Queue: Glen Robertson <glenrob@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1301700}
This is an automated #cleanup patch.
Migrate:
- from BUILDFLAG (legacy chromium macro)
- to PA_BUILDFLAG (new partition_alloc macro)
The first is going to be removed in favor of the second.
The previous patch modified every occurrences inside partition_alloc,
this one does the same, but outside of partition_alloc.
Follow-ups will:
- Update dawn.
- Update pdfium.
Bug: chromium:1508847
Change-Id: Icc3fa34ee376e5ae866e9d456c363cb4180d4a49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5490530
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1294381}
I'm migrating all TODOs referencing bug IDs to the new issue tracker
ID numbers. To avoid backsliding, I'm adding this presubmit. This LSC
is documented at go/crbug-todo-migration.
Bug: 321899722
Change-Id: Ib2fdd299796bf89124d5419cf0908c7cf380fe29
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5455308
Commit-Queue: Alison Gale <agale@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1288678}