Commit Graph
82 Commits
Author SHA1 Message Date
Andres Olivares 71a1ce45fa Sets up infrastructure to migrate extensions of type 'view'
This adds the basic infrastucture needed to start migrating 'view' extensions from the module.json system to a JavaScript declaration based system. As more views are migrated the infrastructure may be further modified.

Bug:1134103
Change-Id: I8ba4609ee9e1899cbd679624a49a7b16e8120140
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2508282
Commit-Queue: Andres Olivares <andoli@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-03 16:50:47 +00:00
Jack Franklin 102df67838 Fix component bridges tests
A recent TS config change elsewhere had caused these tests not to
compile with the error of:

```
error TS6307: File '/Users/jacktfranklin/src/devtools/devtools-frontend/scripts/component_bridges/value_for_type_node.ts' is not listed within the file list of project '/Users/jacktfranklin/src/devtools/devtools-frontend/test/unittests/scripts/component_bridges/tsconfig.json'.
```

The fix is to mark the dependency from the unit tests as a TS project
reference, and then generate output in the same place as the source, so
that import paths don't need to change.

This isn't ideal, and we would use ts_library if doing this now, but
this code pre-dates ts_library and also is only going to be around for
the length of the TypeScriptification work, so it doesn't feel worth the
effort to restructure it.

Change-Id: I9a924bf3e2ed945dd22ce233eda2c8c15f3193c6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2466188
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2020-10-13 10:35:14 +00:00
Alex Rudenko 5556a9020b Include inspector_overlay in presubmit
Change-Id: I2a60b74764d303104087be05b17caf909883099a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2436819
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-09-29 10:54:48 +00:00
Christy Chen 2d6d9a649b [Loc] Add collect-strings step to generate en-US and en-XL.json
This CL hooks up the collect-strings step with presubmit. Any UIStrings in the front_end javascript files will be gathered, and en-US.json and en-XL.json will be generated.

Note: This step has minimum impact on the presubmit performance (<1s)
DISABLE_THIRD_PARTY_CHECK = reason: removing extra loggings from the existing scripts.


Change-Id: I0065449766719a67d0ed604de3941bbc050b3780
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2409193
Reviewed-by: Vidal Diazleal <vidorteg@microsoft.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Christy Chen <chrche@microsoft.com>
2020-09-22 21:52:33 +00:00
Tim van der Lippe f8a8709c70 Run depot_tools canned checks after Devtools checks in PRESUBMIT
If you have whitespace or a missing EOL, ESLint would automatically
fix these issues. However, the canned checks ran before ESLint. Thus,
the canned checks detected whitespace/EOL issues and would report
these problems. This would be confusing, but wouldn't be an issue in
isolation as you would have changed files that need to be checked in.

However, the presubmit then claims "Do you want to proceed regardless
of PRESUBMIT errors", as the canned checks can be suppressed by default.
This would then confuse engineers, as they are uploading, the presubmit
would report errors that had already been fixed and would (understandably)
skip the presubmit. They would then see CQ fail after a while, which
would be a while later.

R=jacktfranklin@chromium.org

Change-Id: I5bd55fbf441eed0fe1bcd37e87b03699c9774d40
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2409980
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-14 14:38:38 +00:00
Paul Lewis 2b9224ffd9 Bypass third_party files when linting in presubmit
The presubmit sends a list of files that have changed to the linter. It
doesn't, however, remove files in front_end/third_party from that list.
This CL filters third_party files from that list.

TBR=yangguo@chromium.org

Change-Id: Idca43c882cc7e0fec26112ad2f499b292d634d32
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2398830
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
2020-09-08 19:18:05 +00:00
Jack Franklin 324f304f58 Component bridges presubmit check
This CL introduces a PRESUBMIT that will:

1. run `npm run regenerate-all-component-bridges`
2. Check that the git diff is clean.

If the git diff is not clean, it will fail. If the bridge has to be
manually edited (e.g. to work around a bug in the generator), it must
have a comment that matches the pattern `MANUALLY_EDITED_BRIDGE=...`.
The regeneration script will ignore bridges that contain these.

Change-Id: I372a3cd17a8e94bcdcea69ef64db189d2be6bde1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2364597
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-03 10:57:31 +00:00
Tim van der Lippe fb0234623d Add durations for individual presubmit steps
The time of a regular presubmit time has increased. To ease debugging
now and in the future, add the durations of each individual step
to the logs.

Since _checkWithNodeScript and all non-Node steps rely on
_ExecuteSubProcess we only need to implement it there.

Also reorder the presubmit outputs such that we only print "Running
X check" when we actually run it.

R=petermarshall@chromium.org

Bug: 1116989
Change-Id: I1f30c3b5dadb961ebfbfef56d50bd9347e9069f2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2367941
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2020-08-21 13:41:09 +00:00
Brandon Goddard 331043706c Add Presubmit for Devtools Experiment Telemetry
This CL adds a new Presubmit check that ensures that all devtools
experiemnts that are registered in MainImpl.js are also placed
in the UserMetrics.js file so that they have telemetry registered.

Explainer:
https://docs.google.com/document/d/1pcvN11C4onSXqOE0dTjUUHodMj55bRVl_5_e3kMg_rs/edit?ts=5f2329dc#heading=h.ezo3vjjctj8w

Bug: 1107636
Change-Id: If7ca22ef641b037717b808b7c57cc57c6f502536
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2341797
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>
Reviewed-by: Kalon Hinds <kahinds@microsoft.com>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
2020-08-13 16:10:50 +00:00
Mathias Bynens 011b0075cd Adopt new CheckAuthorizedAuthor parameter name
The `CheckAuthorizedAuthor` canned presubmit check now accepts
`bot_allowlist` instead of `bot_whitelist`. Support for
`bot_whitelist` will eventually be removed.

https://source.chromium.org/chromium/chromium/tools/depot_tools/+/master:presubmit_canned_checks.py;l=106-113;drc=7291750ae258773233f671ae7c93a5bc4a388831

Change-Id: I31e8ac7344b8dcd3f2c2d04fee60989eaaab1159
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2335451
Auto-Submit: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-08-05 13:04:31 +00:00
Mathias Bynens 0ec56611a7 Fix stylelint path resolution on Windows
On Windows, if your checkout is at:

    C:\devtools\devtools-frontend

Then the stylelint CLI lives here:

    C:\devtools\devtools-frontend\node_modules\stylelint\bin\stylelint.js

Prior to this patch, the lint CSS script was instead trying to use:

    C:\node_modules\stylelint\bin\stylelint.js

That is, it went two levels too far up the directory tree. This only
happened on Windows.

This patch avoids the problem altogether by forcing the root directory
to be the current working directory and passing a root-relative glob
instead.

As a drive-by, this patch cleans up the `_getFilesToLint` helper in
`PRESUBMIT.py`.

Bug: chromium:1083142
Change-Id: Ida7d19e4c1cb8954346a3103ce95748f0bc38f00
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2252005
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-06-19 07:33:31 +00:00
Mathias Bynens 1b2c5e463e Enable stylelint on presubmit
Bug: chromium:1083142
Change-Id: I74136f2ba5b74d4385760e157e2495d706cb5c35
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2248184
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-06-18 10:41:46 +00:00
Tim van der Lippe 0cbb83a5ec Allow node.py to run node scripts
If third_party/node/node.py is executed as a regular script,
it will consequently run the Node script with the node version
that is synced with gclient sync.

DISABLE_THIRD_PARTY_CHECK=Node Python fix
R=liviurau@chromium.org

Bug: 1074325
Change-Id: I738dc3de5dabdef349f90dfc972acd99f139c027
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2194873
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-13 09:10:31 +00:00
Tim van der Lippe 9813224fa7 Port linter check to Node
We ignore some files for ESLint, as they are either generated or
third_party. However, when someone tries to change these files,
ESLint would emit a warning stating that the file in question is
ignored.

This issue was reported to ESLint in https://github.com/eslint/eslint/issues/9977
The suggested workaround is to use the CLIEngine to filter out
the problematic paths. However, since our script was written in
Python, that API is not accessible to us.

Therefore rewrite the script to Node and filter out the problematic
files. The calls to CLIEngine were mostly taken from eslint/lib/cli.js,
which was the previous file used by `node_modules/bin/eslint`.

R=jacktfranklin@chromium.org
CC=sigurds@chromium.org

Change-Id: Iee600f0e0d99fcb6eeeb203a952a50fe35f9aaf3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2149316
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-14 16:25:25 +00:00
Tim van der Lippe fdbd42e2f8 Add eslint-import-plugin to node_modules
Will be used to make sure no default exports are in DevTools.

The PRESUBMIT.py has been updated to skip running the formatting check
if node_modules files are affected, to workaround crbug.com/1068198.

DISABLE_THIRD_PARTY_CHECK=Add plugin to node_modules

Bug: 1068198
Change-Id: I04d4dc813daa01099f21d40edf47aaefcc0b045f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2135610
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-04-07 14:27:34 +00:00
Tim van der Lippe c8f6ffd7c3 Update ESLint to 6.8.0
Also update the PRESUBMIT linter configuration to make sure
it actually runs the linter when updating ESLint. Otherwise,
it would not properly do the full linter check.

R=jacktfranklin@chromium.org
DISABLE_THIRD_PARTY_CHECK=Update ESLint

Bug: 1068145
Change-Id: Ibf2de156366dc64c90ee1aced5537d2038e7a268
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2137384
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-04-06 13:52:18 +00:00
Tim van der Lippe 5d2d79b814 Fix presubmit check to always run when generated files change
We are changing the build output in the generated file, but were not
properly checking that these were changed, as the presubmit check
was ignoring files in the `front_end/generated` folder.

Also fix the issue where the InspectorBackendCommands.js would be
changed to not emit the typedef.

R=szuend@chromium.org

Bug: 1011811
Change-Id: I2e09bce9cae69f4191d93de177b5ab5bb7da46c0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2115630
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-23 12:34:41 +00:00
Tim van der Lippe 2a4ae2bdc3 Run ESLint only on affected files for regular uploads
For most of the PRESUBMIT invocations, the CL in question does not
change anything with regards to ESLint. Therefore, we can skip doing the
full check and only perform the check on relevant JavaScript and
TypeScript files.

However, if we do change the ESLint configuration (via one of the
involved build scripts/configuration files), we should run the full
check to make sure we are compliant.

`npm run check-lint` will still run the full lint check.

This saves about 15 seconds on a regular PRESUBMIT invocation, scaling
with the number of files changed.

R=jacktfranklin@chromium.org,aerotwist@chromium.org

Change-Id: I9c1bb055274bfa1d8cc47c9039a1196c92eba399
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2097993
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-12 16:18:05 +00:00
Tim van der Lippe 4a8441c385 Port license header check to ESLint
This improves the PRESUBMIT performance as we can rely on the AST
parsing of ESLint, meaning we don't have to parse AST twice.

It also allows us to use the nice `--fix` solution to insert the proper
license header in the files.

This shaves an expected 5 seconds of the presubmit time
(non-scientifically computed based on 2 uploads).

Change-Id: I5c53e9b232585f9ec46f86b36557c50bf80f7add
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2097992
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-12 16:08:22 +00:00
Tim van der Lippe 9bb1cf6025 Add extra information for changed files check
This allows us to see which files are changed on bot runs, which eases
debugging.

R=changhaohan@chromium.org

Change-Id: Ic8d759f5c3126c9af05d0e4e98240de539844f76
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2091451
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-09 10:58:12 +00:00
Tim van der Lippe c46171246c Cleanup _checkWithNodeScript
It can use the same _ExecuteSubProcess helper and remove some
duplication on how to handle the script_arguments.

Change-Id: Iec7a32c7a0c173e92e0fd195f4cbc40b70665b03
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2087769
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-06 16:29:55 +00:00
Tim van der Lippe f515fdc350 Cleanup _CheckFormat presubmit check
The check was incorrectly excluding non-js files. Additionally, it can
use the _ExecuteSubProcess helper to remove duplicate logic for running
the sub-process.

Change-Id: I6435f91e1cee61b52581f6d76da3f0be3c8e9ee1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2087768
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-06 16:23:13 +00:00
Tim van der Lippe 5afd571cd4 Remove unnecessary _CheckCSSViolations check
These selectors are already removed from Blink and therefore no longer
work.

R=aerotwist@chromium.org

Change-Id: I3131d3cf5cb27eafa13e07ba65b87fc77e8dbae1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2087767
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-06 16:13:35 +00:00
Tim van der Lippe d8c23debbe Fix clang-format configuration
The configuration was only including files that were in a commit diff.
This causes issues where we generate sources during the PRESUBMIT (which
are not in the git diff at that point in time) and don't format.

At the same time, we remove the complicated logic to reuse the
`.eslintignore` for clang-format purposes and use the correct
`.clang-format` "DisableFormat" options to disable formatting in various
directories.

Roll CodeMirror: ignore

Change-Id: I21b95a6e09c5d6bf036bf1aace103d6c26823ecc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2091445
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-06 12:06:33 +00:00
Tim van der Lippe b0d65f1b3c Extract protocol generation to separate script
This allows us to add an npm command that does the same thing. This is
necessary to support the workflow of making changes in the pdl during
development.

You can regenerate the relevant protocol files with
`npm run generate-protocol-resources`. Note that the files it generates
are not formatted, but on presubmit it will both format and lint the
files to the correct notation. However, that should not impact the
workflow of making changes to the protocol files and testing their
behavior.

R=sigurds@chromium.org

Change-Id: I87c06183c8842d8643c4647cb1519850d75bd46d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2088093
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-03-05 12:21:12 +00:00
Tim van der Lippe b3b90761b1 Generate InspectorBackendCommands.js on presubmit
This checks in the InspectorBackendCommands in the source tree file
and ensures that it is kept in sync whenever the third_party
location has been updated.

In the process, I discovered multiple misconfigurations in the formatting
presubmit check. First of all, it was never running, because the
.eslintignore had an empty line. Second of all, it was running twice,
which is unnecessary since we now check for changed files at the end
of the presubmit. Lastly, it was only formatting JS files, while it
should check all files.

I have also updated the _CheckGeneratedFiles check to only run if it
is actually necessary. If there are no changes made to any affected of
the files, it will skip the step. This should thus reduce the presubmit
time and we will only pay the cost if we actually update any of the
files.

Lastly, it will now properly format and lint the generated files. This
makes reading the code a lot easier and makes it easier to digest the
diff when a protocol update goes through. I have verified that, in a
full build, the files are still minified. Thus, this has no impact on
the loading performance.

DISABLE_THIRD_PARTY_CHECK=Updating protocol generation

Fixed: 1056614
Change-Id: If49b0e749978ea1a7838992ec13507ee761ad76c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2087765
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-04 15:52:35 +00:00
Tim van der Lippe f664763cdf Generate SupportedCSSProperties.js on presubmit
This checks in the SupportedCSSProperties in the source tree file
and ensures that it is kept in sync whenever the third_party
location has been updated.

Bug: 1056614
Change-Id: If0ff2ba0f94f1f0eded2792922e9a917820d9772
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2087762
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-03-04 14:23:14 +00:00
Tim van der Lippe 4d004ec2b8 Generate ARIAProperties.js on presubmit
This checks in the ARIAProperties in the source tree file and ensures
that it is kept in sync whenever the third_party location has been
updated.

Bug: 1056614
Change-Id: Ic48b6cba17fe0a3c6b7d28dd3f74483ceac2969b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2085176
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-04 12:07:04 +00:00
Jack Franklin e245d1a208 Include test/e2e in ESLint checks.
It already runs on `test/unittests` but
with this change we'll lint the e2e tests too.

Change-Id: I0e39ce9a4b0128207a04b1dfd6cf1ea2f25bf213
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2054159
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-02-14 11:58:54 +00:00
Jack Franklin 8b9aa2fca6 Prefer eslint-mocha for linting .only in tests
DISABLE_THIRD_PARTY_CHECK=new npm module causes package-lock change

We can get rid of a custom script and use ESLint for these rules.

Additionally this means editors will highlight the issue in the editor.

Change-Id: I552b52e7f07b4e7430b3f685dbc3b5fad36ffff2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2052167
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-02-12 18:12:22 +00:00
Paul Lewis 853bb7e903 Restores .only PRESUBMIT check
TBR=tvanderlippe@chromium.org
Bug: 1009443
Change-Id: I99cd8a7526e24d57d07175c280d31420a59249fb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2046552
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-10 19:11:30 +00:00
Tim van der Lippe 11adee4a0c Stop running unit tests on presubmit
These unit tests run on a separate bot, dedicated to running tests.
Having these run in the presubmit as well lengthens CL upload time and
could cause more troubles in the presubmit bots.

Change-Id: I62aec994c2346e0b4e558bd88e9c64b77875f007
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2039570
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-06 14:31:07 +00:00
Christy Chen 1ab87e04c9 Fixed localization presubmit command line too long error
In presubmit.py, _CheckDevtoolsLocalization() gets all the paths of affected files and pass those in as arguments when running run_localization_check.py. When a lot of files need to be scanned, it casus the issue where character number exceed the limit of CreateProcess on Windows.

This PR changes the _CheckDevtoolsLocalization() to create a temp file that contains the affected file paths, and have the validation step read the affected file paths from the temp file.


Bug: 941561
Change-Id: I698e5064287eee8a8a3aca0682e3ab3521eb63d1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2032086
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Commit-Queue: Christy Chen <chrche@microsoft.com>
2020-01-31 23:01:04 +00:00
Brandon Goddard e702867eed Update PRESUBMIT.py to print current check running
This CL updated the devtools presubmit script to print each check
that is running in order to better understand the checks that are
performed when viewing the output logs.

After: https://imgur.com/pzZPYgy

Change-Id: I46a45860dc7f734453e4ca416ebf850f12946f48
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2031464
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
2020-01-30 17:41:41 +00:00
Tim van der Lippe 8fdda11ff7 Add presubmit check to prevent checking in large files
This will allow us to reinstate our GitHub sync.

Change-Id: I321811f8f090e5e2b6345ae6dc347d0bfa3e3338
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2022825
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-27 11:42:58 +00:00
Brandon Goddard 53faba1c7d Reland "Add script that checks license headers of JavaScript files"
This reverts commit 27f15d113a.

Reason for revert: script is fixed on Windows

Original change's description:
> Revert "Add script that checks license headers of JavaScript files"
>
> This reverts commit 6122ebd2f9.
>
> Reason for revert: Presubmit fails on windows due to relative
> path comparison with excluded files
>
> Original change's description:
> > Add script that checks license headers of JavaScript files
> >
> > The script checks if the license header is the BSD-3 license header that
> > DevTools is licensed under. It excludes files that have license headers
> > that reference non-Google/non-Chromium authors or are third_party
> > bundles that are checked into a non-third_party folder.
> >
> > Change-Id: I35f78036b48d3d7b7dcb9db1e070691282e27a02
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016747
> > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> > Reviewed-by: Liviu Rau <liviurau@chromium.org>
> > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
>
> TBR=bmeurer@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org,liviurau@chromium.org
>
> Change-Id: Idc27e9b78d5ac314176c71f8f4a7a2257da08be9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019019
> Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
> Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
> Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>

TBR=bmeurer@chromium.org,aerotwist@chromium.org,lomitch@microsoft.com,brgoddar@microsoft.com,tvanderlippe@chromium.org,liviurau@chromium.org

Change-Id: I191665c8e3fdbee7f3c5c312b5ba00513502e080
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019021
Reviewed-by: Fabio Rocha <fabio.rocha@microsoft.com>
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>
2020-01-24 18:16:35 +00:00
Brandon Goddard 27f15d113a Revert "Add script that checks license headers of JavaScript files"
This reverts commit 6122ebd2f9.

Reason for revert: Presubmit fails on windows due to relative
path comparison with excluded files

Original change's description:
> Add script that checks license headers of JavaScript files
> 
> The script checks if the license header is the BSD-3 license header that
> DevTools is licensed under. It excludes files that have license headers
> that reference non-Google/non-Chromium authors or are third_party
> bundles that are checked into a non-third_party folder.
> 
> Change-Id: I35f78036b48d3d7b7dcb9db1e070691282e27a02
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016747
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Liviu Rau <liviurau@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>

TBR=bmeurer@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org,liviurau@chromium.org

Change-Id: Idc27e9b78d5ac314176c71f8f4a7a2257da08be9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019019
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>
2020-01-24 16:50:05 +00:00
Tim van der Lippe 6122ebd2f9 Add script that checks license headers of JavaScript files
The script checks if the license header is the BSD-3 license header that
DevTools is licensed under. It excludes files that have license headers
that reference non-Google/non-Chromium authors or are third_party
bundles that are checked into a non-third_party folder.

Change-Id: I35f78036b48d3d7b7dcb9db1e070691282e27a02
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016747
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
2020-01-24 11:51:49 +00:00
Tim van der Lippe 5279f84b30 Fail on changed files before commit
To prevent accidental left-over changes that were generated during the
presubmit, make sure we explicitly check that no more changes are
pending.

Change-Id: Ic8f6ae76110babe69597e69009760cf451136e41
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2000787
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2020-01-14 16:30:48 +00:00
Tim van der Lippe 5497d487d6 Run the linter before the formatter
This makes sure that if the linter makes changes, we also format them.
This removes the need for running eslint twice, which is wasteful.

Change-Id: I4362c2c039af51a5a72cac3fce02351165a5bb66
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2000785
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2020-01-14 15:58:10 +00:00
Paul Lewis 21fb34999d Adds PRESUBMIT check for .only calls in Karma tests
Change-Id: I9355592d74777c9136eb50edd3fd08bc1b9e2c3c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2000786
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-14 15:37:28 +00:00
Liviu Rau d614e09de5 Reorganize presubmit checks
More should be checked by presubmit on commit than on upload.

Bug: chromium:1035817
Change-Id: Ia36b9c86ada84f1f5f4a4f896c5840c55d6b3275
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1981619
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
2020-01-08 10:38:36 +00:00
Liviu Rau fd2e3212e0 [presubmit] Allign authors check with the way we do it in V8
Change-Id: Ide50862cda9efc21241a253729c7ed2dfcec93c1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1971934
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
2019-12-18 15:44:17 +00:00
Tim van der Lippe e4bdd74599 Check JSON during upload
Fixed: 1030215
Change-Id: I33e6dea5f5c4fe601aee96f810109d24428fdccf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1969951
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2019-12-17 15:50:36 +00:00
Mathias Bynens a0a6e29dda Add AUTHORS file and presubmit check
Change-Id: Id5407ff374ddd1c0b8bf66acda0195c77ab796a9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1971417
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
2019-12-17 13:22:06 +00:00
Paul Lewis 14effbaba0 Fixes string interpolation in exclusive changes dir
Change-Id: I2a06155b184e197b25ed97a6f3f1e09595af97a2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1946475
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2019-12-02 15:04:44 +00:00
Tim van der Lippe bc42a63a70 Remove conditional for external_frontend
The old code was removed in crrev.com/c/chromium/src/+/1893272

DISABLE_THIRD_PARTY_CHECK=Build updates

Change-Id: If5bb1f6354a435624c6cd7e98914593518ca7fa5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1942288
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2019-11-28 14:34:23 +00:00
vidorteg 75c025e894 Reland "Do not require arguments to run run_localization_check.py"
Relanding a PR that was disabled due exposing a bug in esprima
that has already been addressed in:
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1931277

Bug: 1027052
Change-Id: I7262f01b545b7d8ab49cd6e8853f9f232b3d72e1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1929110
Commit-Queue: Vidal Diazleal <vidorteg@microsoft.com>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2019-11-25 19:26:14 +00:00
vidorteg 2b675b05ee Reland "Revert "Adding run_localization_check.py""
This change relands Adding run_localization_check.py which exposed
a bug in esprima that has been fixed in here:
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1931277

Bug: 1027052
Change-Id: I93a406a15cf5ba21b3a594e8a8593e49518c9a90
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1931279
Commit-Queue: Vidal Diazleal <vidorteg@microsoft.com>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-25 18:08:44 +00:00
Paul Lewis 954a5a9d92 Revert "Adding run_localization_check.py"
This reverts commit 402078e2f9.

Reason for revert: run_localization_check.py breaks the PRESUBMIT for any CLs which contain json files, i.e. module.json.

Original change's description:
> Adding run_localization_check.py
> 
> It will run the two localization verifications:
> - It will tell if the resource files are formatted in the correct way
> - It ill tell if any localizable resource in the code is present with the
> appropiate attributes in the resource files.
> 
> This two verifications already run as part of the presubmit verifications,
> I did some refactoring to allow them to be run from an external script.
> 
> Change-Id: I340e5dcfdeef7331a757adf27cef94e22302cf10
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1894913
> Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
> Commit-Queue: Vidal Diazleal <vidorteg@microsoft.com>

TBR=lomitch@microsoft.com,vidorteg@microsoft.com

Change-Id: I0f2dfa1e071a0302414cf38ccbdf86ca772b3ec1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1926496
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-20 15:34:28 +00:00