Devographics / Monorepo

Monorepo containing the State of JS apps
surveyform-sigma.vercel.app
Other
124 stars 50 forks source link

During dev when fetching data locally, check repo SHA #272

Open eric-burel opened 11 months ago

eric-burel commented 11 months ago

To get the latest commit of a distant repo: "https://api.github.com/repos/devographics/surveys/commits/main" (see https://stackoverflow.com/questions/45726013/how-can-i-get-last-commit-from-github-api)

To get the latest commit of a local repo:

git rev-parse HEAD

(see https://stackoverflow.com/questions/949314/how-do-i-get-the-hash-for-the-current-commit-in-git)

It should probably throw in dev, and warn in prod.

eric-burel commented 10 months ago

Related to #297 Now the methods that loads the survey either locally or distantly will also get the repo SHA It's not yet used except in the logs for debugging purpose, next step is adding it to the GraphQL schema so surveyform/surveyadmin can query it

Then we may check if there is a mismatch with the distant repo and warn user