Skip to content

Commit

Permalink
fix(js): test on node versions 20 through 22; 23 is currently broken #…
Browse files Browse the repository at this point in the history
…1995

ISSUE: #1995

CHANGELOG:
- [ ] Update biome configuration to use arrow parens always.
- [ ] Update github workflows to test on node versions 20 through 22.
- [ ] We will add version #23 post fixes.
- [ ] Set node 22 to be the default for our eng workstations in the
  setup script for now.
  • Loading branch information
yesudeep committed Feb 15, 2025
1 parent d1b4be5 commit 4ad73bc
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 168 deletions.
48 changes: 20 additions & 28 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

name: Build Check (Run npm run build everywhere locally if this fails)

Expand All @@ -22,21 +11,24 @@ env:

jobs:
build:
name: Run build tasks
name: Run build tasks (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20', '21', '22']
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
- name: Set up node v20
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Run build script
run: pnpm build
- name: Run js tests
run: pnpm test:js
- name: Validate working directory is clean
run: .github/workflows/scripts/ensure-clean-working-tree.sh
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
- name: Set up node v${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Run build script
run: pnpm build
- name: Run js tests
run: pnpm test:js
- name: Validate working directory is clean
run: .github/workflows/scripts/ensure-clean-working-tree.sh
13 changes: 1 addition & 12 deletions .github/workflows/bump-cli-version.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

name: Bump and Tag CLI Version

Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/bump-js-version.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

name: Bump and Tag JS Version

Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/bump-package-version.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

name: Bump Version for a package

Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

name: Run e2e tests

Expand All @@ -21,15 +10,18 @@ on:

jobs:
build:
name: Run e2e tests
name: Run e2e tests (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20', '21', '22']
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
- name: Set up node v20
- name: Set up node v${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install dependencies
run: pnpm install
Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/formatter.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

name: Formatting Check (Run npm run format locally if this fails)

Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

name: Go tests and checks

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
python-version:
- "3.12"
- "3.12" # uv manages versions; this is base.

steps:
- uses: actions/checkout@v4
Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/release_js_main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

name: Release Genkit JS

Expand Down
46 changes: 19 additions & 27 deletions .github/workflows/samples.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

name: Build Samples (only runs if /samples/** is changed)

on:
on:
pull_request:
paths: samples/**

Expand All @@ -24,19 +13,22 @@ env:

jobs:
build:
name: Build Samples
name: Build Samples (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20', '21', '22']
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
- name: Set up node v20
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Build Samples
run: pnpm build:js-samples
- name: Validate working directory is clean
run: .github/workflows/scripts/ensure-clean-working-tree.sh
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
- name: Set up node v${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Build Samples
run: pnpm build:js-samples
- name: Validate working directory is clean
run: .github/workflows/scripts/ensure-clean-working-tree.sh
38 changes: 15 additions & 23 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

name: Run Tests

Expand All @@ -24,15 +13,18 @@ jobs:
build:
name: Run Tests (just DevUI tests for now)
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20', '21', '22']
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
- name: Set up node v20
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: pnpm
- name: Install dependencies and build
run: pnpm build:genkit-tools
- name: Run tests
run: pnpm test:genkit-tools
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
- name: Set up node v${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}.x # Use matrix variable
cache: pnpm
- name: Install dependencies and build
run: pnpm build:genkit-tools
- name: Run tests
run: pnpm test:genkit-tools
1 change: 1 addition & 0 deletions bin/add_license
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ $HOME/go/bin/addlicense \
-ignore '**/dist/**/*' \
-ignore '**/node_modules/**/*' \
-ignore '**/pnpm-lock.yaml' \
-ignore '**/py/site/**/*.html' \
-ignore '.nx/**/*' \
-ignore '.trunk/**/*' \
"$TOP_DIR"
1 change: 1 addition & 0 deletions bin/check_license
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ $HOME/go/bin/addlicense \
-ignore '**/dist/**/*' \
-ignore '**/node_modules/**/*' \
-ignore '**/pnpm-lock.yaml' \
-ignore '**/py/site/**/*.html' \
-ignore '.nx/**/*' \
-ignore '.trunk/**/*' \
"$TOP_DIR"
2 changes: 1 addition & 1 deletion bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fi
TOP_DIR=$(git rev-parse --show-toplevel)

PNPM_VERSION="10.2.0"
NODE_VERSION="23"
NODE_VERSION="22" # See: https://github.com/firebase/genkit/issues/1995
NVM_VERSION="0.40.1"

AUDIENCE="eng"
Expand Down
5 changes: 4 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
".nx/**",
".trunk/**",
"bazel-*/**",
"genkit-tools/genkit-schema.json",
"go/**",
"node_modules/**",
"py/**",
"third_party/**"
]
},
Expand All @@ -46,7 +49,7 @@
},
"javascript": {
"formatter": {
"arrowParentheses": "asNeeded",
"arrowParentheses": "always",
"attributePosition": "auto",
"bracketSpacing": true,
"jsxQuoteStyle": "double",
Expand Down

0 comments on commit 4ad73bc

Please sign in to comment.