From 48c71db35dcf15c80ed830764ab638afcc10d860 Mon Sep 17 00:00:00 2001 From: Shivanee Persaud Date: Tue, 4 Aug 2026 16:35:25 -0700 Subject: [PATCH 01/14] fix(ci): restore strict mode file detection and fix monorepo linter crashes --- .eslintrc.json | 64 +++++++++- .github/workflows/presubmit.yaml | 6 +- bin/linter.mjs | 113 ++++++++++++++---- .../gapic-generator-typescript/.eslintrc.json | 14 --- core/packages/gax/.eslintrc.json | 3 - core/packages/gaxios/.eslintrc.json | 3 - .../google-auth-library-nodejs/.eslintrc.json | 3 - core/packages/logging-utils/.eslintrc.json | 4 - .../nodejs-googleapis-common/.eslintrc.json | 3 - .../nodejs-proto-files/.eslintrc.json | 3 - core/packages/retry-request/.eslintrc.json | 3 - core/packages/teeny-request/.eslintrc.json | 3 - core/packages/tools/.eslintrc.json | 4 - handwritten/bigquery-storage/.eslintrc.json | 3 - handwritten/bigquery/.eslintrc.json | 4 - handwritten/cloud-profiler/.eslintrc.json | 3 - handwritten/datastore/.eslintrc.json | 3 - handwritten/error-reporting/.eslintrc.json | 3 - handwritten/firestore/.eslintrc.json | 66 ---------- handwritten/google-cloud-dns/.eslintrc.json | 3 - handwritten/logging-bunyan/.eslintrc.json | 3 - handwritten/logging-winston/.eslintrc.json | 3 - handwritten/logging/.eslintrc.json | 3 - handwritten/pubsub/.eslintrc.json | 3 - handwritten/spanner-driver/.eslintrc.json | 4 - handwritten/spanner/.eslintrc.json | 4 - handwritten/storage/.eslintrc.json | 3 - packages/.eslintrc.json | 4 - 28 files changed, 155 insertions(+), 183 deletions(-) delete mode 100644 core/generator/gapic-generator-typescript/.eslintrc.json delete mode 100644 core/packages/gax/.eslintrc.json delete mode 100644 core/packages/gaxios/.eslintrc.json delete mode 100644 core/packages/google-auth-library-nodejs/.eslintrc.json delete mode 100644 core/packages/logging-utils/.eslintrc.json delete mode 100644 core/packages/nodejs-googleapis-common/.eslintrc.json delete mode 100644 core/packages/nodejs-proto-files/.eslintrc.json delete mode 100644 core/packages/retry-request/.eslintrc.json delete mode 100644 core/packages/teeny-request/.eslintrc.json delete mode 100644 core/packages/tools/.eslintrc.json delete mode 100644 handwritten/bigquery-storage/.eslintrc.json delete mode 100644 handwritten/bigquery/.eslintrc.json delete mode 100644 handwritten/cloud-profiler/.eslintrc.json delete mode 100644 handwritten/datastore/.eslintrc.json delete mode 100644 handwritten/error-reporting/.eslintrc.json delete mode 100644 handwritten/firestore/.eslintrc.json delete mode 100644 handwritten/google-cloud-dns/.eslintrc.json delete mode 100644 handwritten/logging-bunyan/.eslintrc.json delete mode 100644 handwritten/logging-winston/.eslintrc.json delete mode 100644 handwritten/logging/.eslintrc.json delete mode 100644 handwritten/pubsub/.eslintrc.json delete mode 100644 handwritten/spanner-driver/.eslintrc.json delete mode 100644 handwritten/spanner/.eslintrc.json delete mode 100644 handwritten/storage/.eslintrc.json delete mode 100644 packages/.eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json index 4f9e1c4f2f1d..4f2191611cd7 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -7,14 +7,74 @@ "plugin:promise/recommended" ], "root": true, - // Note: All rules configured as "error" are blocking in the PR CI pipeline. - // Only rules configured as "warn" remain non-blocking. "rules": { "import/no-unresolved": "off", "import/no-extraneous-dependencies": "error", "promise/catch-or-return": "error", "promise/always-return": "error" }, + "overrides": [ + // The overrides below were migrated from handwritten/firestore/.eslintrc.json + // during monorepo ESLint consolidation to maintain Firestore-specific rules. + { + "files": ["handwritten/firestore/dev/src/**/*.ts"], + "excludedFiles": ["handwritten/firestore/dev/src/v1/*.ts", "handwritten/firestore/dev/src/v1beta1/*.ts"], + "parser": "@typescript-eslint/parser", + "rules": { + "@typescript-eslint/explicit-function-return-type": [ + "error", + { + "allowExpressions": true, + "allowTypedFunctionExpressions": true + } + ], + "no-console": ["error", {"allow": ["error"]}], + "@typescript-eslint/no-unused-vars": [ + "warn", + { + "argsIgnorePattern": "^_" + } + ] + } + }, + { + "files": ["handwritten/firestore/dev/test/*.ts", "handwritten/firestore/dev/system-test/*.ts"], + "parser": "@typescript-eslint/parser", + "rules": { + "no-restricted-properties": [ + "error", + { + "object": "describe", + "property": "only" + }, + { + "object": "it", + "property": "only" + } + ], + "@typescript-eslint/no-unused-vars": [ + "warn", + { + "argsIgnorePattern": "^_" + } + ], + "@typescript-eslint/no-floating-promises": "warn" + } + }, + { + "files": [ + "handwritten/firestore/dev/src/v1/**/*.ts", + "handwritten/firestore/dev/src/v1beta1/**/*.ts", + "handwritten/firestore/dev/test/gapic_firestore_v1.ts", + "handwritten/firestore/dev/test/gapic_firestore_admin_v1.ts", + "handwritten/firestore/dev/test/gapic_firestore_admin_v1.ts" + ], + "rules": { + "@typescript-eslint/no-explicit-any": ["off"], + "@typescript-eslint/no-floating-promises": ["off"] + } + } + ], "ignorePatterns": [ "**/node_modules", "**/build", diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index dc152e2bec88..c5de30eba54e 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -34,12 +34,14 @@ jobs: steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: - fetch-depth: 300 + fetch-depth: 2 persist-credentials: false - name: Use Node.js 24 uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: 24 - run: npm install - - run: npm run lint + - run: node ./bin/linter.mjs --strict name: Run monorepo linter + env: + GIT_DIFF_ARG: "HEAD^1" diff --git a/bin/linter.mjs b/bin/linter.mjs index bd9a976ca944..bfe383edf4a2 100755 --- a/bin/linter.mjs +++ b/bin/linter.mjs @@ -17,7 +17,7 @@ import {existsSync} from 'fs'; import path from 'path'; import {promisify} from 'util'; import {ESLint} from 'eslint'; -import ts from 'typescript'; +import * as ts from 'typescript'; // --- Globals & Promisified API Wrappers --- const execFileAsync = promisify(execFile); @@ -26,7 +26,13 @@ const tsconfigCache = new Map(); // --- Main Runner (Entry Point) --- async function run() { try { - const changedTsFiles = getChangedFiles(); + const isStrict = Boolean(process.argv.includes('--strict')); + let changedTsFiles; + if (isStrict) { + changedTsFiles = getChangedFilesStrict(); + } else { + changedTsFiles = getChangedFiles(); + } if (changedTsFiles.length === 0) { console.log('No TypeScript files changed. Skipping checks.'); @@ -63,6 +69,44 @@ function runGit(args, options = {}) { }); } +function getChangedFilesStrict() { + const gitDiffArg = process.env.GIT_DIFF_ARG; + + if (!gitDiffArg) { + throw new Error( + 'Strict mode is enabled, but GIT_DIFF_ARG environment variable or --git-diff-arg flag was not provided. ' + + 'Please set the GIT_DIFF_ARG environment variable or provide --git-diff-arg .' + ); + } + + console.log(`Strict mode enabled. Comparing using GIT_DIFF_ARG: ${gitDiffArg}`); + + const args = gitDiffArg.trim().split(/\s+/); + + try { + const output = runGit([ + 'diff', + '--name-only', + '--diff-filter=ACMRT', + ...args, + '--', + '*.ts', + ]); + return output + .split('\n') + .map(f => f.trim()) + .filter(f => f.length > 0 && existsSync(f)); + } catch (err) { + if (err.status !== 1) { + throw new Error( + `Strict mode error: git diff --quiet ${gitDiffArg} failed with exit code ${err.status}.\n` + + `Ensure that the git reference '${gitDiffArg}' exists locally and that you have fetched the required commits/branches.\n` + + `Details: ${String(err.stderr || err.message || '').trim()}` + ); + } + } +} + /** * Returns a list of changed TypeScript files comparing against target branches/references. */ @@ -126,37 +170,58 @@ async function checkEslint(filesToCheck) { return true; } - try { - const eslint = new ESLint(); - const results = await eslint.lintFiles(filesToCheck); - const formatter = await eslint.loadFormatter('stylish'); - const resultText = formatter.format(results); - - if (resultText) { - console.log(resultText); + // Group files by package directory to set tsconfigRootDir properly for typescript-eslint + const filesByPkg = new Map(); + for (const file of filesToCheck) { + const pkgDir = findTsconfigDir(file) || process.cwd(); + if (!filesByPkg.has(pkgDir)) { + filesByPkg.set(pkgDir, []); } + filesByPkg.get(pkgDir).push(file); + } - let hasBlockingErrors = false; + let hasBlockingErrors = false; - for (const fileResult of results) { - for (const message of fileResult.messages) { - // message.severity === 2 indicates an error-level rule configuration. - if (message.severity === 2) { - hasBlockingErrors = true; - } + for (const [pkgDir, files] of filesByPkg.entries()) { + try { + const absPkgDir = path.resolve(pkgDir); + const eslint = new ESLint({ + cwd: absPkgDir, + overrideConfig: { + parserOptions: { + tsconfigRootDir: absPkgDir, + }, + }, + }); + + const relativeFiles = files.map(f => path.relative(absPkgDir, path.resolve(f))); + const results = await eslint.lintFiles(relativeFiles); + const formatter = await eslint.loadFormatter('stylish'); + const resultText = formatter.format(results); + + if (resultText) { + console.log(resultText); } - } - if (hasBlockingErrors) { - console.error('\n[ERROR] ESLint violations were detected.'); - return false; + for (const fileResult of results) { + for (const message of fileResult.messages) { + if (message.severity === 2) { + hasBlockingErrors = true; + } + } + } + } catch (err) { + console.error(`\n[ERROR] Failed running ESLint in ${pkgDir}:`, err.message); + hasBlockingErrors = true; } + } - return true; - } catch (err) { - console.error('\n[ERROR] Failed running ESLint:', err.message); + if (hasBlockingErrors) { + console.error('\n[ERROR] ESLint violations were detected.'); return false; } + + return true; } // --- TypeScript Type Checker --- diff --git a/core/generator/gapic-generator-typescript/.eslintrc.json b/core/generator/gapic-generator-typescript/.eslintrc.json deleted file mode 100644 index eb6fa04d6bf5..000000000000 --- a/core/generator/gapic-generator-typescript/.eslintrc.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "./node_modules/gts", - "root": true, - "ignorePatterns": [ - "**/node_modules", - "**/build", - "**/system-test", - "**/test/fixtures", - "**/samples/generated", - "**/.coverage", - "**/coverage" - ] -} - \ No newline at end of file diff --git a/core/packages/gax/.eslintrc.json b/core/packages/gax/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/core/packages/gax/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/core/packages/gaxios/.eslintrc.json b/core/packages/gaxios/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/core/packages/gaxios/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/core/packages/google-auth-library-nodejs/.eslintrc.json b/core/packages/google-auth-library-nodejs/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/core/packages/google-auth-library-nodejs/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/core/packages/logging-utils/.eslintrc.json b/core/packages/logging-utils/.eslintrc.json deleted file mode 100644 index 3e8d97ccb390..000000000000 --- a/core/packages/logging-utils/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "./node_modules/gts", - "root": true -} diff --git a/core/packages/nodejs-googleapis-common/.eslintrc.json b/core/packages/nodejs-googleapis-common/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/core/packages/nodejs-googleapis-common/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/core/packages/nodejs-proto-files/.eslintrc.json b/core/packages/nodejs-proto-files/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/core/packages/nodejs-proto-files/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/core/packages/retry-request/.eslintrc.json b/core/packages/retry-request/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/core/packages/retry-request/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/core/packages/teeny-request/.eslintrc.json b/core/packages/teeny-request/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/core/packages/teeny-request/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/core/packages/tools/.eslintrc.json b/core/packages/tools/.eslintrc.json deleted file mode 100644 index 3e8d97ccb390..000000000000 --- a/core/packages/tools/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "./node_modules/gts", - "root": true -} diff --git a/handwritten/bigquery-storage/.eslintrc.json b/handwritten/bigquery-storage/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/bigquery-storage/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/bigquery/.eslintrc.json b/handwritten/bigquery/.eslintrc.json deleted file mode 100644 index 3e8d97ccb390..000000000000 --- a/handwritten/bigquery/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "./node_modules/gts", - "root": true -} diff --git a/handwritten/cloud-profiler/.eslintrc.json b/handwritten/cloud-profiler/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/cloud-profiler/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/datastore/.eslintrc.json b/handwritten/datastore/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/datastore/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/error-reporting/.eslintrc.json b/handwritten/error-reporting/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/error-reporting/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/firestore/.eslintrc.json b/handwritten/firestore/.eslintrc.json deleted file mode 100644 index 43f7fab3ea4b..000000000000 --- a/handwritten/firestore/.eslintrc.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "root": true, - "extends": "../../node_modules/gts", - "overrides": [ - { - "files": ["dev/src/**/*.ts"], - "excludedFiles": ["dev/src/v1/*.ts", "dev/src/v1beta1/*.ts"], - "parser": "@typescript-eslint/parser", - "rules": { - "@typescript-eslint/explicit-function-return-type": [ - "error", - { - "allowExpressions": true, - "allowTypedFunctionExpressions": true - } - ], - "no-console": ["error", {"allow": ["error"]}], - "@typescript-eslint/no-unused-vars": [ - "warn", - { - // Allow args to be unused if they start with an underscore - "argsIgnorePattern": "^_" - } - ] - } - }, - { - "files": ["dev/test/*.ts", "dev/system-test/*.ts"], - "parser": "@typescript-eslint/parser", - "rules": { - "no-restricted-properties": [ - "error", - { - "object": "describe", - "property": "only" - }, - { - "object": "it", - "property": "only" - } - ], - "@typescript-eslint/no-unused-vars": [ - "warn", - { - // Allow args to be unused if they start with an underscore - "argsIgnorePattern": "^_" - } - ], - "@typescript-eslint/no-floating-promises": "warn" - } - }, - { - "files": [ - "dev/src/v1/**/*.ts", - "dev/src/v1beta1/**/*.ts", - "dev/test/gapic_firestore_v1.ts", - "dev/test/gapic_firestore_admin_v1.ts", - "dev/test/gapic_firestore_admin_v1.ts" - ], - "rules": { - "@typescript-eslint/no-explicit-any": ["off"], - "@typescript-eslint/no-floating-promises": ["off"] - } - } - ] -} diff --git a/handwritten/google-cloud-dns/.eslintrc.json b/handwritten/google-cloud-dns/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/google-cloud-dns/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/logging-bunyan/.eslintrc.json b/handwritten/logging-bunyan/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/logging-bunyan/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/logging-winston/.eslintrc.json b/handwritten/logging-winston/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/logging-winston/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/logging/.eslintrc.json b/handwritten/logging/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/logging/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/pubsub/.eslintrc.json b/handwritten/pubsub/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/pubsub/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/spanner-driver/.eslintrc.json b/handwritten/spanner-driver/.eslintrc.json deleted file mode 100644 index aa462ccc3ae7..000000000000 --- a/handwritten/spanner-driver/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "root": true, - "extends": "./node_modules/gts" -} diff --git a/handwritten/spanner/.eslintrc.json b/handwritten/spanner/.eslintrc.json deleted file mode 100644 index aa462ccc3ae7..000000000000 --- a/handwritten/spanner/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "root": true, - "extends": "./node_modules/gts" -} diff --git a/handwritten/storage/.eslintrc.json b/handwritten/storage/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/storage/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/packages/.eslintrc.json b/packages/.eslintrc.json deleted file mode 100644 index 153f062d7fbe..000000000000 --- a/packages/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../node_modules/gts", - "root": true -} From f32bcfa203154113ff74c7b89db2226addb48782 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 5 Aug 2026 03:37:39 +0000 Subject: [PATCH 02/14] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- handwritten/bigquery/.eslintignore | 1 - handwritten/bigquery/.eslintrc.json | 3 +++ handwritten/bigtable/.eslintrc.json | 3 +++ handwritten/google-cloud-dns/.eslintrc.json | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 handwritten/bigquery/.eslintrc.json create mode 100644 handwritten/bigtable/.eslintrc.json create mode 100644 handwritten/google-cloud-dns/.eslintrc.json diff --git a/handwritten/bigquery/.eslintignore b/handwritten/bigquery/.eslintignore index 87a018350591..ea5b04aebe68 100644 --- a/handwritten/bigquery/.eslintignore +++ b/handwritten/bigquery/.eslintignore @@ -5,4 +5,3 @@ build/ docs/ protos/ samples/generated/ -system-test/fixtures diff --git a/handwritten/bigquery/.eslintrc.json b/handwritten/bigquery/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/handwritten/bigquery/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/handwritten/bigtable/.eslintrc.json b/handwritten/bigtable/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/handwritten/bigtable/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/handwritten/google-cloud-dns/.eslintrc.json b/handwritten/google-cloud-dns/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/handwritten/google-cloud-dns/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} From f79bd9420fb515ffc83b686d70835efa3606b413 Mon Sep 17 00:00:00 2001 From: Shivanee Persaud Date: Wed, 5 Aug 2026 10:51:35 -0700 Subject: [PATCH 03/14] fix(ci): handle undefined ts.sys in linter tsconfig resolution --- bin/linter.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/linter.mjs b/bin/linter.mjs index bfe383edf4a2..b57c0458837d 100755 --- a/bin/linter.mjs +++ b/bin/linter.mjs @@ -235,7 +235,7 @@ function findTsconfigDir(filePath) { if (tsconfigCache.has(dir)) { return tsconfigCache.get(dir); } - const configPath = ts.findConfigFile(dir, ts.sys.fileExists); + const configPath = ts.findConfigFile(dir, ts.sys?.fileExists ?? existsSync); const result = configPath ? path.dirname(configPath) : null; tsconfigCache.set(dir, result); return result; From 068454b3294b57221f9f4504d6a2c20538e377a7 Mon Sep 17 00:00:00 2001 From: Shivanee Persaud Date: Wed, 5 Aug 2026 10:55:59 -0700 Subject: [PATCH 04/14] fix(ci): update .eslintignore and ESLint resolution to prevent exit code 2 crashes --- .eslintignore | 13 ++++++++----- bin/linter.mjs | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.eslintignore b/.eslintignore index 0ca61147f73c..39a5dc966ca4 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,7 +1,10 @@ **/node_modules +**/build +**/system-test +**/test/fixtures +**/samples/generated +**/.coverage **/coverage -test/fixtures -build/ -docs/ -protos/ -packages/ +**/baselines +**/baselines-esm +**/.test-out* diff --git a/bin/linter.mjs b/bin/linter.mjs index b57c0458837d..804683e7b690 100755 --- a/bin/linter.mjs +++ b/bin/linter.mjs @@ -187,6 +187,7 @@ async function checkEslint(filesToCheck) { const absPkgDir = path.resolve(pkgDir); const eslint = new ESLint({ cwd: absPkgDir, + resolvePluginsRelativeTo: process.cwd(), overrideConfig: { parserOptions: { tsconfigRootDir: absPkgDir, From 5ec00499f8199742791a2960472056a95c371703 Mon Sep 17 00:00:00 2001 From: Shivanee Persaud Date: Wed, 5 Aug 2026 10:59:47 -0700 Subject: [PATCH 05/14] fix(ci): handle CJS and ESM default interop for typescript import --- bin/linter.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/linter.mjs b/bin/linter.mjs index 804683e7b690..f3f0b9ce8830 100755 --- a/bin/linter.mjs +++ b/bin/linter.mjs @@ -17,9 +17,10 @@ import {existsSync} from 'fs'; import path from 'path'; import {promisify} from 'util'; import {ESLint} from 'eslint'; -import * as ts from 'typescript'; +import * as tsModule from 'typescript'; // --- Globals & Promisified API Wrappers --- +const ts = tsModule.findConfigFile ? tsModule : (tsModule.default ?? tsModule); const execFileAsync = promisify(execFile); const tsconfigCache = new Map(); From 2454fe5862cdfb0adda27c04d27d69390977bae2 Mon Sep 17 00:00:00 2001 From: Shivanee Persaud Date: Wed, 5 Aug 2026 11:02:41 -0700 Subject: [PATCH 06/14] refactor(ci): simplify typescript import using standard default import --- bin/linter.mjs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bin/linter.mjs b/bin/linter.mjs index f3f0b9ce8830..e22741a0c5a0 100755 --- a/bin/linter.mjs +++ b/bin/linter.mjs @@ -17,10 +17,7 @@ import {existsSync} from 'fs'; import path from 'path'; import {promisify} from 'util'; import {ESLint} from 'eslint'; -import * as tsModule from 'typescript'; - -// --- Globals & Promisified API Wrappers --- -const ts = tsModule.findConfigFile ? tsModule : (tsModule.default ?? tsModule); +import ts from 'typescript'; const execFileAsync = promisify(execFile); const tsconfigCache = new Map(); From 5692bb8c0b3931aba3efb7bbc5901bb037cdb667 Mon Sep 17 00:00:00 2001 From: Shivanee Persaud Date: Wed, 5 Aug 2026 11:03:30 -0700 Subject: [PATCH 07/14] fix(ci): use createRequire to robustly import CommonJS typescript module in ESM --- bin/linter.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/linter.mjs b/bin/linter.mjs index e22741a0c5a0..38f294f6fda1 100755 --- a/bin/linter.mjs +++ b/bin/linter.mjs @@ -14,10 +14,13 @@ import {execFileSync, execFile} from 'child_process'; import {existsSync} from 'fs'; +import {createRequire} from 'module'; import path from 'path'; import {promisify} from 'util'; import {ESLint} from 'eslint'; -import ts from 'typescript'; + +const require = createRequire(import.meta.url); +const ts = require('typescript'); const execFileAsync = promisify(execFile); const tsconfigCache = new Map(); From 5d1cc1af4ee7ec54062d465923008c2d9fa27cbf Mon Sep 17 00:00:00 2001 From: Shivanee Persaud Date: Wed, 5 Aug 2026 11:16:41 -0700 Subject: [PATCH 08/14] fix(ci): replace ts.findConfigFile with pure Node directory traversal --- bin/linter.mjs | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/bin/linter.mjs b/bin/linter.mjs index 38f294f6fda1..685af5554c6c 100755 --- a/bin/linter.mjs +++ b/bin/linter.mjs @@ -14,13 +14,10 @@ import {execFileSync, execFile} from 'child_process'; import {existsSync} from 'fs'; -import {createRequire} from 'module'; import path from 'path'; import {promisify} from 'util'; import {ESLint} from 'eslint'; -const require = createRequire(import.meta.url); -const ts = require('typescript'); const execFileAsync = promisify(execFile); const tsconfigCache = new Map(); @@ -233,14 +230,23 @@ async function checkEslint(filesToCheck) { * Caches directories to avoid redundant disk operations. */ function findTsconfigDir(filePath) { - const dir = path.dirname(filePath); - if (tsconfigCache.has(dir)) { - return tsconfigCache.get(dir); + let currentDir = path.resolve(path.dirname(filePath)); + const root = path.parse(currentDir).root; + + while (currentDir && currentDir !== root) { + if (tsconfigCache.has(currentDir)) { + return tsconfigCache.get(currentDir); + } + const candidate = path.join(currentDir, 'tsconfig.json'); + if (existsSync(candidate)) { + tsconfigCache.set(path.dirname(filePath), currentDir); + return currentDir; + } + currentDir = path.dirname(currentDir); } - const configPath = ts.findConfigFile(dir, ts.sys?.fileExists ?? existsSync); - const result = configPath ? path.dirname(configPath) : null; - tsconfigCache.set(dir, result); - return result; + + tsconfigCache.set(path.dirname(filePath), null); + return null; } /** From 7aa80c69e06c8aba8035bf004ac2a2716dcc7e75 Mon Sep 17 00:00:00 2001 From: Shivanee Persaud Date: Wed, 5 Aug 2026 11:21:47 -0700 Subject: [PATCH 09/14] fix(ci): update .eslintignore and replace ts.findConfigFile with pure Node traversal --- .eslintignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.eslintignore b/.eslintignore index 39a5dc966ca4..f6afa108a544 100644 --- a/.eslintignore +++ b/.eslintignore @@ -8,3 +8,8 @@ **/baselines **/baselines-esm **/.test-out* +test/fixtures +build/ +docs/ +protos/ +packages/ From d1b11afa2b124bf5af96d1f5b9b467fa802fb54f Mon Sep 17 00:00:00 2001 From: Shivanee Persaud Date: Wed, 5 Aug 2026 11:27:33 -0700 Subject: [PATCH 10/14] fix(ci): use three-dot diff (ref...HEAD) in linter to avoid checking files modified on base branch --- .github/workflows/presubmit.yaml | 2 +- bin/linter.mjs | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index c5de30eba54e..8d57d62c60a1 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -44,4 +44,4 @@ jobs: - run: node ./bin/linter.mjs --strict name: Run monorepo linter env: - GIT_DIFF_ARG: "HEAD^1" + GIT_DIFF_ARG: "HEAD^1...HEAD" diff --git a/bin/linter.mjs b/bin/linter.mjs index 685af5554c6c..ee25bb9de4b3 100755 --- a/bin/linter.mjs +++ b/bin/linter.mjs @@ -68,7 +68,7 @@ function runGit(args, options = {}) { } function getChangedFilesStrict() { - const gitDiffArg = process.env.GIT_DIFF_ARG; + let gitDiffArg = process.env.GIT_DIFF_ARG; if (!gitDiffArg) { throw new Error( @@ -77,6 +77,12 @@ function getChangedFilesStrict() { ); } + // If a single ref is provided (e.g. "HEAD^1" or "origin/main"), convert to three-dot diff ("ref...HEAD") + // to compare against the merge-base and avoid listing files modified on the base branch. + if (!gitDiffArg.includes('..')) { + gitDiffArg = `${gitDiffArg}...HEAD`; + } + console.log(`Strict mode enabled. Comparing using GIT_DIFF_ARG: ${gitDiffArg}`); const args = gitDiffArg.trim().split(/\s+/); @@ -97,7 +103,7 @@ function getChangedFilesStrict() { } catch (err) { if (err.status !== 1) { throw new Error( - `Strict mode error: git diff --quiet ${gitDiffArg} failed with exit code ${err.status}.\n` + + `Strict mode error: git diff ${gitDiffArg} failed with exit code ${err.status}.\n` + `Ensure that the git reference '${gitDiffArg}' exists locally and that you have fetched the required commits/branches.\n` + `Details: ${String(err.stderr || err.message || '').trim()}` ); @@ -121,11 +127,12 @@ function getChangedFiles() { for (const ref of refsToTry) { try { + const diffRef = ref.includes('..') ? ref : `${ref}...HEAD`; const output = runGit([ 'diff', '--name-only', '--diff-filter=ACMRT', - ref, + diffRef, '--', '*.ts', ]); From ba993bce006567b1d942df272453150e4916b004 Mon Sep 17 00:00:00 2001 From: Shivanee Persaud Date: Wed, 5 Aug 2026 19:32:34 -0700 Subject: [PATCH 11/14] fix(ci): update eslint extends and ignore patterns to fix generator and linter tests --- .eslintignore | 1 + .eslintrc.json | 2 +- .../test/fixtures/leaky/.eslintrc.json | 2 +- .../tasks-v2-nodejs/.eslintrc.json | 2 +- .../tasks-v2beta2-nodejs/.eslintrc.json | 2 +- handwritten/bigquery/.eslintrc.json | 2 +- handwritten/bigquery/src/types.d.ts | 80 +++++++++++++++---- handwritten/google-cloud-dns/.eslintrc.json | 2 +- 8 files changed, 70 insertions(+), 23 deletions(-) diff --git a/.eslintignore b/.eslintignore index f6afa108a544..a85b04f0c719 100644 --- a/.eslintignore +++ b/.eslintignore @@ -13,3 +13,4 @@ build/ docs/ protos/ packages/ +**/types.d.ts diff --git a/.eslintrc.json b/.eslintrc.json index 4f2191611cd7..ab61da4fa66b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": [ - "./node_modules/gts", + "gts", "plugin:prettier/recommended", "plugin:import/recommended", "plugin:import/typescript", diff --git a/core/dev-packages/pack-n-play/test/fixtures/leaky/.eslintrc.json b/core/dev-packages/pack-n-play/test/fixtures/leaky/.eslintrc.json index f95bb333f0d7..b2eaa06fb89c 100644 --- a/core/dev-packages/pack-n-play/test/fixtures/leaky/.eslintrc.json +++ b/core/dev-packages/pack-n-play/test/fixtures/leaky/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "./node_modules/gts/" + "extends": "gts" } diff --git a/core/generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs/tasks-v2-nodejs/.eslintrc.json b/core/generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs/tasks-v2-nodejs/.eslintrc.json index 782153495464..b2eaa06fb89c 100644 --- a/core/generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs/tasks-v2-nodejs/.eslintrc.json +++ b/core/generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs/tasks-v2-nodejs/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "./node_modules/gts" + "extends": "gts" } diff --git a/core/generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs/tasks-v2beta2-nodejs/.eslintrc.json b/core/generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs/tasks-v2beta2-nodejs/.eslintrc.json index 782153495464..b2eaa06fb89c 100644 --- a/core/generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs/tasks-v2beta2-nodejs/.eslintrc.json +++ b/core/generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs/tasks-v2beta2-nodejs/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "./node_modules/gts" + "extends": "gts" } diff --git a/handwritten/bigquery/.eslintrc.json b/handwritten/bigquery/.eslintrc.json index 782153495464..b2eaa06fb89c 100644 --- a/handwritten/bigquery/.eslintrc.json +++ b/handwritten/bigquery/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "./node_modules/gts" + "extends": "gts" } diff --git a/handwritten/bigquery/src/types.d.ts b/handwritten/bigquery/src/types.d.ts index 0691e94effde..692d71de5560 100644 --- a/handwritten/bigquery/src/types.d.ts +++ b/handwritten/bigquery/src/types.d.ts @@ -389,7 +389,10 @@ declare namespace bigquery { * The log type that this config enables. */ logType?: - 'LOG_TYPE_UNSPECIFIED' | 'ADMIN_READ' | 'DATA_WRITE' | 'DATA_READ'; + | 'LOG_TYPE_UNSPECIFIED' + | 'ADMIN_READ' + | 'DATA_WRITE' + | 'DATA_READ'; }; /** @@ -454,7 +457,10 @@ declare namespace bigquery { * Output only. Specifies which mode of BI Engine acceleration was performed (if any). */ biEngineMode?: - 'ACCELERATION_MODE_UNSPECIFIED' | 'DISABLED' | 'PARTIAL' | 'FULL'; + | 'ACCELERATION_MODE_UNSPECIFIED' + | 'DISABLED' + | 'PARTIAL' + | 'FULL'; /** * In case of DISABLED or PARTIAL bi_engine_mode, these contain the explanatory reasons as to why BI Engine could not accelerate. In case the full query was accelerated, this field is not populated. */ @@ -1134,7 +1140,9 @@ declare namespace bigquery { * Optional. Updates storage_billing_model for the dataset. */ storageBillingModel?: - 'STORAGE_BILLING_MODEL_UNSPECIFIED' | 'LOGICAL' | 'PHYSICAL'; + | 'STORAGE_BILLING_MODEL_UNSPECIFIED' + | 'LOGICAL' + | 'PHYSICAL'; /** * Output only. Tags for the dataset. To provide tags as inputs, use the `resourceTags` field. */ @@ -1327,7 +1335,9 @@ declare namespace bigquery { * Output only. DML mode used. */ dmlMode?: - 'DML_MODE_UNSPECIFIED' | 'COARSE_GRAINED_DML' | 'FINE_GRAINED_DML'; + | 'DML_MODE_UNSPECIFIED' + | 'COARSE_GRAINED_DML' + | 'FINE_GRAINED_DML'; /** * Output only. Reason for disabling fine-grained DML if applicable. */ @@ -1763,7 +1773,9 @@ declare namespace bigquery { * Optional. Metadata Cache Mode for the table. Set this to enable caching of metadata from external data source. */ metadataCacheMode?: - 'METADATA_CACHE_MODE_UNSPECIFIED' | 'AUTOMATIC' | 'MANUAL'; + | 'METADATA_CACHE_MODE_UNSPECIFIED' + | 'AUTOMATIC' + | 'MANUAL'; /** * Optional. ObjectMetadata is used to create Object Tables. Object Tables contain a listing of objects (with their metadata) found at the source_uris. If ObjectMetadata is set, source_format should be omitted. Currently SIMPLE is the only supported Object Metadata type. */ @@ -2364,7 +2376,9 @@ declare namespace bigquery { * Output only. Reason why incremental query results are/were not written by the query. */ disabledReason?: - 'DISABLED_REASON_UNSPECIFIED' | 'OTHER' | 'UNSUPPORTED_OPERATOR'; + | 'DISABLED_REASON_UNSPECIFIED' + | 'OTHER' + | 'UNSUPPORTED_OPERATOR'; /** * Output only. Additional human-readable clarification, if available, for DisabledReason. */ @@ -2737,7 +2751,10 @@ declare namespace bigquery { * Optional. Character map supported for column names in CSV/Parquet loads. Defaults to STRICT and can be overridden by Project Config Service. Using this option with unsupporting load formats will result in an error. */ columnNameCharacterMap?: - 'COLUMN_NAME_CHARACTER_MAP_UNSPECIFIED' | 'STRICT' | 'V1' | 'V2'; + | 'COLUMN_NAME_CHARACTER_MAP_UNSPECIFIED' + | 'STRICT' + | 'V1' + | 'V2'; /** * Optional. Connection properties which can modify the load job behavior. Currently, only the 'session_id' connection property is supported, and is used to resolve _SESSION appearing as the dataset id. */ @@ -3046,7 +3063,11 @@ declare namespace bigquery { * Optional. Supported operation types in table copy job. */ operationType?: - 'OPERATION_TYPE_UNSPECIFIED' | 'COPY' | 'SNAPSHOT' | 'RESTORE' | 'CLONE'; + | 'OPERATION_TYPE_UNSPECIFIED' + | 'COPY' + | 'SNAPSHOT' + | 'RESTORE' + | 'CLONE'; /** * [Pick one] Source table to copy. */ @@ -3872,7 +3893,9 @@ declare namespace bigquery { * Output only. Training type of the job. */ trainingType?: - 'TRAINING_TYPE_UNSPECIFIED' | 'SINGLE_TRAINING' | 'HPARAM_TUNING'; + | 'TRAINING_TYPE_UNSPECIFIED' + | 'SINGLE_TRAINING' + | 'HPARAM_TUNING'; }; type IModel = { @@ -4482,7 +4505,9 @@ declare namespace bigquery { * Optional. The query results format. If the value is anything other than `STRUCT_ENCODING` or unspecified: * The schema of the results will be provided in `QueryResponse.results_schema` field. * The results of the first page will be provided in `QueryResponse.results` field. * The `QueryResponse.rows` will not be populated. * The `QueryResponse.schema` for `QueryResponse.rows` will also not be populated since it is the schema of the `QueryResponse.rows`. This feature is not yet available. */ queryResultsFormat?: - 'QUERY_RESULTS_FORMAT_UNSPECIFIED' | 'STRUCT_ENCODING' | 'ARROW'; + | 'QUERY_RESULTS_FORMAT_UNSPECIFIED' + | 'STRUCT_ENCODING' + | 'ARROW'; /** * Optional. A unique user provided identifier to ensure idempotent behavior for queries. Note that this is different from the job_id. It has the following properties: 1. It is case-sensitive, limited to up to 36 ASCII characters. A UUID is recommended. 2. Read only queries can ignore this token since they are nullipotent by definition. 3. For the purposes of idempotency ensured by the request_id, a request is considered duplicate of another only if they have the same request_id and are actually duplicates. When determining whether a request is a duplicate of another request, all parameters in the request that may affect the result are considered. For example, query, connection_properties, query_parameters, use_legacy_sql are parameters that affect the result and are considered when determining whether a request is a duplicate, but properties like timeout_ms don't affect the result and are thus not considered. Dry run query requests are never considered duplicate of another request. 4. When a duplicate mutating query request is detected, it returns: a. the results of the mutation if it completes successfully within the timeout. b. the running operation if it is still in progress at the end of the timeout. 5. Its lifetime is limited to 15 minutes. In other words, if two requests are sent with the same request_id, but more than 15 minutes apart, idempotency is not guaranteed. */ @@ -4824,7 +4849,9 @@ declare namespace bigquery { * Optional. The determinism level of the JavaScript UDF, if defined. */ determinismLevel?: - 'DETERMINISM_LEVEL_UNSPECIFIED' | 'DETERMINISTIC' | 'NOT_DETERMINISTIC'; + | 'DETERMINISM_LEVEL_UNSPECIFIED' + | 'DETERMINISTIC' + | 'NOT_DETERMINISTIC'; /** * Output only. A hash of this resource. */ @@ -4906,7 +4933,10 @@ declare namespace bigquery { * Output only. The current build state of the routine. */ buildState?: - 'BUILD_STATE_UNSPECIFIED' | 'IN_PROGRESS' | 'SUCCEEDED' | 'FAILED'; + | 'BUILD_STATE_UNSPECIFIED' + | 'IN_PROGRESS' + | 'SUCCEEDED' + | 'FAILED'; /** * Output only. The time when the build state was updated last. */ @@ -5023,7 +5053,9 @@ declare namespace bigquery { * Determines which statement in the script represents the "key result", used to populate the schema and query results of the script job. Default is LAST. */ keyResultStatement?: - 'KEY_RESULT_STATEMENT_KIND_UNSPECIFIED' | 'LAST' | 'FIRST_SELECT'; + | 'KEY_RESULT_STATEMENT_KIND_UNSPECIFIED' + | 'LAST' + | 'FIRST_SELECT'; /** * Limit on the number of bytes billed per statement. Exceeding this budget results in an error. */ @@ -6237,7 +6269,12 @@ declare namespace bigquery { * Enums for color space, used for processing images in Object Table. See more details at https://www.tensorflow.org/io/tutorials/colorspace. */ colorSpace?: - 'COLOR_SPACE_UNSPECIFIED' | 'RGB' | 'HSV' | 'YIQ' | 'YUV' | 'GRAYSCALE'; + | 'COLOR_SPACE_UNSPECIFIED' + | 'RGB' + | 'HSV' + | 'YIQ' + | 'YUV' + | 'GRAYSCALE'; /** * Subsample ratio of columns for each level for boosted tree models. */ @@ -6578,7 +6615,9 @@ declare namespace bigquery { * The strategy to determine learn rate for the current iteration. */ learnRateStrategy?: - 'LEARN_RATE_STRATEGY_UNSPECIFIED' | 'LINE_SEARCH' | 'CONSTANT'; + | 'LEARN_RATE_STRATEGY_UNSPECIFIED' + | 'LINE_SEARCH' + | 'CONSTANT'; /** * Type of loss function used during training run. */ @@ -6746,7 +6785,11 @@ declare namespace bigquery { * Tree construction algorithm for boosted tree models. */ treeMethod?: - 'TREE_METHOD_UNSPECIFIED' | 'AUTO' | 'EXACT' | 'APPROX' | 'HIST'; + | 'TREE_METHOD_UNSPECIFIED' + | 'AUTO' + | 'EXACT' + | 'APPROX' + | 'HIST'; /** * Smoothing window size for the trend component. When a positive value is specified, a center moving average smoothing is applied on the history trend. When the smoothing window is out of the boundary at the beginning or the end of the trend, the first element or the last element is padded to fill the smoothing window before the average is applied. */ @@ -7266,7 +7309,10 @@ declare namespace bigquery { * Optional. Specifies the view that determines which table information is returned. By default, basic table information and storage statistics (STORAGE_STATS) are returned. */ view?: - 'TABLE_METADATA_VIEW_UNSPECIFIED' | 'BASIC' | 'STORAGE_STATS' | 'FULL'; + | 'TABLE_METADATA_VIEW_UNSPECIFIED' + | 'BASIC' + | 'STORAGE_STATS' + | 'FULL'; }; /** diff --git a/handwritten/google-cloud-dns/.eslintrc.json b/handwritten/google-cloud-dns/.eslintrc.json index 782153495464..b2eaa06fb89c 100644 --- a/handwritten/google-cloud-dns/.eslintrc.json +++ b/handwritten/google-cloud-dns/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "./node_modules/gts" + "extends": "gts" } From fe69e5acfd6bd5d191fc31eec2ebbd4acb43edb3 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 6 Aug 2026 02:48:14 +0000 Subject: [PATCH 12/14] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- handwritten/bigquery/.eslintrc.json | 2 +- handwritten/bigquery/src/types.d.ts | 80 +++++---------------- handwritten/google-cloud-dns/.eslintrc.json | 2 +- 3 files changed, 19 insertions(+), 65 deletions(-) diff --git a/handwritten/bigquery/.eslintrc.json b/handwritten/bigquery/.eslintrc.json index b2eaa06fb89c..782153495464 100644 --- a/handwritten/bigquery/.eslintrc.json +++ b/handwritten/bigquery/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "gts" + "extends": "./node_modules/gts" } diff --git a/handwritten/bigquery/src/types.d.ts b/handwritten/bigquery/src/types.d.ts index 692d71de5560..0691e94effde 100644 --- a/handwritten/bigquery/src/types.d.ts +++ b/handwritten/bigquery/src/types.d.ts @@ -389,10 +389,7 @@ declare namespace bigquery { * The log type that this config enables. */ logType?: - | 'LOG_TYPE_UNSPECIFIED' - | 'ADMIN_READ' - | 'DATA_WRITE' - | 'DATA_READ'; + 'LOG_TYPE_UNSPECIFIED' | 'ADMIN_READ' | 'DATA_WRITE' | 'DATA_READ'; }; /** @@ -457,10 +454,7 @@ declare namespace bigquery { * Output only. Specifies which mode of BI Engine acceleration was performed (if any). */ biEngineMode?: - | 'ACCELERATION_MODE_UNSPECIFIED' - | 'DISABLED' - | 'PARTIAL' - | 'FULL'; + 'ACCELERATION_MODE_UNSPECIFIED' | 'DISABLED' | 'PARTIAL' | 'FULL'; /** * In case of DISABLED or PARTIAL bi_engine_mode, these contain the explanatory reasons as to why BI Engine could not accelerate. In case the full query was accelerated, this field is not populated. */ @@ -1140,9 +1134,7 @@ declare namespace bigquery { * Optional. Updates storage_billing_model for the dataset. */ storageBillingModel?: - | 'STORAGE_BILLING_MODEL_UNSPECIFIED' - | 'LOGICAL' - | 'PHYSICAL'; + 'STORAGE_BILLING_MODEL_UNSPECIFIED' | 'LOGICAL' | 'PHYSICAL'; /** * Output only. Tags for the dataset. To provide tags as inputs, use the `resourceTags` field. */ @@ -1335,9 +1327,7 @@ declare namespace bigquery { * Output only. DML mode used. */ dmlMode?: - | 'DML_MODE_UNSPECIFIED' - | 'COARSE_GRAINED_DML' - | 'FINE_GRAINED_DML'; + 'DML_MODE_UNSPECIFIED' | 'COARSE_GRAINED_DML' | 'FINE_GRAINED_DML'; /** * Output only. Reason for disabling fine-grained DML if applicable. */ @@ -1773,9 +1763,7 @@ declare namespace bigquery { * Optional. Metadata Cache Mode for the table. Set this to enable caching of metadata from external data source. */ metadataCacheMode?: - | 'METADATA_CACHE_MODE_UNSPECIFIED' - | 'AUTOMATIC' - | 'MANUAL'; + 'METADATA_CACHE_MODE_UNSPECIFIED' | 'AUTOMATIC' | 'MANUAL'; /** * Optional. ObjectMetadata is used to create Object Tables. Object Tables contain a listing of objects (with their metadata) found at the source_uris. If ObjectMetadata is set, source_format should be omitted. Currently SIMPLE is the only supported Object Metadata type. */ @@ -2376,9 +2364,7 @@ declare namespace bigquery { * Output only. Reason why incremental query results are/were not written by the query. */ disabledReason?: - | 'DISABLED_REASON_UNSPECIFIED' - | 'OTHER' - | 'UNSUPPORTED_OPERATOR'; + 'DISABLED_REASON_UNSPECIFIED' | 'OTHER' | 'UNSUPPORTED_OPERATOR'; /** * Output only. Additional human-readable clarification, if available, for DisabledReason. */ @@ -2751,10 +2737,7 @@ declare namespace bigquery { * Optional. Character map supported for column names in CSV/Parquet loads. Defaults to STRICT and can be overridden by Project Config Service. Using this option with unsupporting load formats will result in an error. */ columnNameCharacterMap?: - | 'COLUMN_NAME_CHARACTER_MAP_UNSPECIFIED' - | 'STRICT' - | 'V1' - | 'V2'; + 'COLUMN_NAME_CHARACTER_MAP_UNSPECIFIED' | 'STRICT' | 'V1' | 'V2'; /** * Optional. Connection properties which can modify the load job behavior. Currently, only the 'session_id' connection property is supported, and is used to resolve _SESSION appearing as the dataset id. */ @@ -3063,11 +3046,7 @@ declare namespace bigquery { * Optional. Supported operation types in table copy job. */ operationType?: - | 'OPERATION_TYPE_UNSPECIFIED' - | 'COPY' - | 'SNAPSHOT' - | 'RESTORE' - | 'CLONE'; + 'OPERATION_TYPE_UNSPECIFIED' | 'COPY' | 'SNAPSHOT' | 'RESTORE' | 'CLONE'; /** * [Pick one] Source table to copy. */ @@ -3893,9 +3872,7 @@ declare namespace bigquery { * Output only. Training type of the job. */ trainingType?: - | 'TRAINING_TYPE_UNSPECIFIED' - | 'SINGLE_TRAINING' - | 'HPARAM_TUNING'; + 'TRAINING_TYPE_UNSPECIFIED' | 'SINGLE_TRAINING' | 'HPARAM_TUNING'; }; type IModel = { @@ -4505,9 +4482,7 @@ declare namespace bigquery { * Optional. The query results format. If the value is anything other than `STRUCT_ENCODING` or unspecified: * The schema of the results will be provided in `QueryResponse.results_schema` field. * The results of the first page will be provided in `QueryResponse.results` field. * The `QueryResponse.rows` will not be populated. * The `QueryResponse.schema` for `QueryResponse.rows` will also not be populated since it is the schema of the `QueryResponse.rows`. This feature is not yet available. */ queryResultsFormat?: - | 'QUERY_RESULTS_FORMAT_UNSPECIFIED' - | 'STRUCT_ENCODING' - | 'ARROW'; + 'QUERY_RESULTS_FORMAT_UNSPECIFIED' | 'STRUCT_ENCODING' | 'ARROW'; /** * Optional. A unique user provided identifier to ensure idempotent behavior for queries. Note that this is different from the job_id. It has the following properties: 1. It is case-sensitive, limited to up to 36 ASCII characters. A UUID is recommended. 2. Read only queries can ignore this token since they are nullipotent by definition. 3. For the purposes of idempotency ensured by the request_id, a request is considered duplicate of another only if they have the same request_id and are actually duplicates. When determining whether a request is a duplicate of another request, all parameters in the request that may affect the result are considered. For example, query, connection_properties, query_parameters, use_legacy_sql are parameters that affect the result and are considered when determining whether a request is a duplicate, but properties like timeout_ms don't affect the result and are thus not considered. Dry run query requests are never considered duplicate of another request. 4. When a duplicate mutating query request is detected, it returns: a. the results of the mutation if it completes successfully within the timeout. b. the running operation if it is still in progress at the end of the timeout. 5. Its lifetime is limited to 15 minutes. In other words, if two requests are sent with the same request_id, but more than 15 minutes apart, idempotency is not guaranteed. */ @@ -4849,9 +4824,7 @@ declare namespace bigquery { * Optional. The determinism level of the JavaScript UDF, if defined. */ determinismLevel?: - | 'DETERMINISM_LEVEL_UNSPECIFIED' - | 'DETERMINISTIC' - | 'NOT_DETERMINISTIC'; + 'DETERMINISM_LEVEL_UNSPECIFIED' | 'DETERMINISTIC' | 'NOT_DETERMINISTIC'; /** * Output only. A hash of this resource. */ @@ -4933,10 +4906,7 @@ declare namespace bigquery { * Output only. The current build state of the routine. */ buildState?: - | 'BUILD_STATE_UNSPECIFIED' - | 'IN_PROGRESS' - | 'SUCCEEDED' - | 'FAILED'; + 'BUILD_STATE_UNSPECIFIED' | 'IN_PROGRESS' | 'SUCCEEDED' | 'FAILED'; /** * Output only. The time when the build state was updated last. */ @@ -5053,9 +5023,7 @@ declare namespace bigquery { * Determines which statement in the script represents the "key result", used to populate the schema and query results of the script job. Default is LAST. */ keyResultStatement?: - | 'KEY_RESULT_STATEMENT_KIND_UNSPECIFIED' - | 'LAST' - | 'FIRST_SELECT'; + 'KEY_RESULT_STATEMENT_KIND_UNSPECIFIED' | 'LAST' | 'FIRST_SELECT'; /** * Limit on the number of bytes billed per statement. Exceeding this budget results in an error. */ @@ -6269,12 +6237,7 @@ declare namespace bigquery { * Enums for color space, used for processing images in Object Table. See more details at https://www.tensorflow.org/io/tutorials/colorspace. */ colorSpace?: - | 'COLOR_SPACE_UNSPECIFIED' - | 'RGB' - | 'HSV' - | 'YIQ' - | 'YUV' - | 'GRAYSCALE'; + 'COLOR_SPACE_UNSPECIFIED' | 'RGB' | 'HSV' | 'YIQ' | 'YUV' | 'GRAYSCALE'; /** * Subsample ratio of columns for each level for boosted tree models. */ @@ -6615,9 +6578,7 @@ declare namespace bigquery { * The strategy to determine learn rate for the current iteration. */ learnRateStrategy?: - | 'LEARN_RATE_STRATEGY_UNSPECIFIED' - | 'LINE_SEARCH' - | 'CONSTANT'; + 'LEARN_RATE_STRATEGY_UNSPECIFIED' | 'LINE_SEARCH' | 'CONSTANT'; /** * Type of loss function used during training run. */ @@ -6785,11 +6746,7 @@ declare namespace bigquery { * Tree construction algorithm for boosted tree models. */ treeMethod?: - | 'TREE_METHOD_UNSPECIFIED' - | 'AUTO' - | 'EXACT' - | 'APPROX' - | 'HIST'; + 'TREE_METHOD_UNSPECIFIED' | 'AUTO' | 'EXACT' | 'APPROX' | 'HIST'; /** * Smoothing window size for the trend component. When a positive value is specified, a center moving average smoothing is applied on the history trend. When the smoothing window is out of the boundary at the beginning or the end of the trend, the first element or the last element is padded to fill the smoothing window before the average is applied. */ @@ -7309,10 +7266,7 @@ declare namespace bigquery { * Optional. Specifies the view that determines which table information is returned. By default, basic table information and storage statistics (STORAGE_STATS) are returned. */ view?: - | 'TABLE_METADATA_VIEW_UNSPECIFIED' - | 'BASIC' - | 'STORAGE_STATS' - | 'FULL'; + 'TABLE_METADATA_VIEW_UNSPECIFIED' | 'BASIC' | 'STORAGE_STATS' | 'FULL'; }; /** diff --git a/handwritten/google-cloud-dns/.eslintrc.json b/handwritten/google-cloud-dns/.eslintrc.json index b2eaa06fb89c..782153495464 100644 --- a/handwritten/google-cloud-dns/.eslintrc.json +++ b/handwritten/google-cloud-dns/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "gts" + "extends": "./node_modules/gts" } From 0fb23e169e34361733cb2930b549cc3a36604fce Mon Sep 17 00:00:00 2001 From: Shivanee Persaud Date: Wed, 5 Aug 2026 20:29:56 -0700 Subject: [PATCH 13/14] fix(deps): upgrade c8 to ^10.1.3 in cloud-profiler and logging to resolve yargs Node 24 ESM error --- handwritten/cloud-profiler/package.json | 2 +- handwritten/logging/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/handwritten/cloud-profiler/package.json b/handwritten/cloud-profiler/package.json index c5e3a3ceedfc..9e7c82e87938 100644 --- a/handwritten/cloud-profiler/package.json +++ b/handwritten/cloud-profiler/package.json @@ -55,7 +55,7 @@ "@types/pretty-ms": "^5.0.0", "@types/sinon": "^17.0.0", "@types/tmp": "0.2.6", - "c8": "^9.0.0", + "c8": "^10.1.3", "codecov": "^3.0.0", "gts": "^5.0.0", "js-green-licenses": "^4.0.0", diff --git a/handwritten/logging/package.json b/handwritten/logging/package.json index 2bc3118963f1..3c7de9083f81 100644 --- a/handwritten/logging/package.json +++ b/handwritten/logging/package.json @@ -82,7 +82,7 @@ "@types/pumpify": "^1.4.1", "@types/sinon": "^10.0.0", "bignumber.js": "^9.0.0", - "c8": "^9.0.0", + "c8": "^10.1.3", "codecov": "^3.6.5", "cross-env": "^7.0.3", "gapic-tools": "^0.4.0", From c3aa58619b2942a6e84d38ff39c8349e27852e6b Mon Sep 17 00:00:00 2001 From: Shivanee Persaud Date: Thu, 6 Aug 2026 19:37:46 -0700 Subject: [PATCH 14/14] fix: upgrade mocha to ^11.1.0 and restore generator .eslintrc.json --- .../gapic-generator-typescript/.eslintrc.json | 13 +++++++++++++ handwritten/cloud-profiler/package.json | 2 +- handwritten/logging/package.json | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 core/generator/gapic-generator-typescript/.eslintrc.json diff --git a/core/generator/gapic-generator-typescript/.eslintrc.json b/core/generator/gapic-generator-typescript/.eslintrc.json new file mode 100644 index 000000000000..5763334a168f --- /dev/null +++ b/core/generator/gapic-generator-typescript/.eslintrc.json @@ -0,0 +1,13 @@ +{ + "extends": "./node_modules/gts", + "root": true, + "ignorePatterns": [ + "**/node_modules", + "**/build", + "**/system-test", + "**/test/fixtures", + "**/samples/generated", + "**/.coverage", + "**/coverage" + ] +} \ No newline at end of file diff --git a/handwritten/cloud-profiler/package.json b/handwritten/cloud-profiler/package.json index 9e7c82e87938..f5a1bbbc1eb6 100644 --- a/handwritten/cloud-profiler/package.json +++ b/handwritten/cloud-profiler/package.json @@ -63,7 +63,7 @@ "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", "long": "^5.3.2", - "mocha": "^9.2.2", + "mocha": "^11.1.0", "nock": "^13.0.0", "node-gyp": "^11.5.0", "sinon": "^18.0.0", diff --git a/handwritten/logging/package.json b/handwritten/logging/package.json index 3c7de9083f81..72a0fef66ea0 100644 --- a/handwritten/logging/package.json +++ b/handwritten/logging/package.json @@ -91,7 +91,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "mocha": "^9.2.2", + "mocha": "^11.1.0", "nock": "^13.0.0", "null-loader": "^4.0.0", "pack-n-play": "^2.0.0",