This reverts commit 3124f1cbbc.
Reason for revert: It breaks `npm run auto-unittest` with the following stacktrace:
```
Traceback (most recent call last):
File "scripts/test/run_auto_unittests.py", line 46, in <module>
main()
File "scripts/test/run_auto_unittests.py", line 42, in main
args.coverage)
File "devtools-frontend/scripts/test/run_unittests.py", line 86, in run_unit_tests_on_ninja_build_target
cwd)
File "devtools-frontend/scripts/test/run_unittests.py", line 28, in run_tests
'unittests', 'karma.conf.js')
File ".vpython-root/7aef5f/lib/python2.7/posixpath.py", line 70, in join
elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'
```
Original change's description:
> [Test] Tweaks to test runners
>
> A couple of minor additions to unit test running.
>
> R=jacktfranklin@chromium.org
>
> Bug: None
> Change-Id: I06705d369bcc93802eb07aa5d15668c73c6bfa2a
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2681740
> Commit-Queue: Paul Lewis <aerotwist@chromium.org>
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
> Auto-Submit: Paul Lewis <aerotwist@chromium.org>
TBR=aerotwist@chromium.org,jacktfranklin@chromium.org
Change-Id: I1bbd636e1316659721db634261506428b06d9f99
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2678688
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
To facilitate the removal of `$resources_out_dir`, we should cleanup
the usages of that variable throughout the various GNI variables that
we define. Therefore, we perform the string concatenation of
`$resources_out_dir` in the GRD action, rather than in the variable
definition.
There are still numerous usages scattered throughout the codebase,
but we will need to tackle these separately, as that will involve
some more path wrangling.
R=alexrudenko@chromium.org,aerotwist@chromium.org
Bug: 1174013
Change-Id: I760c1b153f0d2e1f9cdf1098773b92a7d05259e6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2678091
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
.ts files go through a different code path to .js files and weren't
subject to a migrated directory check, meaning .ts files could still
contain ls`` calls even when their containing directory had been
migrated already.
This fixes the existing violations and adds the check for .ts files
so that presubmit will complain in the future.
Fixed: 1174505
Change-Id: Ic76c4c0634ac279bb27a131f891d3a3b9490c3f4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2673829
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Christy Chen <chrche@microsoft.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
All relevant build output files are now put into gen/front_end.
To make sure that we don't run into duplicate JS entrypoint
files, we have to turn of the emit of these targets in
front_end/BUILD.gn, such that build_release_applications can
put its output there. Since build_release_applications takes
the files from the front_end source directory, not the gen
directory, this causes no issues.
After this change, it is possible to use --custom-devtools-frontend
with gen/front_end rather than resources/inspector.
DISABLE_THIRD_PARTY_CHECK=Update TypeScript noemit
R=aerotwist@chromium.org
Bug: 1174013
Change-Id: Iad331ff0a28871a0ec297483fa03fbb485d05fb4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2672031
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
This CL turns on the use_theme_colors stylelint rule which enforces that
any colors use variables defined in our codebase.
There are many, many violations, unsurprisingly (about 1500), so for now
I have disabled every single violation. The goal of the dark mode
migration will be in part to remove all violations of this rule.
Additionally, new code going forwards should adhere to the rule and not
add the comment to disable the warning.
Bug: 1152736
Change-Id: I51372724ea51485daef3d4f75b7d3f60a7c8016f
No-Presubmit: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2671323
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
This introduces the `use_theme_colors` Stylelint plugin which checks
that all colors used in our codebase use the CSS variables defined in
either themeColors.css or inspectorStyle.css. Long term we will remove
inspectorStyle.css but for now it's not going anywhere.
It does this by looking at certain rules and seeing if there are any
colors defined in them. If there are, it errors unless those use
variables that are defined.
It also can be run in fix mode, where it disables the rule for that
given line. This is important as we have 100s of violations of this rule
at the moment, and it's going to take time to get us to a place where we
do not.
It also will allow violations in a
:host-context(.-theme-with-dark-background) block as those will normally
be using specific colors to override (although this is discouraged).
Bug: chromium:1152736
Change-Id: I79281ba931ad94f76216ee1f4c8fd0406cf0c304
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2667199
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
This CL introduces "npm run check-external-links". The check parses
all string literals in first party JS/TS code for Urls. All the Urls
are then "pinged" by making a HEAD request to verify they still point
to an active resource. Example output:
$ time npm run check-external-links
> chrome-devtools-frontend@ check-external-links /usr/local/google/home/szuend/dev/devtools/devtools-frontend
> third_party/node/node.py --output scripts/check_external_links.js
Collecting JS/TS source files ... 1019 files found.
Collecting Urls from files ...248 unique Urls found.
Sending a HEAD request to each one ...
All Urls are accessible and point to existing resources.
npm run check-external-links 9.21s user 0.40s system 149% cpu 6.415 total
Please note that we can't make this check part of our PRESUBMIT, as
it makes external requests.
Also note that this check can't be implemented as an ESLint rule,
as ESLint rules are not allowed to have an async workload.
R=aerotwist@chromium.org, sigurds@chromium.org
Bug: chromium:1170310
Change-Id: I064161dd9038143d2e360c1716f8fb622dc119ee
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2659021
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
This is a reland of 159d86d3fb
The reland fixes the setting of "use_rbe" on the ts_library template
iff RBE is enabled for devtools directly. This prevents an
"unused variable" error when building with "use_rbe=true" and
"devtools_use_rbe=false".
Original change's description:
> Support RBE for building TypeScript int DevTools
>
> This CL implements initial support for executing TSC in the cloud by:
> 1) Introducing a new GN arg "devtools_use_rbe". This is experimental
> and will be folded into the Chromium "use_rbe" flag once RBE
> building has stabalized.
> 2) Pass the configured Chromium rewrapper along to ts_library.py.
> 3) Add a new function "runTscRemote" that calculates inputs required
> and invokes rewrapper
>
> Support is currently very limited:
> - Only works with a full Chromium checkout (NOT standalone DevTools)
> - Only works on leaf modules (modules without DEPS)
>
> Modules that can't be currently built in the Cloud are built locally
> as per usual.
>
> DISABLE_THIRD_PARTY_CHECK=Change typescript.gni
>
> R=tvanderlippe@chromium.org
>
> Bug: chromium:1139220
> Change-Id: Id7a1e6c113466414f6daaa661456d8debfe6696d
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2652508
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
DISABLE_THIRD_PARTY_CHECK=Change typescript.gni
Bug: chromium:1139220
Change-Id: I536fb580c3814a82525344ab5ebd5fb853568387
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2659015
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
This reverts commit 159d86d3fb.
Reason for revert:
This has broken a few re-client builders in Chromium:
* https://ci.chromium.org/p/chromium/builders/ci/Linux%20Builder%20%28reclient%29?limit=200
* https://ci.chromium.org/p/chromium/builders/ci/Linux%20Builder%20%28reclient%29
```
$ gn gen out/rbe-demo --args='use_rbe=true is_debug=false'
ERROR at //third_party/devtools-frontend/src/scripts/build/ninja/devtools_entrypoint.gni:132:19: Assignment had no effect.
use_rbe = false
^----
You set the variable "use_rbe" here and it was unused before it went
out of scope.
See //third_party/devtools-frontend/src/front_end/common/BUILD.gn:47:1: whence it was called.
```
Original change's description:
> Support RBE for building TypeScript int DevTools
>
> This CL implements initial support for executing TSC in the cloud by:
> 1) Introducing a new GN arg "devtools_use_rbe". This is experimental
> and will be folded into the Chromium "use_rbe" flag once RBE
> building has stabalized.
> 2) Pass the configured Chromium rewrapper along to ts_library.py.
> 3) Add a new function "runTscRemote" that calculates inputs required
> and invokes rewrapper
>
> Support is currently very limited:
> - Only works with a full Chromium checkout (NOT standalone DevTools)
> - Only works on leaf modules (modules without DEPS)
>
> Modules that can't be currently built in the Cloud are built locally
> as per usual.
>
> DISABLE_THIRD_PARTY_CHECK=Change typescript.gni
>
> R=tvanderlippe@chromium.org
>
> Bug: chromium:1139220
> Change-Id: Id7a1e6c113466414f6daaa661456d8debfe6696d
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2652508
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
TBR=szuend@chromium.org,tvanderlippe@chromium.org
Change-Id: Ie82249ab143f86bc61d706759b7b72c43ba4c53f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1139220
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2658258
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Ye Kuang <yekuang@google.com>
This CL implements initial support for executing TSC in the cloud by:
1) Introducing a new GN arg "devtools_use_rbe". This is experimental
and will be folded into the Chromium "use_rbe" flag once RBE
building has stabalized.
2) Pass the configured Chromium rewrapper along to ts_library.py.
3) Add a new function "runTscRemote" that calculates inputs required
and invokes rewrapper
Support is currently very limited:
- Only works with a full Chromium checkout (NOT standalone DevTools)
- Only works on leaf modules (modules without DEPS)
Modules that can't be currently built in the Cloud are built locally
as per usual.
DISABLE_THIRD_PARTY_CHECK=Change typescript.gni
R=tvanderlippe@chromium.org
Bug: chromium:1139220
Change-Id: Id7a1e6c113466414f6daaa661456d8debfe6696d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2652508
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
GRD compression takes a while. It takes a particularly long while in
debug builds. This change skips compression on debug builds which
takes the GRD step from ~55 seconds to ~5 seconds.
Alternately we could use this framework (passing through the debug state
of the build) to try different compression options as suggested in the
bug.
Test results for debug-component and release builds with this change:
5.2 weighted s to build gen/content/browser/devtools/devtools_resources_grit.d.stamp, gen... (5.2 s elapsed time)
24.5 weighted s to build gen/content/browser/devtools/devtools_resources_grit.d.stamp, gen... (24.5 s elapsed time)
Release is unchanged but debug is ~11 times faster.
Bug: 1162467
Change-Id: I017ec872a1645fef55aff09472cdf4427146d17b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2639276
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Previously we did not iterate subdirectories which meant we missed
folders like ui/components. Now the script complains that there is no
appropriate .grdp file for the strings it finds in e.g. SurveyLink.ts.
Also add the missing strings for SurveyLink.ts as the script now finds
them.
Bug: 1169118
Change-Id: I0e4793dc8581cd439f103632e60e9b8088a529a1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2644811
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
As part of the work to move more scripts to Node, not Python, over time,
picked this one as the starting point. I changed its API slightly to
allow more flags to be taken in, as we'll need that to do a stylelint
pass against TypeScript files, but I will do that in a subsequent CL.
I had to make quite a few changes to devtools_paths.js, but I think it's
now calculating paths correctly. It took a bit of messing to get the
equivalent of Python's path.abspath(__file__), as you'll see from the
large comment that tries to explain what's going on!
Bug: chromium:1166108, chromium:1166572
Change-Id: Ia0b19ff8956b2ede2447530be57876a88046887e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2631113
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>