Skip to content
This repository was archived by the owner on Oct 7, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f76cccf
Add Glean metrics, pings, docs, and npm scripts
aaga Mar 31, 2022
92f37de
Add triggered function stubs (no Glean pings yet)
aaga Mar 31, 2022
8efa6ff
Add getRallyID function, fix some function naming
aaga Mar 31, 2022
1813e86
Port /functions from CommonJS to ESM
aaga Apr 15, 2022
71cbd8f
Fix existing Jest tests to use ESM
aaga Apr 18, 2022
2580bce
Implement Glean pings
aaga Apr 18, 2022
323b6f1
Disable function triggers in integration test; cleanup some unused code
aaga Apr 19, 2022
9e4fef6
Add APP_ID and VERSION to Glean; rename sendPingFlag to submitPingFlag
aaga Apr 20, 2022
9f70f04
Add minor comment explanation for function test
aaga Apr 20, 2022
d739c0f
Change package.json version require to import
aaga Apr 20, 2022
1c18b7f
Rollback version string; was creating import problems
aaga Apr 20, 2022
d5ea869
Remove unnecessary 'set' from testing script
aaga Apr 21, 2022
66e9552
Remove explicit true/false in cors.ts
aaga Apr 21, 2022
654164d
Move testenv loading to integration-test.sh
aaga Apr 21, 2022
876506c
Keep function triggers enabled in UX integration test. Disable Glean …
aaga Apr 21, 2022
18c39f6
Add app_display_version for Glean
aaga Apr 25, 2022
6451d39
Change function export format to enable better stack traces
aaga Apr 25, 2022
e5cc687
Tidy up demographics logic
aaga Apr 25, 2022
59294da
Fix typo
aaga Apr 25, 2022
8d7c402
Fix up some types
aaga Apr 25, 2022
df236a2
tidy up return value
aaga Apr 25, 2022
6400587
Fix demographic logic
aaga Apr 25, 2022
18cc63a
Remove allowJS: true, no longer needed
aaga Apr 25, 2022
f37a248
Use function logger instead of console.log
aaga Apr 25, 2022
cc5489c
Clean up logic
aaga Apr 26, 2022
cd9923c
Change order of extensionUser deletion
aaga Apr 26, 2022
d602f8d
Change rallytoken tests to use callback instead of await; remove Prom…
aaga Apr 27, 2022
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
# You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
# A list of available CircleCI Docker Convenience Images are available here: https://circleci.com/developer/images/image/cimg/node
docker:
- image: cimg/openjdk:16.0.2-node
- image: cimg/python:3.8.8-node
# Then run your tests!
# CircleCI will report the results back to your VCS provider.
steps:
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ connectFirestoreEmulator(db, "localhost", 8080);
For the Rally Web Platform, this is done in: `./src/lib/stores/initialize-firebase.js` and automatically enabled when built in
emulator mode.

## Glean

The Rally Web Platform uses [Glean](https://docs.telemetry.mozilla.org/concepts/glean/glean.html) pings to send enrollment and demographic information to a secure analysis environment.

Glean is **disabled by default** when using the Firebase Emulator (i.e. for development and testing). However it can be **explicitly enabled** by setting the `ENABLE_GLEAN` environment variable to `true`. When Glean is enabled in this way, pings will be logged, and will show up in the official Glean Debug Viewer under the [MozillaRally](https://debug-ping-preview.firebaseapp.com/pings/MozillaRally) tag (note that the ping payload is encrypted before being sent to the Debug Viewer; the data will be obfuscated but you can still see ping type and receiving time).

## Deploying

CircleCI is used to generate build artifacts, which are pushed to the `deploy` branch on this repository.
Expand Down
182 changes: 151 additions & 31 deletions docs/metrics.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions functions/.eslintrc.js → functions/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ module.exports = {
plugins: ["@typescript-eslint", "import"],
rules: {
quotes: ["error", "double"],
"import/no-unresolved": "off" // too many weird module resolutions in this project
},
};
4 changes: 3 additions & 1 deletion functions/.testenv
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
GCLOUD_PROJECT="demo-rally"
FIRESTORE_EMULATOR_HOST="localhost:8080"
FIRESTORE_EMULATOR_HOST="localhost:8080"
FIREBASE_EMULATOR_HUB="localhost:4400"
NODE_OPTIONS=--experimental-vm-modules
21 changes: 18 additions & 3 deletions functions/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
module.exports = {
preset: "ts-jest",
export default {
preset: "ts-jest/presets/default-esm",
globals: {
"ts-jest": {
useESM: true,
},
},
resolver: "ts-jest-resolver",
moduleNameMapper: {
"^@mozilla/glean/node": "@mozilla/glean/dist/index/node.js",
"^@mozilla/glean/plugins/(.*)": "@mozilla/glean/dist/plugins/$1.js",
"^@mozilla/glean/uploader": "@mozilla/glean/dist/core/upload/uploader.js",
"^@mozilla/glean/private/metrics/(.*)":
"@mozilla/glean/dist/core/metrics/types/$1.js",
"^@mozilla/glean/private/ping":
"@mozilla/glean/dist/core/pings/ping_type.js",
},
testRegex: "src(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
testPathIgnorePatterns: ["lib/", "node_modules/", "setupTests.js"],
moduleFileExtensions: ["js", "ts", "tsx", "jsx", "json", "node"],
testEnvironment: "node",
testEnvironment: "node",
};
Loading