Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f85e89d
fix(core): discovery url handling, error code review helper, and pack…
bshaffer Aug 3, 2026
639081b
fix(gcp-metadata): use recursive getErrorCodes helper for nested wrap…
bshaffer Aug 3, 2026
4bc3be3
chore(core): remove pack-n-play timeout fixes (moved to #9021)
bshaffer Aug 3, 2026
ef76bc0
chore(core): add pack-n-play timeout fixes back to core PR
bshaffer Aug 3, 2026
ac1f478
add tests for error.cause and AggregateError
bshaffer Aug 3, 2026
66743ae
feat(ci): add matrix sharding for unit test performance
bshaffer Aug 4, 2026
491aba8
core test fixes
bshaffer Aug 4, 2026
15e7e0a
Merge branch 'main' into improve-test-performance
bshaffer Aug 5, 2026
4339fd1
revert unnecessary addition of port
bshaffer Aug 5, 2026
dc343c6
Revert "core test fixes"
bshaffer Aug 5, 2026
e13a364
Merge branch 'core-ci-fixes' into improve-test-performance
bshaffer Aug 5, 2026
3573acb
Merge branch 'main' into improve-test-performance
bshaffer Aug 5, 2026
cce72d4
Merge branch 'main' into improve-test-performance
bshaffer Aug 6, 2026
d5aeba8
fix regressions from recent PRs
bshaffer Aug 7, 2026
40133a2
attempt to fix bigtable unit tests
bshaffer Aug 7, 2026
5259b8f
increase timeouts for pack-n-play
bshaffer Aug 10, 2026
ad7d031
Merge branch 'main' into improve-test-performance
bshaffer Aug 11, 2026
ff66947
Apply suggestion from @bshaffer
bshaffer Aug 11, 2026
646734e
Apply suggestion from @bshaffer
bshaffer Aug 11, 2026
3234034
change DRY_RUN_SHARD to RUN_TESTS_MDOE and fix merge
bshaffer Aug 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/actions/calculate-shard-matrix/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Calculate Shard Matrix"
description: "Calculates the dynamic test shard matrix and shard total"
outputs:
shard_matrix:
description: "JSON array of shard indices"
value: ${{ steps.set-matrix.outputs.shard_matrix }}
shard_total:
description: "Total number of shards"
value: ${{ steps.set-matrix.outputs.shard_total }}
runs:
using: "composite"
steps:
- name: Calculate Matrix
id: set-matrix
shell: bash
env:
RUN_TESTS_MODE: CALCULATE_SHARD_MATRIX
BUILD_TYPE: presubmit
TEST_TYPE: units
GIT_DIFF_ARG: "HEAD^1"
run: |
bash ci/run_conditional_tests.sh --strict
31 changes: 31 additions & 0 deletions .github/actions/check-shard-status/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Check Shard Status"
description: "Checks if all unit test shards passed for a given Node version"
inputs:
node-version:
required: true
description: "Node version to check"
runs:
using: "composite"
steps:
- name: Check shard status
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
script: |
const { data: { jobs } } = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId,
});
const nodeVersion = '${{ inputs.node-version }}';
const shardJobs = jobs.filter(j => j.name.includes(`units (Node ${nodeVersion},`));
if (shardJobs.length === 0) {
core.setFailed(`No shard jobs found for Node ${nodeVersion}`);
return;
}
const failed = shardJobs.filter(j => j.conclusion !== 'success');
if (failed.length > 0) {
const failedLinks = failed.map(j => `- ${j.name}: ${j.html_url}`).join('\n');
core.setFailed(`${failed.length} shards failed for Node ${nodeVersion}:\n${failedLinks}`);
} else {
core.info(`All shards passed for Node ${nodeVersion}`);
}
34 changes: 34 additions & 0 deletions .github/actions/run-unit-tests/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Run Unit Test Shard"
description: "Sets up Node.js, pnpm, and runs a unit test shard"
inputs:
node-version:
required: true
description: "Node.js version to test"
shard-total:
required: true
description: "Total number of shards"
shard-index:
required: true
description: "0-based shard index"
runs:
using: "composite"
steps:
- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: ${{ inputs.node-version }}
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with:
version: ^10.0.0
- run: node --version
shell: bash
- name: Run unit tests
shell: bash
run: bash ci/run_conditional_tests.sh --strict
env:
RUN_TESTS_MODE: RUN_UNIT_TESTS
BUILD_TYPE: presubmit
TEST_TYPE: units
SHARD_TOTAL: ${{ inputs.shard-total }}
SHARD_INDEX: ${{ inputs.shard-index }}
GIT_DIFF_ARG: HEAD^1
51 changes: 39 additions & 12 deletions .github/workflows/presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,37 @@ on:
pull_request:
name: presubmit
jobs:
setup:
runs-on: ubuntu-latest
outputs:
shard-matrix: ${{ steps.set-matrix.outputs.shard_matrix }}
shard-total: ${{ steps.set-matrix.outputs.shard_total }}
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 2
persist-credentials: false
- id: set-matrix
uses: ./.github/actions/calculate-shard-matrix
units:
needs: setup
name: units (Node ${{ matrix.node-version }}, Shard ${{ matrix.shard-index }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [22, 24, 26]
shard-index: ${{ fromJSON(needs.setup.outputs.shard-matrix) }}
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 300
fetch-depth: 2
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
- uses: ./.github/actions/run-unit-tests
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with:
version: ^10.0.0
- run: node --version
- run: ci/run_conditional_tests.sh
name: Run unit tests
env:
BUILD_TYPE: presubmit
TEST_TYPE: units
shard-total: ${{ needs.setup.outputs.shard-total }}
shard-index: ${{ matrix.shard-index }}
lint:
runs-on: ubuntu-latest
continue-on-error: true
Expand All @@ -43,3 +51,22 @@ jobs:
- run: npm install
- run: npm run lint
name: Run monorepo linter

# Consolidate shards into jobs representing aggregate status to simplify branch protection requirements
units-status:
name: units (${{ matrix.node-version }})
needs: units
runs-on: ubuntu-latest
if: always()
strategy:
fail-fast: false
matrix:
node-version: [22, 24, 26]
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: Check shard status
uses: ./.github/actions/check-shard-status
with:
node-version: ${{ matrix.node-version }}
50 changes: 38 additions & 12 deletions .github/workflows/windows-presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,53 @@ on:
pull_request:
name: presubmit-windows
jobs:
setup:
runs-on: ubuntu-latest
outputs:
shard-matrix: ${{ steps.set-matrix.outputs.shard_matrix }}
shard-total: ${{ steps.set-matrix.outputs.shard_total }}
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 2
persist-credentials: false
- id: set-matrix
uses: ./.github/actions/calculate-shard-matrix
units:
needs: setup
name: units (Node ${{ matrix.node-version }}, Shard ${{ matrix.shard-index }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
node-version: [22, 24, 26]
shard-index: ${{ fromJSON(needs.setup.outputs.shard-matrix) }}
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 300
fetch-depth: 2
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
- uses: ./.github/actions/run-unit-tests
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
shard-total: ${{ needs.setup.outputs.shard-total }}
shard-index: ${{ matrix.shard-index }}

# Dummy jobs to satisfy branch protection requirements for each node version
units-status:
name: units (${{ matrix.node-version }})
needs: units
runs-on: ubuntu-latest
if: always()
strategy:
fail-fast: false
matrix:
node-version: [22, 24, 26]
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
version: ^10.0.0
- run: node --version
- run: bash ci/run_conditional_tests.sh
name: Run windows unit tests
shell: bash
env:
BUILD_TYPE: presubmit
TEST_TYPE: units
persist-credentials: false
- name: Check shard status
uses: ./.github/actions/check-shard-status
with:
node-version: ${{ matrix.node-version }}
25 changes: 25 additions & 0 deletions .pnpmfile.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
hooks: {
readPackage(pkg, context) {
// Override yargs for Node >= 24 to prevent ESM scope require errors
Comment thread
bshaffer marked this conversation as resolved.
if (pkg.dependencies && pkg.dependencies.yargs) {
mutateYargs(pkg.dependencies, pkg.name, 'dependencies', context);
}
if (pkg.devDependencies && pkg.devDependencies.yargs) {
mutateYargs(pkg.devDependencies, pkg.name, 'devDependencies', context);
}
return pkg;
}
}
};

function mutateYargs(deps, pkgName, depType, context) {
const nodeVersion = process.version;
const majorVersion = parseInt(nodeVersion.replace('v', '').split('.')[0], 10);

if (majorVersion >= 24) {
console.log(`[pnpmfile] Node.js version is ${nodeVersion} (>= 24). Overriding yargs to 18.0.0 in ${pkgName}`);
deps.yargs = '18.0.0';
}
}

Loading
Loading