Skip to content

Commit

Permalink
Merge branch 'main' into ddb-fsa-appcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
DellaBitta committed Jan 14, 2025
2 parents 0526b87 + 0b318a9 commit c444e66
Show file tree
Hide file tree
Showing 27 changed files with 292 additions and 1,143 deletions.
72 changes: 40 additions & 32 deletions .github/workflows/check-vertexai-responses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,44 @@ on: pull_request
jobs:
check-version:
runs-on: ubuntu-latest
# Allow GITHUB_TOKEN to have write permissions
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Clone mock responses
run: scripts/update_vertexai_responses.sh
- name: Find cloned and latest versions
run: |
CLONED=$(git describe --tags)
LATEST=$(git tag --sort=v:refname | tail -n1)
echo "cloned_tag=$CLONED" >> $GITHUB_ENV
echo "latest_tag=$LATEST" >> $GITHUB_ENV
working-directory: packages/vertexai/test-utils/vertexai-sdk-test-data
- name: Find comment from previous run if exists
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e
id: fc
with:
issue-number: ${{github.event.number}}
body-includes: Vertex AI Mock Responses Check
- name: Comment on PR if newer version is available
if: ${{env.cloned_tag != env.latest_tag && !steps.fc.outputs.comment-id}}
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
with:
issue-number: ${{github.event.number}}
body: >
### Vertex AI Mock Responses Check :warning:
A newer major version of the mock responses for Vertex AI unit tests is available.
[update_vertexai_responses.sh](https://github.com/firebase/firebase-js-sdk/blob/main/scripts/update_vertexai_responses.sh)
should be updated to clone the latest version of the responses: `${{env.latest_tag}}`
- name: Delete comment when version gets updated
if: ${{env.cloned_tag == env.latest_tag && steps.fc.outputs.comment-id}}
uses: detomarco/delete-comment@850734dd44d8b15fef55b45252613b903ceb06f0
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
- uses: actions/checkout@v4
- name: Clone mock responses
run: scripts/update_vertexai_responses.sh
- name: Find cloned and latest versions
run: |
CLONED=$(git describe --tags)
LATEST=$(git tag --sort=v:refname | tail -n1)
echo "cloned_tag=$CLONED" >> $GITHUB_ENV
echo "latest_tag=$LATEST" >> $GITHUB_ENV
working-directory: packages/vertexai/test-utils/vertexai-sdk-test-data
- name: Find comment from previous run if exists
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{github.event.number}}
body-includes: Vertex AI Mock Responses Check
- name: Comment on PR if newer version is available
if: ${{env.cloned_tag != env.latest_tag && !steps.fc.outputs.comment-id}}
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{github.event.number}}
body: >
### Vertex AI Mock Responses Check :warning:
A newer major version of the mock responses for Vertex AI unit tests is available.
[update_vertexai_responses.sh](https://github.com/firebase/firebase-js-sdk/blob/main/scripts/update_vertexai_responses.sh)
should be updated to clone the latest version of the responses: `${{env.latest_tag}}`
- name: Delete comment when version gets updated
if: ${{env.cloned_tag == env.latest_tag && steps.fc.outputs.comment-id}}
uses: actions/github-script@v6
with:
script: |
github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: ${{ steps.fc.outputs.comment-id }},
})
4 changes: 2 additions & 2 deletions .github/workflows/test-changed-firestore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ jobs:
with:
node-version: 22.10.0
- name: Download build archive
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build.tar.gz
- name: Unzip build artifact
Expand All @@ -259,7 +259,7 @@ jobs:
if: ${{ needs.build.outputs.changed == 'true'}}
steps:
- name: Download build archive
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build.tar.gz
- name: Unzip build artifact
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-firebase-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
- name: build
run: yarn build:changed firebase-integration
- name: Run tests on changed packages
run: yarn test:changed firebase-integration
run: yarn test:changed firebase-integration
4 changes: 2 additions & 2 deletions config/karma.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ const config = {
// Doing 65 seconds to allow for the 20 second firestore tests
browserNoActivityTimeout: 65000,

// preprocess matching files before serving them to the browser
// available preprocessors:
// Preprocess matching files before serving them to the browser.
// Available preprocessors:
// https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'test/**/*.ts': ['webpack', 'sourcemap'],
Expand Down
5 changes: 5 additions & 0 deletions packages/data-connect/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Firebase Data Connect

## Local Development

Check `test/dataconnect.yaml` to ensure that the correct values are filled in.
8 changes: 4 additions & 4 deletions packages/data-connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
"prettier": "prettier --write '*.js' '*.ts' '@(src|test)/**/*.ts'",
"build:deps": "lerna run --scope @firebase/'{app,data-connect}' --include-dependencies build",
"dev": "rollup -c -w",
"test": "run-p --npm-path npm test:emulator",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:emulator",
"test:all": "run-p --npm-path npm lint test:unit",
"test:browser": "karma start --single-run",
"test": "run-p --npm-path npm lint test:emulator",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
"test:all": "run-p --npm-path npm lint test:browser test:node",
"test:browser": "karma start",
"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",
"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",
"test:emulator": "ts-node --compiler-options='{\"module\":\"commonjs\"}' ../../scripts/emulator-testing/dataconnect-test-runner.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/data-connect/src/api/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export function queryRef<Data, Variables>(
dataConnect: dcInstance,
refType: QUERY_STR,
name: queryName,
variables: variables
variables
};
}
/**
Expand Down
1 change: 1 addition & 0 deletions packages/data-connect/src/network/transport/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export class RESTTransport implements DataConnectTransport {
body: U
) => {
const abortController = new AbortController();

// TODO(mtewani): Update to proper value
const withAuth = this.withRetry(() =>
dcFetch<T, U>(
Expand Down
5 changes: 5 additions & 0 deletions packages/data-connect/test/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "jscore-sandbox-141b5"
}
}
69 changes: 69 additions & 0 deletions packages/data-connect/test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
firebase-debug.log*
firebase-debug.*.log*

# Firebase cache
.firebase/

# Firebase config

# Uncomment this if you'd like others to create their own Firebase project.
# For a team working on the same Firebase project(s), it is recommended to leave
# it commented so all members can deploy to the same project(s) in .firebaserc.
# .firebaserc

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# dataconnect generated files
.dataconnect

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit c444e66

Please sign in to comment.