memo icon indicating copy to clipboard operation
memo copied to clipboard

[Server support] - Update collection-listing strategy from client filesystem

Open matuella opened this issue 3 years ago • 2 comments

This issue should solve adding new collections using only Firebase, thus allowing much more flexibility to the client applications when receiving new collection updates.

What it should do, technically speaking, is:

  • [x] move all collections from flutter/ to firebase/;
  • [ ] then, with the admin SDK capabilities, every time an update occurs (in main branch) within this new folder of collections, run a script (using Github Actions, through a new workflow) to evaluate such changes, compare this new state to what's stored in the production firestore, and make the required writes to mirror this new state.

This is similar to what's occurring locally in VersionServices, although there is an additional complexity of handling both global and user collections - meaning that removing/updating past existing user collections should be made with extra care, as to not create any inconsistency.


Sub-issue that relates to the Server support - https://github.com/olmps/memo/issues/136.

matuella avatar Jul 19 '21 13:07 matuella

then, with the admin SDK capabilities, every time an update occurs (in main branch) within this new folder of collections, run a script (using Github Actions, through a new workflow) to evaluate such changes, compare this new state to what's stored in the production firestore, and make the required writes to mirror this new state.

Maybe there is a way for the action to pass the specific collections that changed when a push to main and has passed the conditional filters.

The syntax to filter are called paths (https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths) but I'm not sure if we are able to collect the file names that changed in a particular sub-folder.

matuella avatar Sep 29 '21 19:09 matuella

but I'm not sure if we are able to collect the file names that changed in a particular sub-folder.

I've found a couple of alternatives if there is no default way to get these:

  • https://github.com/tj-actions/changed-files
  • https://github.com/jitterbit/get-changed-files
  • https://github.community/t/can-i-process-only-changed-files-with-github-actions/137814

matuella avatar Oct 01 '21 13:10 matuella