From 96348be5b33fb884ae6f42cd1702a67e8bb501d9 Mon Sep 17 00:00:00 2001 From: RinCodeForge927 Date: Sun, 18 Jan 2026 19:42:36 +0700 Subject: [PATCH] chore: remove unused c8 dependency to resolve security alerts --- .github/workflows/smoke.yml | 10 +---- .github/workflows/unit.yml | 15 ------- core/scripts/c8.sh | 25 ----------- package.json | 8 +--- yarn.lock | 85 +++---------------------------------- 5 files changed, 10 insertions(+), 133 deletions(-) delete mode 100644 core/scripts/c8.sh diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index d5c2804d4895..10fd3e0c9139 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -56,8 +56,7 @@ jobs: - name: Run smoke tests run: | - yarn c8 yarn smoke --debug -j=2 --retries=2 --shard=${{ matrix.smoke-test-shard }}/$SHARD_TOTAL - yarn c8 report --reporter text-lcov > smoke-coverage.lcov + yarn smoke --debug -j=2 --retries=2 --shard=${{ matrix.smoke-test-shard }}/$SHARD_TOTAL # TODO(15841): remove when using trace by default, and we want to remove CDT graph impl. - name: Run smoke tests (lantern + trace) @@ -67,13 +66,6 @@ jobs: env: INTERNAL_LANTERN_USE_TRACE: 1 - - name: Upload test coverage to Codecov - if: matrix.chrome-channel == 'ToT' - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d - with: - flags: smoke - file: ./smoke-coverage.lcov - # Fail if any changes were written to source files. - run: git diff --exit-code diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 8b0069db16e9..98057189c610 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -65,25 +65,10 @@ jobs: - run: yarn test-proto # Run before unit-core because the roundtrip json is needed for proto tests. - name: yarn unit - if: ${{ matrix.node != env.LATEST_NODE }} run: yarn unit:ci - name: yarn unit-lantern-trace - if: ${{ matrix.node != env.LATEST_NODE }} run: yarn unit-lantern-trace:ci - # Only gather coverage on latest node, where c8 is the most accurate. - - name: yarn unit:cicoverage - if: ${{ matrix.node == env.LATEST_NODE }} - run: | - yarn unit:cicoverage - yarn c8 report --reporter text-lcov > unit-coverage.lcov - - name: Upload test coverage to Codecov - if: ${{ matrix.node == env.LATEST_NODE }} - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d - with: - flags: unit - file: ./unit-coverage.lcov - # Runs here because it needs the roundtrip proto. - name: yarn test-viewer run: yarn build-viewer && bash $GITHUB_WORKSPACE/.github/scripts/test-retry.sh yarn test-viewer diff --git a/core/scripts/c8.sh b/core/scripts/c8.sh deleted file mode 100644 index cd4a7bc4c880..000000000000 --- a/core/scripts/c8.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash - -## -# @license -# Copyright 2020 Google LLC -# SPDX-License-Identifier: Apache-2.0 -## - -set -euxo pipefail - -echo $* - -node node_modules/.bin/c8 \ - --include '{core,cli,viewer,treemap,build/plugins,report,flow-report}' \ - --exclude third_party \ - --exclude '**/test/' \ - --exclude '**/scripts/' \ - --exclude 'core/lib/page-functions.js' \ - --exclude 'core/util-commonjs.js' \ - $* - -# util-commonjs is a copy of renderer/util, which has its own test coverage. -# Admittedly, util-commonjs is used in different ways, but we don't expect it to also have complete -# coverage as some methods are renderer-specific. Ideally, we'd combine the coverage, but in the -# meantime we'll ignore coverage requirements for this file. diff --git a/package.json b/package.json index a128dfb5a429..a329811c3ddd 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "build-viewer": "node ./build/build-viewer.js", "build-types": "yarn type-check && rsync -a .tmp/tsbuildinfo/ ./ --include='*.d.ts' --include='*.d.cts' --exclude='*.map' --exclude='*.tsbuildinfo'", "reset-link": "(yarn unlink || true) && yarn link && yarn link lighthouse", - "c8": "bash core/scripts/c8.sh", "clean": "rm -r dist proto/scripts/*.json proto/scripts/*_pb2.* proto/scripts/*_pb.* proto/scripts/__pycache__ proto/scripts/*.pyc *.report.html *.report.dom.html *.report.json *.devtoolslog.json *.trace.json shared/localization/locales/*.ctc.json || true", "clean-types": "git clean -xfq '*.d.ts' '*.d.cts' -e 'node_modules/' -e 'dist/' -e '.tmp/' -e '**/types/'", "lint": "[ \"$CI\" = true ] && eslint --quiet -f codeframe . || eslint .", @@ -63,9 +62,6 @@ "cli-unit": "yarn unit-cli", "viewer-unit": "yarn unit-viewer", "watch": "yarn unit-core --watch", - "unit:cicoverage": "yarn c8 --all yarn unit:ci && yarn c8 --all yarn unit-lantern-trace:ci", - "coverage": "yarn unit:cicoverage && c8 report --reporter html", - "coverage:smoke": "yarn c8 yarn smoke -j=1 && c8 report --reporter html", "devtools": "bash core/scripts/roll-to-devtools.sh", "chrome": "node core/scripts/manual-chrome-launcher.js", "fast": "node ./cli/index.js --preset=desktop --throttlingMethod=provided", @@ -138,7 +134,6 @@ "angular": "^1.7.4", "archiver": "^7.0.1", "builtin-modules": "^3.3.0", - "c8": "^7.11.3", "chalk": "^2.4.1", "chrome-devtools-frontend": "1.0.1526630", "colors": "^1.4.0", @@ -209,7 +204,8 @@ }, "resolutions": { "puppeteer/**/devtools-protocol": "0.0.1527314", - "puppeteer-core/**/devtools-protocol": "0.0.1527314" + "puppeteer-core/**/devtools-protocol": "0.0.1527314", + "cross-spawn": "^7.0.6" }, "repository": "GoogleChrome/lighthouse", "keywords": [ diff --git a/yarn.lock b/yarn.lock index 2d05689b3436..0e50099ccdeb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -305,11 +305,6 @@ "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" -"@bcoe/v8-coverage@^0.2.3": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" - integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== - "@build-tracker/api-client@^1.0.0-beta.15": version "1.0.0-beta.15" resolved "https://registry.yarnpkg.com/@build-tracker/api-client/-/api-client-1.0.0-beta.15.tgz#1de2e3f926e963fc5488e14f51555559ed6000e4" @@ -1156,7 +1151,7 @@ js-yaml "^3.13.1" resolve-from "^5.0.0" -"@istanbuljs/schema@^0.1.2", "@istanbuljs/schema@^0.1.3": +"@istanbuljs/schema@^0.1.2": version "0.1.3" resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== @@ -1304,7 +1299,7 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@jridgewell/trace-mapping@^0.3.7", "@jridgewell/trace-mapping@^0.3.9": +"@jridgewell/trace-mapping@^0.3.9": version "0.3.13" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz#dcfe3e95f224c8fe97a87a5235defec999aa92ea" integrity sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w== @@ -1958,7 +1953,7 @@ resolved "https://registry.yarnpkg.com/@types/har-format/-/har-format-1.2.8.tgz#e6908b76d4c88be3db642846bb8b455f0bfb1c4e" integrity sha512-OP6L9VuZNdskgNN3zFQQ54ceYD8OLq5IbqO4VK91ORLfOm7WdT/CiT/pHEBSQEqCInJ2y3O6iCm/zGtPElpgJQ== -"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": version "2.0.3" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" integrity sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw== @@ -2835,24 +2830,6 @@ builtin-modules@^3.3.0: resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== -c8@^7.11.3: - version "7.11.3" - resolved "https://registry.yarnpkg.com/c8/-/c8-7.11.3.tgz#88c8459c1952ed4f701b619493c9ae732b057163" - integrity sha512-6YBmsaNmqRm9OS3ZbIiL2EZgi1+Xc4O24jL3vMYGE6idixYuGdy76rIfIdltSKDj9DpLNrcXSonUTR1miBD0wA== - dependencies: - "@bcoe/v8-coverage" "^0.2.3" - "@istanbuljs/schema" "^0.1.3" - find-up "^5.0.0" - foreground-child "^2.0.0" - istanbul-lib-coverage "^3.2.0" - istanbul-lib-report "^3.0.0" - istanbul-reports "^3.1.4" - rimraf "^3.0.2" - test-exclude "^6.0.0" - v8-to-istanbul "^9.0.0" - yargs "^16.2.0" - yargs-parser "^20.2.9" - cache-base@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" @@ -3309,7 +3286,7 @@ conventional-commits-parser@^3.2.0: split2 "^3.0.0" through2 "^4.0.0" -convert-source-map@^1.6.0, convert-source-map@^1.7.0: +convert-source-map@^1.7.0: version "1.8.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== @@ -3401,15 +3378,6 @@ crc32-stream@^6.0.0: crc-32 "^1.2.0" readable-stream "^4.0.0" -cross-spawn@^7.0.0: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - cross-spawn@^7.0.6: version "7.0.6" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" @@ -4354,14 +4322,6 @@ for-in@^1.0.2: resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= -foreground-child@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-2.0.0.tgz#71b32800c9f15aa8f2f83f4a6bd9bff35d861a53" - integrity sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA== - dependencies: - cross-spawn "^7.0.0" - signal-exit "^3.0.2" - foreground-child@^3.1.0: version "3.3.1" resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.3.1.tgz#32e8e9ed1b68a3497befb9ac2b6adf92a638576f" @@ -4802,11 +4762,6 @@ html-encoding-sniffer@^1.0.2: dependencies: whatwg-encoding "^1.0.1" -html-escaper@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" - integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== - http-link-header@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/http-link-header/-/http-link-header-1.1.1.tgz#f0e6971b0ed86e858d2077066ecb7ba4f2e50de9" @@ -5292,7 +5247,7 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: +istanbul-lib-coverage@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== @@ -5308,23 +5263,6 @@ istanbul-lib-instrument@^5.0.4: istanbul-lib-coverage "^3.2.0" semver "^6.3.0" -istanbul-lib-report@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" - integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== - dependencies: - istanbul-lib-coverage "^3.0.0" - make-dir "^3.0.0" - supports-color "^7.1.0" - -istanbul-reports@^3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.4.tgz#1b6f068ecbc6c331040aab5741991273e609e40c" - integrity sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw== - dependencies: - html-escaper "^2.0.0" - istanbul-lib-report "^3.0.0" - jackspeak@^3.1.2: version "3.4.3" resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-3.4.3.tgz#8833a9d89ab4acde6188942bd1c53b6390ed5a8a" @@ -7296,7 +7234,7 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.2, signal-exit@^3.0.7: +signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== @@ -8074,15 +8012,6 @@ uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== -v8-to-istanbul@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.0.tgz#be0dae58719fc53cb97e5c7ac1d7e6d4f5b19511" - integrity sha512-HcvgY/xaRm7isYmyx+lFKA4uQmfUbN0J4M0nNItvzTvH/iQ9kW5j/t4YSR+Ge323/lrgDAWJoF46tzGQHwBHFw== - dependencies: - "@jridgewell/trace-mapping" "^0.3.7" - "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^1.6.0" - validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -8343,7 +8272,7 @@ yargs-parser@^18.1.2: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^20.2.2, yargs-parser@^20.2.3, yargs-parser@^20.2.9: +yargs-parser@^20.2.2, yargs-parser@^20.2.3: version "20.2.9" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==