Skip to content

Commit c444e66

Browse files
committed
Merge branch 'main' into ddb-fsa-appcheck
2 parents 0526b87 + 0b318a9 commit c444e66

27 files changed

+292
-1143
lines changed

.github/workflows/check-vertexai-responses.yml

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,36 +19,44 @@ on: pull_request
1919
jobs:
2020
check-version:
2121
runs-on: ubuntu-latest
22+
# Allow GITHUB_TOKEN to have write permissions
23+
permissions:
24+
contents: write
2225
steps:
23-
- uses: actions/checkout@v4
24-
- name: Clone mock responses
25-
run: scripts/update_vertexai_responses.sh
26-
- name: Find cloned and latest versions
27-
run: |
28-
CLONED=$(git describe --tags)
29-
LATEST=$(git tag --sort=v:refname | tail -n1)
30-
echo "cloned_tag=$CLONED" >> $GITHUB_ENV
31-
echo "latest_tag=$LATEST" >> $GITHUB_ENV
32-
working-directory: packages/vertexai/test-utils/vertexai-sdk-test-data
33-
- name: Find comment from previous run if exists
34-
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e
35-
id: fc
36-
with:
37-
issue-number: ${{github.event.number}}
38-
body-includes: Vertex AI Mock Responses Check
39-
- name: Comment on PR if newer version is available
40-
if: ${{env.cloned_tag != env.latest_tag && !steps.fc.outputs.comment-id}}
41-
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
42-
with:
43-
issue-number: ${{github.event.number}}
44-
body: >
45-
### Vertex AI Mock Responses Check :warning:
46-
47-
A newer major version of the mock responses for Vertex AI unit tests is available.
48-
[update_vertexai_responses.sh](https://github.com/firebase/firebase-js-sdk/blob/main/scripts/update_vertexai_responses.sh)
49-
should be updated to clone the latest version of the responses: `${{env.latest_tag}}`
50-
- name: Delete comment when version gets updated
51-
if: ${{env.cloned_tag == env.latest_tag && steps.fc.outputs.comment-id}}
52-
uses: detomarco/delete-comment@850734dd44d8b15fef55b45252613b903ceb06f0
53-
with:
54-
comment-id: ${{ steps.fc.outputs.comment-id }}
26+
- uses: actions/checkout@v4
27+
- name: Clone mock responses
28+
run: scripts/update_vertexai_responses.sh
29+
- name: Find cloned and latest versions
30+
run: |
31+
CLONED=$(git describe --tags)
32+
LATEST=$(git tag --sort=v:refname | tail -n1)
33+
echo "cloned_tag=$CLONED" >> $GITHUB_ENV
34+
echo "latest_tag=$LATEST" >> $GITHUB_ENV
35+
working-directory: packages/vertexai/test-utils/vertexai-sdk-test-data
36+
- name: Find comment from previous run if exists
37+
uses: peter-evans/find-comment@v3
38+
id: fc
39+
with:
40+
issue-number: ${{github.event.number}}
41+
body-includes: Vertex AI Mock Responses Check
42+
- name: Comment on PR if newer version is available
43+
if: ${{env.cloned_tag != env.latest_tag && !steps.fc.outputs.comment-id}}
44+
uses: peter-evans/create-or-update-comment@v4
45+
with:
46+
issue-number: ${{github.event.number}}
47+
body: >
48+
### Vertex AI Mock Responses Check :warning:
49+
50+
A newer major version of the mock responses for Vertex AI unit tests is available.
51+
[update_vertexai_responses.sh](https://github.com/firebase/firebase-js-sdk/blob/main/scripts/update_vertexai_responses.sh)
52+
should be updated to clone the latest version of the responses: `${{env.latest_tag}}`
53+
- name: Delete comment when version gets updated
54+
if: ${{env.cloned_tag == env.latest_tag && steps.fc.outputs.comment-id}}
55+
uses: actions/github-script@v6
56+
with:
57+
script: |
58+
github.rest.issues.deleteComment({
59+
owner: context.repo.owner,
60+
repo: context.repo.repo,
61+
comment_id: ${{ steps.fc.outputs.comment-id }},
62+
})

.github/workflows/test-changed-firestore.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ jobs:
232232
with:
233233
node-version: 22.10.0
234234
- name: Download build archive
235-
uses: actions/download-artifact@v3
235+
uses: actions/download-artifact@v4
236236
with:
237237
name: build.tar.gz
238238
- name: Unzip build artifact
@@ -259,7 +259,7 @@ jobs:
259259
if: ${{ needs.build.outputs.changed == 'true'}}
260260
steps:
261261
- name: Download build archive
262-
uses: actions/download-artifact@v3
262+
uses: actions/download-artifact@v4
263263
with:
264264
name: build.tar.gz
265265
- name: Unzip build artifact

.github/workflows/test-firebase-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ jobs:
4646
- name: build
4747
run: yarn build:changed firebase-integration
4848
- name: Run tests on changed packages
49-
run: yarn test:changed firebase-integration
49+
run: yarn test:changed firebase-integration

config/karma.base.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ const config = {
5454
// Doing 65 seconds to allow for the 20 second firestore tests
5555
browserNoActivityTimeout: 65000,
5656

57-
// preprocess matching files before serving them to the browser
58-
// available preprocessors:
57+
// Preprocess matching files before serving them to the browser.
58+
// Available preprocessors:
5959
// https://npmjs.org/browse/keyword/karma-preprocessor
6060
preprocessors: {
6161
'test/**/*.ts': ['webpack', 'sourcemap'],

packages/data-connect/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Firebase Data Connect
2+
3+
## Local Development
4+
5+
Check `test/dataconnect.yaml` to ensure that the correct values are filled in.

packages/data-connect/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
"prettier": "prettier --write '*.js' '*.ts' '@(src|test)/**/*.ts'",
3232
"build:deps": "lerna run --scope @firebase/'{app,data-connect}' --include-dependencies build",
3333
"dev": "rollup -c -w",
34-
"test": "run-p --npm-path npm test:emulator",
35-
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:emulator",
36-
"test:all": "run-p --npm-path npm lint test:unit",
37-
"test:browser": "karma start --single-run",
34+
"test": "run-p --npm-path npm lint test:emulator",
35+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
36+
"test:all": "run-p --npm-path npm lint test:browser test:node",
37+
"test:browser": "karma start",
3838
"test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js",
3939
"test:unit": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/unit/**/*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js",
4040
"test:emulator": "ts-node --compiler-options='{\"module\":\"commonjs\"}' ../../scripts/emulator-testing/dataconnect-test-runner.ts",

packages/data-connect/src/api/query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export function queryRef<Data, Variables>(
124124
dataConnect: dcInstance,
125125
refType: QUERY_STR,
126126
name: queryName,
127-
variables: variables
127+
variables
128128
};
129129
}
130130
/**

packages/data-connect/src/network/transport/rest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ export class RESTTransport implements DataConnectTransport {
166166
body: U
167167
) => {
168168
const abortController = new AbortController();
169+
169170
// TODO(mtewani): Update to proper value
170171
const withAuth = this.withRetry(() =>
171172
dcFetch<T, U>(
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "jscore-sandbox-141b5"
4+
}
5+
}

packages/data-connect/test/.gitignore

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
firebase-debug.log*
8+
firebase-debug.*.log*
9+
10+
# Firebase cache
11+
.firebase/
12+
13+
# Firebase config
14+
15+
# Uncomment this if you'd like others to create their own Firebase project.
16+
# For a team working on the same Firebase project(s), it is recommended to leave
17+
# it commented so all members can deploy to the same project(s) in .firebaserc.
18+
# .firebaserc
19+
20+
# Runtime data
21+
pids
22+
*.pid
23+
*.seed
24+
*.pid.lock
25+
26+
# Directory for instrumented libs generated by jscoverage/JSCover
27+
lib-cov
28+
29+
# Coverage directory used by tools like istanbul
30+
coverage
31+
32+
# nyc test coverage
33+
.nyc_output
34+
35+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
36+
.grunt
37+
38+
# Bower dependency directory (https://bower.io/)
39+
bower_components
40+
41+
# node-waf configuration
42+
.lock-wscript
43+
44+
# Compiled binary addons (http://nodejs.org/api/addons.html)
45+
build/Release
46+
47+
# Dependency directories
48+
node_modules/
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Optional REPL history
57+
.node_repl_history
58+
59+
# Output of 'npm pack'
60+
*.tgz
61+
62+
# Yarn Integrity file
63+
.yarn-integrity
64+
65+
# dotenv environment variables file
66+
.env
67+
68+
# dataconnect generated files
69+
.dataconnect

packages/data-connect/test/dataconnect/.dataconnect/schema/main/input.gql

Lines changed: 0 additions & 49 deletions
This file was deleted.

packages/data-connect/test/dataconnect/.dataconnect/schema/main/mutation.gql

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/data-connect/test/dataconnect/.dataconnect/schema/main/query.gql

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)