Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge DB fixes from dev #71

Merged
merged 8 commits into from
Aug 14, 2024
Merged

Merge DB fixes from dev #71

merged 8 commits into from
Aug 14, 2024

Conversation

jdkaplan
Copy link
Collaborator

@jdkaplan jdkaplan commented Aug 14, 2024

The unified DB connection pool (#68) seems to work in test, so it's time to run it on main.

As a bonus, we also get integration tests (#64) running in CI!

I did a quick-fix (#70) directly to main, so this gives us a little bit of a merge bubble. So in addition to the usual "promote dev to main" (what this PR is), I'll also force-reset dev to match the new main post-merge.

I want to be able to experiment with Pairing Bot locally, which means I'll need
some way to run Firestore without also running all of Google Cloud. It turns
out that there's an [emulator] inside of `gcloud` which is made exactly for
this purpose!

[emulator]: https://cloud.google.com/firestore/docs/emulator

The Firestore Go SDK we're using automatically supports using this via the
`FIRESTORE_EMULATOR_HOST` environment variable.

## Changes

This sets up a single round-trip test to prove that this all works. I left
space to add more because I'll be collecting them in the future as I learn
about how Firestore works (and how we use it!).

I also made these tests run on PRs to the `dev` branch. I intend to treat them
as non-blocking there, but I do think it's nice to know that we've broken unit
tests before deploying, even if it's just to the test bot.

I also added a `dev.sh` script to help me remember how to start the emulator.
It uses the same variable as the SDK so something like
[direnv](https://direnv.net/) makes it "just work".
The Firestore client maintains its own internal gRPC connection pool and
allows for its methods to be called concurrently. So we should be able
to create just one client and reuse it everywhere we run Firestore
queries.
@jdkaplan jdkaplan merged commit c667212 into main Aug 14, 2024
3 checks passed
@jdkaplan jdkaplan deleted the dev branch August 14, 2024 16:27
@jdkaplan jdkaplan restored the dev branch August 14, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant