Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Make Firebase project configurable, and straighten out extension message-passing #122

Merged
merged 33 commits into from
Sep 14, 2021

Conversation

rhelmer
Copy link
Contributor

@rhelmer rhelmer commented Sep 13, 2021

As I was testing out deploying to staging, I decided to document and provide a tooling support to build and deploy to different Firebase environments. It's based around firebase use, which seems like the recommended way to support multiple Firebase sites.

I straightened up a few other things while I was in there:

  • load firebase config at runtime, so the site does not need to be re-built for different environments
  • message-passing between the site and extension is much simpler
    • the site sends a message when initialized, and the extension responds with a request for the JWT
  • the test extension is now built on test runs, does not need to be checked in
  • the SDK can now accept a firebase config override

Note that you don't need to use firebase use or any of the deployment stuff if you don't want to, npm run dev still runs the local emulators. I changed the default project to start with "demo-" because Firebase considers that a local-only project and will not attempt to connect to any live resources.

Copy link
Contributor

@Carla-Moz Carla-Moz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked through it and tested; looks good to me.

@rhelmer
Copy link
Contributor Author

rhelmer commented Sep 14, 2021

Looked through it and tested; looks good to me.

Thanks! I made one tiny change - now that mozilla-rally/rally-sdk#14 has landed, I'm pointing the test extension in tests/integration/extension/ at that repo instead of my fork :)

@rhelmer rhelmer merged commit 827ee51 into mozilla-rally:master Sep 14, 2021
rhelmer added a commit that referenced this pull request Sep 14, 2021
…age-passing (#122)

* spell out how to set up and use multiple Firebase environments

* remove screenshots dirs

* ignore screenshots except for README

* ignore local firebase cache

* rename web config and put it in ./config subdir

* firebase should be dev dependency, not peer

* rename config to something more specific

* must use import type if importsNotUsedAsValues is set to error in tsconfig

* load firebase config at runtime

* copy firebase web config based on current in-use firebase project name

* move firebase to gitignore

* configure CircleCI to override firebase per-project setting

* upgrade to latest firebase-functions package

* configure functions host in firebase web config file

* info log on every account creation

* get project name from environment for load:data target, and make sure the dev target configures for firebase

* put rally site const with others

* add proper build support for test extension, make sure to copy content script in

* add package command to generate test extensions

* wait for rally-sdk to send request before generating and sending back token

* only send web-check after logging in, and handle missing attached update to study enrollment

* build test extension instead of having to chck in assets

* capture failure from firebase use

* use demo-rally for emulator, so firebase does not attempt to connect to live resources

* use demo- prefix for dev and integration test mode, per https://firebase.google.com/docs/emulator-suite/connect_firestore#choose_a_firebase_project

* bump pinned sdk version

* explain how to build without being logged in

* prefix message types with rally-sdk, and warn not throw for unrecognized message types

* keep the chrome extension version test working even though it's temporarily disabled

* typo

* upgrade test extension to latest rally-sdk

* bump rally SDK version

* point to latest official Rally SDK
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants