Skip to content

feat: #168395616 - automation of registry entry#520

Open
gjj wants to merge 2 commits intomasterfrom
feat/automated-registry
Open

feat: #168395616 - automation of registry entry#520
gjj wants to merge 2 commits intomasterfrom
feat/automated-registry

Conversation

@gjj
Copy link
Contributor

@gjj gjj commented Jul 6, 2020

In this MR, we demonstrate the usage of Google Sheets as an alternative registry storage, instead of the static registry.json. This is so that we can do some fun stuff (automation, etc.) with Google Sheets.

User story

❗ 29 Jul edit: We're waiting for general availability of FormSG webhooks

Key changes

Discovery

  • Google Sheets API is rate-limited to 500 read requests per 100 seconds, with no other limits per day (write requests are counted separately, but we didn't use that), source

Things to note (in case anyone else faces the same issues):

  • Please use 2 Google API keys: one set to no restrictions to be used by Jest (i.e. for console), another with HTTP referrer restrictions to be used by the web. The key with the web restriction will not work in the command-line

  • opencerts-website uses verify#feat/automated-registry - if verify#feat/automated-registry is force pushed, must npm uninstall github.com/OpenCerts/verify.git#feat/automated-registry then reinstall again

  • when npm installing git branches, make sure the branch has the dist files

  • Dependencies like verify do not access environment variables, must pass googleApiKey: GOOGLE_API_KEY via options

Todo

  • Cache spreadsheet JSON for x minutes, to address rate limit

@gjj gjj added the WIP Work in progress by the author label Jul 6, 2020
@gjj gjj changed the title feat: #168395616 - automation of registry entry from feat: #168395616 - automation of registry entry Jul 6, 2020
@gjj gjj force-pushed the feat/automated-registry branch from a0070dc to 6d25262 Compare July 7, 2020 06:03
@gjj gjj requested a review from Nebulis July 8, 2020 04:03
@gjj gjj force-pushed the feat/automated-registry branch from ad23c7b to d14de19 Compare July 13, 2020 02:57
@gjj gjj force-pushed the feat/automated-registry branch from 6f9c1d5 to 5986a15 Compare July 13, 2020 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP Work in progress by the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant