functions-differ
functions-differ copied to clipboard
Store hashes somewhere other than differspec file
Problem
In a CI workflow, all changes made to files are ephemeral. They last only as long as the workflow itself.
functions-differ
does not work well in a CI environment. Updates to function hashes are not persisted across CI runs, meaning that the hashes in .differspec.json
are not updated. This leads to incorrect calculations of changed functions.
Proposed Solutions
- :bulb: Store function hashes in an online database accessible from both CI environment, and a local dev workflow.
- :heavy_check_mark: Pros:
- Hashes persist across CI and local deployment workflows
-
.differspec.json
file is simplified
- :stop_sign: Cons:
- Creating a central repository of function hashes might create privacy concerns
- Allowing users to store hashes in their own databases on GCP would increase complexity of the tool
- :heavy_check_mark: Pros:
Is there any progress on this issue by any chance? We would love to use your package, but we are deploying using azure devops, so using the .differspec.json is not currently working for us.
There's no progress to report yet, unfortunately. A workaround for this problem is to cache your .differspec.json
file between CI runs so that your deployment history on CI remains consistent.
A configurable SpecWriterAdapter
& SpecReaderAdapter
would be great, with a few prebuilt options for likely uses cases.
Since this is built for Firebase, storing a JSON document in Firestore or JSON file in GCS seems appropriate. But providing an adapter API means you could configure it to read/write anywhere.
That's a nice idea! If you would like to implement it I am happy to accept a pull request for it. If that's not possible, I'll include it in my list of things to add for this package (but no ETA).