Skip to content

Trigger Typesense Schema Update Function on Deploy  #1978

@Mephistic

Description

@Mephistic

Problem

We manage our Typesense collection schemas through the Firebase Function checkSearchIndexVersion - which when run will check all Typesense collections and, if their schemas are out of date, runs a schema migration and backfill.

Unfortunately, this function has to be run manually at the moment and is easily forgotten - to amend this, we should make triggering this check an automatic part of our deployment process.

According to our wiki (https://github.com/codeforboston/maple/wiki/Search-and-Typesense), we allegedly did have this set up at one point, but if so, the functionality seems to have vanished.

Success Criteria

  • Add a trigger to the DEV and PROD Github deploy actions to automatically run the checkSearchIndexVersion function after a successful deploy
    • This can be run from the CLI with gcloud pubsub topics publish --project=digital-testimony-dev checkSearchIndexVersion --message='{"check": true}' for DEV (and for PROD with project=digital-testimony-prod) - the function in question is a pubsub function.
  • If the former proves too difficult/fragile (for whatever reason) and we need a fallback, add a note to run this function in the Github PR review template (to remind PR reviewers to check for this when relevant - with Typesense schema updates). Please reach out if you feel this is the best solution, but it would certainly still be a better state than we're in today.

Metadata

Metadata

Assignees

Labels

Ready for DevelopmentAutomatically assigned to issues that are ready to be picked up

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions