From f215dc11fe5ef3646e1e338298d55c5dab78c341 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 10:26:25 -0800 Subject: [PATCH 1/8] Bump hot-shots from 12.0.0 to 13.1.0 (#59374) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 70 ++++++++++++++--------------------------------- package.json | 2 +- 2 files changed, 21 insertions(+), 51 deletions(-) diff --git a/package-lock.json b/package-lock.json index 09f7ec183aef..edcc12dcddce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,7 +52,7 @@ "helmet": "^8.0.0", "highlight.js": "^11.11.1", "highlightjs-curl": "^1.3.0", - "hot-shots": "^12.0.0", + "hot-shots": "^13.1.0", "html-entities": "^2.5.6", "http-proxy-middleware": "^3.0.5", "imurmurhash": "^0.1.4", @@ -300,6 +300,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "peer": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" @@ -485,6 +486,7 @@ "version": "7.23.3", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.3.tgz", "integrity": "sha512-BmR4bWbDIoFJmJ9z2cZ8Gmm2MXgEDgjdWgpKmKWUt54UGFJdlj31ECtbaDvCG/qVdG3AQ1SfpZEs01lUFbzLOQ==", + "peer": true, "engines": { "node": ">=6.9.0" } @@ -522,12 +524,14 @@ "node_modules/@babel/core/node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "peer": true }, "node_modules/@babel/core/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "peer": true, "bin": { "semver": "bin/semver.js" } @@ -561,6 +565,7 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz", "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==", + "peer": true, "dependencies": { "@babel/compat-data": "^7.22.9", "@babel/helper-validator-option": "^7.22.15", @@ -576,6 +581,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "peer": true, "dependencies": { "yallist": "^3.0.2" } @@ -584,6 +590,7 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "peer": true, "bin": { "semver": "bin/semver.js" } @@ -591,7 +598,8 @@ "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "peer": true }, "node_modules/@babel/helper-environment-visitor": { "version": "7.22.20", @@ -639,6 +647,7 @@ "version": "7.23.3", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", + "peer": true, "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-module-imports": "^7.22.15", @@ -665,6 +674,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "peer": true, "dependencies": { "@babel/types": "^7.22.5" }, @@ -703,6 +713,7 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", + "peer": true, "engines": { "node": ">=6.9.0" } @@ -711,6 +722,7 @@ "version": "7.26.10", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.10.tgz", "integrity": "sha512-UPYc3SauzZ3JGgj87GgZ89JVdC5dj0AoetR5Bw6wj4niittNyFh6+eOGonYvJ1ao6B8lEa3Q3klS7ADZ53bc5g==", + "peer": true, "dependencies": { "@babel/template": "^7.26.9", "@babel/types": "^7.26.10" @@ -2627,7 +2639,6 @@ "resolved": "https://registry.npmjs.org/@octokit/core/-/core-7.0.6.tgz", "integrity": "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==", "license": "MIT", - "peer": true, "dependencies": { "@octokit/auth-token": "^6.0.0", "@octokit/graphql": "^9.0.3", @@ -2928,7 +2939,6 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", "license": "Apache-2.0", - "peer": true, "engines": { "node": ">=8.0.0" } @@ -2961,7 +2971,6 @@ "version": "2.5.1", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz", "integrity": "sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==", - "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, @@ -3001,7 +3010,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3022,7 +3030,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3043,7 +3050,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3064,7 +3070,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3085,7 +3090,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3106,7 +3110,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3127,7 +3130,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3148,7 +3150,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3169,7 +3170,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3190,7 +3190,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3211,7 +3210,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3232,7 +3230,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3253,7 +3250,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3271,7 +3267,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", - "dev": true, "license": "Apache-2.0", "optional": true, "bin": { @@ -3300,7 +3295,6 @@ "integrity": "sha512-vSMYtL/zOcFpvJCW71Q/OEGQb7KYBPAdKh35WNSkaZA75JlAO8ED8UN6GUNTm3drWomcbcqRPFqQbLae8yBTdg==", "devOptional": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "playwright": "1.56.1" }, @@ -4124,7 +4118,6 @@ "integrity": "sha512-wGA0NX93b19/dZC1J18tKWVIYWyyF2ZjT9vin/NRu0qzzvfVzWjs04iq2rQ3H65vCTQYlRqs3YHfY7zjdV+9Kw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^5.0.0", @@ -4286,7 +4279,6 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.20.tgz", "integrity": "sha512-IPaCZN7PShZK/3t6Q87pfTkRm6oLTd4vztyoj+cbHUF1g3FfVb2tFIL79uCRKEfv16AhqDMBywP2VW3KIZUvcg==", "license": "MIT", - "peer": true, "dependencies": { "@types/prop-types": "*", "csstype": "^3.0.2" @@ -4298,7 +4290,6 @@ "integrity": "sha512-nf22//wEbKXusP6E9pfOCDwFdHAX4u172eaJI4YkDRQEZiorm6KfYnSC2SWLDMVWUOWPERmJnN0ujeAfTBLvrw==", "devOptional": true, "license": "MIT", - "peer": true, "peerDependencies": { "@types/react": "^18.0.0" } @@ -4469,7 +4460,6 @@ "integrity": "sha512-pUXGCuHnnKw6PyYq93lLRiZm3vjuslIy7tus1lIQTYVK9bL8XBgJnCWm8a0KcTtHC84Yya1Q6rtll+duSMj0dg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.39.1", "@typescript-eslint/types": "8.39.1", @@ -5115,7 +5105,6 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -5145,7 +5134,6 @@ "version": "8.17.1", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", - "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -5711,7 +5699,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001733", "electron-to-chromium": "^1.5.199", @@ -5993,7 +5980,6 @@ "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", "license": "MIT", - "peer": true, "dependencies": { "cheerio-select": "^2.1.0", "dom-serializer": "^2.0.0", @@ -7265,7 +7251,6 @@ "integrity": "sha512-TS9bTNIryDzStCpJN93aC5VRSW3uTx9sClUn4B87pwiCaJh220otoI0X8mJKr+VcPtniMdN8GKjlwgWGUv5ZKA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", @@ -7327,7 +7312,6 @@ "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "dev": true, "license": "MIT", - "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -7599,7 +7583,6 @@ "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", @@ -8739,7 +8722,6 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -8795,6 +8777,7 @@ "node_modules/gensync": { "version": "1.0.0-beta.2", "license": "MIT", + "peer": true, "engines": { "node": ">=6.9.0" } @@ -9001,7 +8984,6 @@ "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.9.0.tgz", "integrity": "sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw==", "dev": true, - "peer": true, "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } @@ -9382,9 +9364,9 @@ "license": "MIT" }, "node_modules/hot-shots": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/hot-shots/-/hot-shots-12.0.0.tgz", - "integrity": "sha512-VdEXhNX4FYOY/Qx8sPcdR8+y/jXgwGlQdhk77dgFvJsVx+uS9WwiHEc+NKJqEQmd+0FTwy2/5FOtqe4cZ/JV5g==", + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/hot-shots/-/hot-shots-13.1.0.tgz", + "integrity": "sha512-dvLYrOSh4dZknxpsVM3nSiXZfipGDLIPtS7Ad2KSaM/oUFOIOeKg0T1Rp0KwVGP9u2e3eW4wvjbta2bNwkHU/g==", "license": "MIT", "engines": { "node": ">=16.0.0" @@ -10374,7 +10356,6 @@ "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", "dev": true, - "peer": true, "bin": { "jiti": "lib/jiti-cli.mjs" } @@ -10501,6 +10482,7 @@ "node_modules/json5": { "version": "2.2.3", "license": "MIT", + "peer": true, "bin": { "json5": "lib/cli.js" }, @@ -12708,7 +12690,6 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", - "dev": true, "license": "MIT", "optional": true }, @@ -13463,7 +13444,6 @@ "integrity": "sha512-hutraynyn31F+Bifme+Ps9Vq59hKuUCz7H1kDOcBs+2oGguKkWTU50bBWrtz34OUWmIwpBTWDxaRPXrIXkgvmQ==", "devOptional": true, "license": "Apache-2.0", - "peer": true, "bin": { "playwright-core": "cli.js" }, @@ -13527,7 +13507,6 @@ "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", "dev": true, "license": "MIT", - "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -13697,7 +13676,6 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", - "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -13718,7 +13696,6 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", - "peer": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -14386,7 +14363,6 @@ "integrity": "sha512-d0NoFH4v6SjEK7BoX810Jsrhj7IQSYHAHLi/iSpgqKc7LaIDshFRlSg5LOymf9FqQhxEHs2W5ZQXlvy0KD45Uw==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -15324,7 +15300,6 @@ "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-5.3.11.tgz", "integrity": "sha512-uuzIIfnVkagcVHv9nE0VPlHPSCmXIUGKfJ42LNjxCCTDTL5sgnJ8Z7GZBq0EnLYGln77tPpEpExt2+qa+cZqSw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-module-imports": "^7.0.0", "@babel/traverse": "^7.4.5", @@ -15583,7 +15558,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -15909,7 +15883,6 @@ "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -16264,7 +16237,6 @@ "dev": true, "hasInstallScript": true, "license": "MIT", - "peer": true, "dependencies": { "napi-postinstall": "^0.2.2" }, @@ -16467,7 +16439,6 @@ "integrity": "sha512-ZWyE8YXEXqJrrSLvYgrRP7p62OziLW7xI5HYGWFzOvupfAlrLvURSzv/FyGyy0eidogEM3ujU+kUG1zuHgb6Ug==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -16576,7 +16547,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, diff --git a/package.json b/package.json index 6ace2b485828..5c442312112c 100644 --- a/package.json +++ b/package.json @@ -200,7 +200,7 @@ "helmet": "^8.0.0", "highlight.js": "^11.11.1", "highlightjs-curl": "^1.3.0", - "hot-shots": "^12.0.0", + "hot-shots": "^13.1.0", "html-entities": "^2.5.6", "http-proxy-middleware": "^3.0.5", "imurmurhash": "^0.1.4", From 99a07d45fd6e741217356b6eb79e9e7ee7d292c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 18:27:38 +0000 Subject: [PATCH 2/8] Bump actions/upload-artifact from 4.6.2 to 6.0.0 (#59371) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/link-check-external.yml | 2 +- .github/workflows/link-check-internal.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/link-check-external.yml b/.github/workflows/link-check-external.yml index af8a04adc6ad..cb0bc35af3fd 100644 --- a/.github/workflows/link-check-external.yml +++ b/.github/workflows/link-check-external.yml @@ -43,7 +43,7 @@ jobs: - name: Upload report artifact if: failure() - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: external-link-report path: artifacts/external-link-report.* diff --git a/.github/workflows/link-check-internal.yml b/.github/workflows/link-check-internal.yml index baa966011acd..b1b51fffa326 100644 --- a/.github/workflows/link-check-internal.yml +++ b/.github/workflows/link-check-internal.yml @@ -90,7 +90,7 @@ jobs: - name: Upload report artifact if: always() - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: link-report-${{ matrix.version }}-${{ matrix.language }} path: artifacts/link-report-*.md From afd3ca0a8d9b58c4a92e3a6d16630e734af9ce52 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 18:27:42 +0000 Subject: [PATCH 3/8] Bump tj-actions/changed-files from 45.0.2 to 47.0.1 (#59370) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/link-check-on-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-check-on-pr.yml b/.github/workflows/link-check-on-pr.yml index 755fc0581e1c..dd424e2739c4 100644 --- a/.github/workflows/link-check-on-pr.yml +++ b/.github/workflows/link-check-on-pr.yml @@ -37,7 +37,7 @@ jobs: - name: Get changed files id: changed-files - uses: tj-actions/changed-files@48d8f15b2aaa3d255ca5af3eba4870f807ce6b3c # v45 + uses: tj-actions/changed-files@e0021407031f5be11a464abee9a0776171c79891 # v45 with: files: | content/**/*.md From 676fc70e0e09d554b640fc4880f87b5a4b4063e7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 18:27:44 +0000 Subject: [PATCH 4/8] Bump actions/download-artifact from 4.2.1 to 7.0.0 (#59369) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/link-check-internal.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-check-internal.yml b/.github/workflows/link-check-internal.yml index b1b51fffa326..6dc735d57ffb 100644 --- a/.github/workflows/link-check-internal.yml +++ b/.github/workflows/link-check-internal.yml @@ -113,7 +113,7 @@ jobs: uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: Download all artifacts - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: path: reports pattern: link-report-* From 2849f8b53b537ad293d841cb4fe900905315cbda Mon Sep 17 00:00:00 2001 From: Evan Bonsignori Date: Wed, 28 Jan 2026 10:36:01 -0800 Subject: [PATCH 5/8] [Sentry Auto-Fix] DOCS-2JX: Error: Request timed out after 1500ms (#59286) Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Ebonsignori <17055832+Ebonsignori@users.noreply.github.com> --- .../archived-enterprise-versions.ts | 52 +++++++++++++++++-- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/src/archives/middleware/archived-enterprise-versions.ts b/src/archives/middleware/archived-enterprise-versions.ts index 74dbf9caf2e1..cce873631096 100644 --- a/src/archives/middleware/archived-enterprise-versions.ts +++ b/src/archives/middleware/archived-enterprise-versions.ts @@ -2,6 +2,7 @@ import type { Response, NextFunction } from 'express' import { fetchWithRetry } from '@/frame/lib/fetch-utils' import statsd from '@/observability/lib/statsd' +import { createLogger } from '@/observability/logger' import { firstVersionDeprecatedOnNewSite, lastVersionWithoutArchivedRedirectsFile, @@ -19,6 +20,8 @@ import getRedirect, { splitPathByLanguage } from '@/redirects/lib/get-redirect' import getRemoteJSON from '@/frame/lib/get-remote-json' import { ExtendedRequest } from '@/types' +const logger = createLogger(import.meta.url) + const OLD_PUBLIC_AZURE_BLOB_URL = 'https://githubdocs.azureedge.net' // Old Azure Blob Storage `enterprise` container. const OLD_AZURE_BLOB_ENTERPRISE_DIR = `${OLD_PUBLIC_AZURE_BLOB_URL}/enterprise` @@ -78,11 +81,17 @@ const cacheAggressively = (res: Response) => { const retryConfiguration = { limit: 3 } // According to our Datadog metrics, the *average* time for the // the 'archive_enterprise_proxy' metric is ~70ms (excluding spikes) -// which much less than 1500ms. +// which is much less than 3000ms. // We have observed errors of timeout, in production, when it was -// set to 500ms. Let's try to be very conservative here to avoid -// unnecessary error reporting. -const timeoutConfiguration = { response: 1500 } +// set to 500ms and then 1500ms. Let's be more conservative here to +// avoid unnecessary error reporting during occasional slow responses. +const timeoutConfiguration = { response: 3000 } + +// Monitoring thresholds for logging response times +// Log warnings when responses exceed half the timeout threshold +const WARN_RESPONSE_THRESHOLD = timeoutConfiguration.response / 2 // 1500ms +// Log info for responses that are noticeably slow but not concerning +const SLOW_RESPONSE_THRESHOLD = 500 // ms // This module handles requests for deprecated GitHub Enterprise versions // by routing them to static content in @@ -201,10 +210,44 @@ export default async function archivedEnterpriseVersions( ) const statsdTags = [`version:${requestedVersion}`] + const startTime = Date.now() const r = await statsd.asyncTimer(doGet, 'archive_enterprise_proxy', [ ...statsdTags, `path:${req.path}`, ])() + const responseTime = Date.now() - startTime + + // Log warnings for slow responses to help identify degraded performance + // A response time over half the timeout indicates potential issues + if (responseTime > WARN_RESPONSE_THRESHOLD) { + logger.warn('Slow response from archived enterprise content', { + version: requestedVersion, + path: req.path, + responseTime: `${responseTime}ms`, + status: r.status, + threshold: `${WARN_RESPONSE_THRESHOLD}ms`, + }) + } + + // Log errors for non-200 responses to help identify issues with archived content + if (r.status !== 200) { + logger.error('Failed to fetch archived enterprise content', { + version: requestedVersion, + path: req.path, + status: r.status, + responseTime: `${responseTime}ms`, + url: getProxyPath(req.path, requestedVersion), + }) + } + + // Log successful responses with timing for monitoring trends + if (r.status === 200 && responseTime > SLOW_RESPONSE_THRESHOLD) { + logger.info('Archived enterprise content response', { + version: requestedVersion, + responseTime: `${responseTime}ms`, + status: r.status, + }) + } if (r.status === 200) { const body = await r.text() @@ -317,6 +360,7 @@ export default async function archivedEnterpriseVersions( return res.send(modifiedBody) } + // In releases 2.13 - 2.17, we lost access to frontmatter redirects // during the archival process. This workaround finds potentially // relevant frontmatter redirects in currently supported pages From 53fc17eae8ed67e5142e4bf4a511807276895fc8 Mon Sep 17 00:00:00 2001 From: Evan Bonsignori Date: Wed, 28 Jan 2026 10:36:13 -0800 Subject: [PATCH 6/8] [Sentry Auto-Fix] DOCS-G4: Error: Cannot set headers after they are sent to the client (#59285) Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Ebonsignori <17055832+Ebonsignori@users.noreply.github.com> --- package-lock.json | 17 +++++++++++++++++ src/search/middleware/search-routes.ts | 13 ++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index edcc12dcddce..01d1bbd0b012 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2971,6 +2971,7 @@ "version": "2.5.1", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz", "integrity": "sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==", + "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, @@ -3010,6 +3011,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3030,6 +3032,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3050,6 +3053,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3070,6 +3074,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3090,6 +3095,7 @@ "cpu": [ "arm" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3110,6 +3116,7 @@ "cpu": [ "arm" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3130,6 +3137,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3150,6 +3158,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3170,6 +3179,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3190,6 +3200,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3210,6 +3221,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3230,6 +3242,7 @@ "cpu": [ "ia32" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3250,6 +3263,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -3267,6 +3281,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "dev": true, "license": "Apache-2.0", "optional": true, "bin": { @@ -8722,6 +8737,7 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -12690,6 +12706,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "dev": true, "license": "MIT", "optional": true }, diff --git a/src/search/middleware/search-routes.ts b/src/search/middleware/search-routes.ts index 89342dae0968..8deb2040f641 100644 --- a/src/search/middleware/search-routes.ts +++ b/src/search/middleware/search-routes.ts @@ -10,7 +10,9 @@ import catchMiddlewareError from '@/observability/middleware/catch-middleware-er import { generalSearchRoute } from '@/search/lib/routes/general-search-route' import { aiSearchAutocompleteRoute } from '@/search/lib/routes/ai-search-autocomplete-route' import { combinedSearchRoute } from '@/search/lib/routes/combined-search-route' +import { createLogger } from '@/observability/logger' +const logger = createLogger('search:middleware:search-routes') const router = express.Router() router.get('/legacy', (req: Request, res: Response) => { @@ -37,7 +39,16 @@ export async function handleGetSearchResultsError( const reports = FailBot.report(error, { url: req.url, ...options }) if (reports) await Promise.all(reports) } - res.status(500).json({ error: error.message }) + // Avoid "Cannot set headers after they are sent to the client" error + // if response was already partially sent before the error occurred + if (!res.headersSent) { + res.status(500).json({ error: error.message }) + } else { + logger.warn('Response headers already sent; unable to send error response.', { + url: req.url, + message: error?.message, + }) + } } // Redirects search routes to their latest versions From 7cc5a9e5a28a5da49d4d3d91555bcca93d7cb456 Mon Sep 17 00:00:00 2001 From: Evan Bonsignori Date: Wed, 28 Jan 2026 12:38:48 -0800 Subject: [PATCH 7/8] add custom eslint rule to enforce use of our logger (#59032) --- eslint.config.ts | 73 +++ package-lock.json | 13 + package.json | 1 + src/eslint-rules/README.md | 21 + src/eslint-rules/index.js | 6 + src/eslint-rules/package.json | 10 + src/eslint-rules/use-custom-logger/README.md | 15 + .../tests/use-custom-logger.ts | 470 ++++++++++++++++++ .../use-custom-logger/use-custom-logger.js | 179 +++++++ src/observability/README.md | 4 + src/types/eslint-plugins.d.ts | 8 + 11 files changed, 800 insertions(+) create mode 100644 src/eslint-rules/README.md create mode 100644 src/eslint-rules/index.js create mode 100644 src/eslint-rules/package.json create mode 100644 src/eslint-rules/use-custom-logger/README.md create mode 100644 src/eslint-rules/use-custom-logger/tests/use-custom-logger.ts create mode 100644 src/eslint-rules/use-custom-logger/use-custom-logger.js diff --git a/eslint.config.ts b/eslint.config.ts index 8d2ed2888c58..ecb8ae8abd3d 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -12,6 +12,7 @@ import noOnlyTests from 'eslint-plugin-no-only-tests' import prettierPlugin from 'eslint-plugin-prettier' import prettier from 'eslint-config-prettier' import globals from 'globals' +import customRules from 'eslint-plugin-custom-rules' export default [ { @@ -57,6 +58,7 @@ export default [ '@typescript-eslint': tseslint, 'primer-react': primerReact, 'jsx-a11y': jsxA11y, + 'custom-rules': customRules, }, rules: { // ESLint recommended rules @@ -98,6 +100,77 @@ export default [ // Disabled rules to review 'no-console': 'off', // 800+ '@typescript-eslint/no-explicit-any': 'off', + + // Custom rules (disabled by default for now) + 'custom-rules/use-custom-logger': 'off', + }, + }, + + // Configuration for eslint-rules directory (CommonJS JavaScript files) + { + files: ['src/eslint-rules/**/*.js'], + languageOptions: { + ecmaVersion: 2022, + sourceType: 'script', + globals: { + ...globals.node, + ...globals.commonjs, + ...globals.es2020, + }, + }, + plugins: { + github, + import: importPlugin, + 'eslint-comments': eslintComments, + filenames, + 'no-only-tests': noOnlyTests, + prettier: prettierPlugin, + }, + rules: { + // ESLint recommended rules + ...js.configs.recommended.rules, + + // GitHub plugin recommended rules + ...github.configs.recommended.rules, + + // Import plugin error rules + ...importPlugin.configs.errors.rules, + + // Allow CommonJS in eslint rules + 'import/no-commonjs': 'off', + + // Overrides + 'import/extensions': ['error', { json: 'always' }], + 'no-empty': ['error', { allowEmptyCatch: true }], + 'prefer-const': ['error', { destructuring: 'all' }], + + // Disabled rules + 'i18n-text/no-en': 'off', + 'filenames/match-regex': 'off', + camelcase: 'off', + 'no-console': 'off', + }, + }, + + // Disable custom logger rule for logger implementation itself + { + files: ['src/observability/logger/**/*.{ts,js}'], + rules: { + 'custom-rules/use-custom-logger': 'off', + }, + }, + + // Override for scripts, tests, workflows, content-linter, and React files (disable custom logger rule) + { + files: [ + '**/scripts/**/*.{ts,js}', + '**/tests/**/*.{ts,js}', + 'src/workflows/**/*.{ts,js}', + 'src/content-linter/**/*.{ts,js}', + '**/*.{tsx,jsx}', + ], + rules: { + 'custom-rules/use-custom-logger': 'off', }, }, diff --git a/package-lock.json b/package-lock.json index 01d1bbd0b012..adde603e9480 100644 --- a/package-lock.json +++ b/package-lock.json @@ -144,6 +144,7 @@ "eslint": "^9.33.0", "eslint-config-prettier": "^10.1.8", "eslint-import-resolver-typescript": "^4.4.2", + "eslint-plugin-custom-rules": "file:src/eslint-rules", "eslint-plugin-escompat": "^3.11.4", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-filenames": "^1.3.2", @@ -7472,6 +7473,10 @@ "ms": "^2.1.1" } }, + "node_modules/eslint-plugin-custom-rules": { + "resolved": "src/eslint-rules", + "link": true + }, "node_modules/eslint-plugin-escompat": { "version": "3.11.4", "resolved": "https://registry.npmjs.org/eslint-plugin-escompat/-/eslint-plugin-escompat-3.11.4.tgz", @@ -17149,6 +17154,14 @@ "type": "github", "url": "https://github.com/sponsors/wooorm" } + }, + "src/eslint-rules": { + "name": "eslint-plugin-custom-rules", + "version": "1.0.0", + "dev": true, + "peerDependencies": { + "eslint": "^8.0.0 || ^9.0.0" + } } } } diff --git a/package.json b/package.json index 5c442312112c..791b0d4e8fd7 100644 --- a/package.json +++ b/package.json @@ -292,6 +292,7 @@ "eslint": "^9.33.0", "eslint-config-prettier": "^10.1.8", "eslint-import-resolver-typescript": "^4.4.2", + "eslint-plugin-custom-rules": "file:src/eslint-rules", "eslint-plugin-escompat": "^3.11.4", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-filenames": "^1.3.2", diff --git a/src/eslint-rules/README.md b/src/eslint-rules/README.md new file mode 100644 index 000000000000..3b7ec018a9c4 --- /dev/null +++ b/src/eslint-rules/README.md @@ -0,0 +1,21 @@ +# Custom ESLint Rules + +We can declare custom rules in this directory and import them from our ESLint config in [eslint.config.ts](../../eslint.config.ts) + +Custom rules are useful for enforcing best practices and more effective than a "warning" comment since automated linter tests will fail if custom rules aren't followed. + +**Note:** Custom rules must be written as JavaScript (`.js`) files, not TypeScript. ESLint loads custom rule plugins at runtime using Node's module system, which expects JavaScript. While the main ESLint config can be TypeScript, the rule implementations themselves need to be JavaScript. + +## Creating a new rule + +1. Create the rule in this directory +2. Export it from [index.js](./index.js) +3. Enable it in [eslint.config.ts](../../eslint.config.ts) under the `"rules"` key, e.g. + +```typescript +'custom-rules/use-custom-logger': 'error', +``` + +Note that the rule is prepended with `custom-rules` + +4. Please include a `README.md` in your rule's directory explaining why it is necessary and any times the rule can be ignored. diff --git a/src/eslint-rules/index.js b/src/eslint-rules/index.js new file mode 100644 index 000000000000..8e0e03398c32 --- /dev/null +++ b/src/eslint-rules/index.js @@ -0,0 +1,6 @@ +// Export custom rules from here +module.exports = { + rules: { + "use-custom-logger": require("./use-custom-logger/use-custom-logger"), + }, +}; diff --git a/src/eslint-rules/package.json b/src/eslint-rules/package.json new file mode 100644 index 000000000000..a6b961f3d116 --- /dev/null +++ b/src/eslint-rules/package.json @@ -0,0 +1,10 @@ +{ + "name": "eslint-plugin-custom-rules", + "type": "commonjs", + "version": "1.0.0", + "license": "MIT", + "main": "index.js", + "peerDependencies": { + "eslint": "^8.0.0 || ^9.0.0" + } +} diff --git a/src/eslint-rules/use-custom-logger/README.md b/src/eslint-rules/use-custom-logger/README.md new file mode 100644 index 000000000000..80f4d003dffa --- /dev/null +++ b/src/eslint-rules/use-custom-logger/README.md @@ -0,0 +1,15 @@ +# Use Custom Logger Rule + +This rule enforces using `logger.` instead of `console.log` in backend code. + +Please see [the logger README](../../observability/logger/README.md) for more details. + +## When to ignore + +Anywhere that isn't server code doesn't need to use the `logger`. e.g. React components, GitHub Actions, and CLI scripts. + +## Auto fix + +This rule supports auto-fixing via `--fix`. + +Run `npm run lint -- --fix` to apply the changes, but please make sure to double check that the automatic fix looks correct before committing. diff --git a/src/eslint-rules/use-custom-logger/tests/use-custom-logger.ts b/src/eslint-rules/use-custom-logger/tests/use-custom-logger.ts new file mode 100644 index 000000000000..a9eb68e4d7db --- /dev/null +++ b/src/eslint-rules/use-custom-logger/tests/use-custom-logger.ts @@ -0,0 +1,470 @@ +import { describe, it } from 'vitest' +import { RuleTester, Rule } from 'eslint' +import ruleModule from '../use-custom-logger' + +const rule = ruleModule as Rule.RuleModule + +const ruleTester = new RuleTester({ + languageOptions: { + ecmaVersion: 2022, + sourceType: 'module', + }, +}) + +describe('use-custom-logger', () => { + it('should pass valid code without console usage', () => { + ruleTester.run('use-custom-logger', rule, { + valid: [ + { + code: ` + import { createLogger } from '@/observability/logger'; + const logger = createLogger(import.meta.url); + logger.info('test'); + `, + }, + { + code: ` + const x = 5; + const y = 10; + `, + }, + ], + invalid: [], + }) + }) + + it('should detect and fix console.log', () => { + ruleTester.run('use-custom-logger', rule, { + valid: [], + invalid: [ + { + code: ` + import { something } from 'somewhere'; + console.log('test'); + `, + errors: [ + { + message: 'Please use our internal logger.info instead of console.log', + }, + ], + output: ` + import { something } from 'somewhere'; +import { createLogger } from '@/observability/logger'; + +const logger = createLogger(import.meta.url); + + logger.info('test'); + `, + }, + ], + }) + }) + + it('should detect and fix console.error', () => { + ruleTester.run('use-custom-logger', rule, { + valid: [], + invalid: [ + { + code: ` + import { something } from 'somewhere'; + console.error('test'); + `, + errors: [ + { + message: 'Please use our internal logger.error instead of console.error', + }, + ], + output: ` + import { something } from 'somewhere'; +import { createLogger } from '@/observability/logger'; + +const logger = createLogger(import.meta.url); + + logger.error('test'); + `, + }, + ], + }) + }) + + it('should detect and fix console.warn', () => { + ruleTester.run('use-custom-logger', rule, { + valid: [], + invalid: [ + { + code: ` + import { something } from 'somewhere'; + console.warn('warning'); + `, + errors: [ + { + message: 'Please use our internal logger.warn instead of console.warn', + }, + ], + output: ` + import { something } from 'somewhere'; +import { createLogger } from '@/observability/logger'; + +const logger = createLogger(import.meta.url); + + logger.warn('warning'); + `, + }, + ], + }) + }) + + it('should detect and fix console.debug', () => { + ruleTester.run('use-custom-logger', rule, { + valid: [], + invalid: [ + { + code: ` + import { something } from 'somewhere'; + console.debug('debug info'); + `, + errors: [ + { + message: 'Please use our internal logger.debug instead of console.debug', + }, + ], + output: ` + import { something } from 'somewhere'; +import { createLogger } from '@/observability/logger'; + +const logger = createLogger(import.meta.url); + + logger.debug('debug info'); + `, + }, + ], + }) + }) + + it('should handle files with no existing imports', () => { + ruleTester.run('use-custom-logger', rule, { + valid: [], + invalid: [ + { + code: `console.log('hello');`, + errors: [ + { + message: 'Please use our internal logger.info instead of console.log', + }, + ], + output: `import { createLogger } from '@/observability/logger'; + +const logger = createLogger(import.meta.url); +logger.info('hello');`, + }, + ], + }) + }) + + it('should not add duplicate imports when logger import exists', () => { + ruleTester.run('use-custom-logger', rule, { + valid: [], + invalid: [ + { + code: ` + import { createLogger } from '@/observability/logger'; + console.log('test'); + `, + errors: [ + { + message: 'Please use our internal logger.info instead of console.log', + }, + ], + output: ` + import { createLogger } from '@/observability/logger'; + +const logger = createLogger(import.meta.url); + + logger.info('test'); + `, + }, + ], + }) + }) + + it('should not add duplicate logger declaration when it exists', () => { + ruleTester.run('use-custom-logger', rule, { + valid: [], + invalid: [ + { + code: ` + import { createLogger } from '@/observability/logger'; + const logger = createLogger(import.meta.url); + console.log('test'); + `, + errors: [ + { + message: 'Please use our internal logger.info instead of console.log', + }, + ], + output: ` + import { createLogger } from '@/observability/logger'; + const logger = createLogger(import.meta.url); + logger.info('test'); + `, + }, + ], + }) + }) + + it('should handle multiple console calls in one file', () => { + ruleTester.run('use-custom-logger', rule, { + valid: [], + invalid: [ + { + code: ` + import { something } from 'somewhere'; + console.log('first'); + console.error('second'); + `, + errors: [ + { + message: 'Please use our internal logger.info instead of console.log', + }, + { + message: 'Please use our internal logger.error instead of console.error', + }, + ], + output: ` + import { something } from 'somewhere'; +import { createLogger } from '@/observability/logger'; + +const logger = createLogger(import.meta.url); + + logger.info('first'); + logger.error('second'); + `, + }, + ], + }) + }) + + it('should transform console.error(err) to logger.error with message', () => { + ruleTester.run('use-custom-logger', rule, { + valid: [], + invalid: [ + { + code: ` + import { something } from 'somewhere'; + const err = new Error('test'); + console.error(err); + `, + errors: [ + { + message: 'Please use our internal logger.error instead of console.error', + }, + ], + output: ` + import { something } from 'somewhere'; +import { createLogger } from '@/observability/logger'; + +const logger = createLogger(import.meta.url); + + const err = new Error('test'); + logger.error('Error occurred', { err }); + `, + }, + ], + }) + }) + + it('should transform console.error(error) to logger.error with message', () => { + ruleTester.run('use-custom-logger', rule, { + valid: [], + invalid: [ + { + code: ` + import { something } from 'somewhere'; + const error = new Error('test'); + console.error(error); + `, + errors: [ + { + message: 'Please use our internal logger.error instead of console.error', + }, + ], + output: ` + import { something } from 'somewhere'; +import { createLogger } from '@/observability/logger'; + +const logger = createLogger(import.meta.url); + + const error = new Error('test'); + logger.error('Error occurred', { error }); + `, + }, + ], + }) + }) + + it('should transform console.warn(err) to logger.warn with message', () => { + ruleTester.run('use-custom-logger', rule, { + valid: [], + invalid: [ + { + code: ` + import { something } from 'somewhere'; + const err = new Error('test'); + console.warn(err); + `, + errors: [ + { + message: 'Please use our internal logger.warn instead of console.warn', + }, + ], + output: ` + import { something } from 'somewhere'; +import { createLogger } from '@/observability/logger'; + +const logger = createLogger(import.meta.url); + + const err = new Error('test'); + logger.warn('Error occurred', { err }); + `, + }, + ], + }) + }) + + it('should transform console.error(e) to logger.error with message', () => { + ruleTester.run('use-custom-logger', rule, { + valid: [], + invalid: [ + { + code: ` + try { + throw new Error('test'); + } catch (e) { + console.error(e); + } + `, + errors: [ + { + message: 'Please use our internal logger.error instead of console.error', + }, + ], + output: `import { createLogger } from '@/observability/logger'; + +const logger = createLogger(import.meta.url); + + try { + throw new Error('test'); + } catch (e) { + logger.error('Error occurred', { e }); + } + `, + }, + ], + }) + }) + + it('should transform console.error(failBotError) to logger.error with message', () => { + ruleTester.run('use-custom-logger', rule, { + valid: [], + invalid: [ + { + code: ` + const failBotError = new Error('test'); + console.error(failBotError); + `, + errors: [ + { + message: 'Please use our internal logger.error instead of console.error', + }, + ], + output: `import { createLogger } from '@/observability/logger'; + +const logger = createLogger(import.meta.url); + + const failBotError = new Error('test'); + logger.error('Error occurred', { failBotError }); + `, + }, + ], + }) + }) + + it('should not transform console.error with message and error object', () => { + ruleTester.run('use-custom-logger', rule, { + valid: [], + invalid: [ + { + code: ` + const err = new Error('test'); + console.error('Something went wrong', err); + `, + errors: [ + { + message: 'Please use our internal logger.error instead of console.error', + }, + ], + output: `import { createLogger } from '@/observability/logger'; + +const logger = createLogger(import.meta.url); + + const err = new Error('test'); + logger.error('Something went wrong', err); + `, + }, + ], + }) + }) + + it('should not transform console.log with error variable', () => { + ruleTester.run('use-custom-logger', rule, { + valid: [], + invalid: [ + { + code: ` + const err = new Error('test'); + console.log(err); + `, + errors: [ + { + message: 'Please use our internal logger.info instead of console.log', + }, + ], + output: `import { createLogger } from '@/observability/logger'; + +const logger = createLogger(import.meta.url); + + const err = new Error('test'); + logger.info(err); + `, + }, + ], + }) + }) + + it('should handle logger variable with destructuring pattern', () => { + // This test ensures the rule recognizes logger variables from destructuring patterns + // and doesn't create a duplicate declaration + ruleTester.run('use-custom-logger', rule, { + valid: [], + invalid: [ + { + code: ` + const { logger } = something; + console.log('test'); + `, + errors: [ + { + message: 'Please use our internal logger.info instead of console.log', + }, + ], + // The auto-fix will add the import but not the declaration since logger exists via destructuring + output: `import { createLogger } from '@/observability/logger'; + + const { logger } = something; + logger.info('test'); + `, + }, + ], + }) + }) +}) diff --git a/src/eslint-rules/use-custom-logger/use-custom-logger.js b/src/eslint-rules/use-custom-logger/use-custom-logger.js new file mode 100644 index 000000000000..e498cb20e7db --- /dev/null +++ b/src/eslint-rules/use-custom-logger/use-custom-logger.js @@ -0,0 +1,179 @@ +module.exports = { + meta: { + type: "suggestion", + docs: { + description: "Use our internal logger instead of console", + category: "Best Practices", + recommended: false, + }, + fixable: "code", + schema: [], // no options + }, + create(context) { + const sourceCode = context.getSourceCode(); + // flag to ensure we add the logger setup only once per file + let setupInserted = false; + + // Check if the logger import is already present. + function needsLoggerImport() { + return !sourceCode.ast.body.some( + (node) => + node.type === "ImportDeclaration" && + node.source.value === "@/observability/logger", + ); + } + + // Check if a logger variable is already declared. + // This checks for both direct declarations (const logger = ...) and + // destructured patterns (const { logger } = ...). + function needsLoggerDeclaration() { + return !sourceCode.ast.body.some((node) => { + if (node.type === "VariableDeclaration") { + return node.declarations.some((decl) => { + // Check for direct identifier: const logger = ... + if (decl.id.type === "Identifier" && decl.id.name === "logger") { + return true; + } + // Check for destructured pattern: const { logger } = ... + if (decl.id.type === "ObjectPattern") { + return decl.id.properties.some( + (prop) => + prop.type === "Property" && + prop.key.type === "Identifier" && + prop.key.name === "logger", + ); + } + return false; + }); + } + return false; + }); + } + + // Retrieve the last import statement. + function getLastImportNode() { + const imports = sourceCode.ast.body.filter( + (node) => node.type === "ImportDeclaration", + ); + return imports.length > 0 ? imports[imports.length - 1] : null; + } + + return { + CallExpression(node) { + const callee = node.callee; + if ( + callee && + callee.type === "MemberExpression" && + callee.object && + callee.object.name === "console" && + callee.property && + ["log", "error", "debug", "warn"].includes(callee.property.name) + ) { + const method = callee.property.name; + // Determine the replacement method: "log" should become "info". + const newMethod = method === "log" ? "info" : method; + context.report({ + node: callee, + message: `Please use our internal logger.${newMethod} instead of console.${method}`, + fix(fixer) { + const fixes = []; + const args = node.arguments; + + // Replace 'console' with 'logger' + fixes.push(fixer.replaceText(callee.object, "logger")); + // Replace the property; if it's "log", change to "info" + fixes.push(fixer.replaceText(callee.property, newMethod)); + + // Check if we need to transform arguments for error-level methods + // If the first argument appears to be an error variable (common pattern: err, error, e) + // and there's only one argument, we should add a descriptive message + if ( + (newMethod === "error" || newMethod === "warn") && + args.length === 1 && + args[0].type === "Identifier" && + /^(err|error|e|.+Error|.+Err|failBotError|exception)$/i.test( + args[0].name, + ) + ) { + // Transform console.error(err) to logger.error('Error occurred', { err }) + // This makes the log message more useful and follows structured logging pattern + const errorVarName = sourceCode.getText(args[0]); + fixes.push( + fixer.replaceText( + args[0], + `'Error occurred', { ${errorVarName} }`, + ), + ); + } + + // Insert our logger setup (import + declaration) only once per file. + if (!setupInserted) { + setupInserted = true; + + const needsImport = needsLoggerImport(); + const needsDeclaration = needsLoggerDeclaration(); + const lastImport = getLastImportNode(); + + if (needsImport && needsDeclaration) { + // Insert both import and declaration together + if (lastImport) { + fixes.push( + fixer.insertTextAfter( + lastImport, + "\nimport { createLogger } from '@/observability/logger';\n\nconst logger = createLogger(import.meta.url);\n", + ), + ); + } else { + // No imports – insert at the top + fixes.push( + fixer.insertTextBeforeRange( + [0, 0], + "import { createLogger } from '@/observability/logger';\n\nconst logger = createLogger(import.meta.url);\n", + ), + ); + } + } else if (needsImport) { + // Only insert the import + if (lastImport) { + fixes.push( + fixer.insertTextAfter( + lastImport, + "\nimport { createLogger } from '@/observability/logger';", + ), + ); + } else { + fixes.push( + fixer.insertTextBeforeRange( + [0, 0], + "import { createLogger } from '@/observability/logger';\n", + ), + ); + } + } else if (needsDeclaration) { + // Only insert the logger declaration + if (lastImport) { + fixes.push( + fixer.insertTextAfter( + lastImport, + "\n\nconst logger = createLogger(import.meta.url);\n", + ), + ); + } else { + fixes.push( + fixer.insertTextAfterRange( + [0, 0], + "\nconst logger = createLogger(import.meta.url);\n", + ), + ); + } + } + } + + return fixes; + }, + }); + } + }, + }; + }, +}; diff --git a/src/observability/README.md b/src/observability/README.md index 4fb9f995a06c..732a12f97db2 100644 --- a/src/observability/README.md +++ b/src/observability/README.md @@ -16,6 +16,10 @@ This subject is responsible for: Note: This tracks system health, not user behavior. User behavior tracking is in [`src/events`](../events/README.md). +## Logging + +Please see the [logger README](./logger/README.md) for details on using the logger. + ## Architecture & Key Assets ### Key capabilities and their locations diff --git a/src/types/eslint-plugins.d.ts b/src/types/eslint-plugins.d.ts index acbb6a189037..9c948f7ae537 100644 --- a/src/types/eslint-plugins.d.ts +++ b/src/types/eslint-plugins.d.ts @@ -55,3 +55,11 @@ declare module 'eslint-plugin-no-only-tests' { export default plugin } + +declare module 'eslint-plugin-custom-rules' { + import type { ESLint } from 'eslint' + + const plugin: ESLint.Plugin + + export default plugin +} From d087bfe2d5e4f88a736cd7fcdfcd4d738b1e9653 Mon Sep 17 00:00:00 2001 From: Aaron Waggener <73763104+aaronwaggener@users.noreply.github.com> Date: Wed, 28 Jan 2026 12:42:45 -0800 Subject: [PATCH 8/8] Add hasExtendedMetadata as an optional field for Secret Scanning public-docs.yml (#58524) Co-authored-by: Kevin Heis --- src/secret-scanning/data/public-docs-schema.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/secret-scanning/data/public-docs-schema.ts b/src/secret-scanning/data/public-docs-schema.ts index c383e7da919c..5820116614b3 100644 --- a/src/secret-scanning/data/public-docs-schema.ts +++ b/src/secret-scanning/data/public-docs-schema.ts @@ -19,6 +19,7 @@ export interface SecretScanningEntry { isPrivateWithGhas: boolean | string hasPushProtection: boolean | string hasValidityCheck: boolean | string + hasExtendedMetadata?: boolean | string base64Supported: boolean | string isduplicate: boolean } @@ -67,6 +68,10 @@ export default { description: 'whether the secret has its validation status checked', type: ['boolean', 'string'], }, + hasExtendedMetadata: { + description: 'whether extended metadata is available for this secret', + type: ['boolean', 'string'], + }, base64Supported: { description: 'whether scanning for base64-encoded versions of this type is supported', type: ['boolean', 'string'],