nlewo / comin

GitOps For NixOS Machines
MIT License
343 stars 12 forks source link

Store deployments in a JSON file #44

Closed nlewo closed 3 months ago

nlewo commented 4 months ago

This MR store previous deployment on the disk, in a JSON file. When, the JSON file is not existing or can't be unmarshaled, it is ignored and replaced. Currently, we keep the last 10 testing deployments and last 10 main deployments.

Storing the previous deployments on disk will be used to add the following features:

zowoq commented 3 months ago

@nlewo Would you be open to having a stateless mode in comin that disables storing deployments and the features that would depend on it?

nlewo commented 3 months ago

@zowoq I would prefer to avoid optional feature because it would make more complex the codebase and the documentation.

However, my goal is to not make comin starting without any state file. If you delete the state file, comin starts correctly (and recreate it).

The size of this file is limited and pretty small (16KB) and it doesn't add any build dependencies (i actually started with a sqlite database but switched to a simple json file).

What is your issue with this file?

zowoq commented 3 months ago

Storing state is really an anti-feature for my use case, basically I just want a more polished version of the autoupgrade module with git polling and prometheus metrics.