Checking for env changes #446
Labels
No Label
abra
abra-gandi
awaiting-feedback
backups
bug
build
ci/cd
community organising
contributing
coopcloud.tech
democracy
design
documentation
duplicate
enhancement
finance
funding
good first issue
help wanted
installer
kadabra
performance
proposal
question
recipes.coopcloud.tech
security
test
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/organising#446
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When upgrading apps I run vimdiff between the app
.env
file and the recipe.env.sample
to check for changes and apply them.It would be nice if this could be integrated into abra.
Either an extra command like
abra app diffconf
or automatically checking changes at each upgrade and deploy.A good practice way would be to only comment out variables in the
.env
instead of deleting them, then abra could detect missing variables and insert them automatically commented out.I would also favor if new recipe releases never contain new "required" env variables. Each new env variable should be set to a default value, so that missing them does not break anything.
checking for env diffsto checking for env changesRelated #359
Yeh I like both of thoses ideas but struggle to understand how we'll account for a diversity of recipe maintainers doing "their own thing". I like to delete all unused env vars to keep my
.env
as small as possible. But I could see the benefit to keeping them if this worked.Recipe maintenance can be pretty messy some times... and we have the versioning scheme to signal breaking changes? One way to show that there are breaking changes coming is to put stuff in the release notes, e.g. https://git.coopcloud.tech/coop-cloud/matrix-synapse/src/branch/main/release/3.0.0+v1.74.0
I think @yksflip once suggested to include a diff output in the
upgrade
prompt which might be a way to go. A separate command also sounds good to me.checking for env changesto Checking for env changes@moritz I just saw https://github.com/aymanbagabas/go-udiff and it looks likes kinda handy for this:
Could there perhaps be a way to parse both the
.env.sample
,$domain.env
to only get the uncommented env vars being used and then feed them into this diff function? Delimiting with a newline might give the right output.Then we wouldn't have to mandate that operators keep their
.env
files matching or never delete stuff or whatever, we just diff against "in use" env vars?This would be a simpler model perhaps for maintainers also. If you introduce an uncommented env var into the
.env.sample
, then it will get diffed.abra app config [--diff]
and potentially showing this onabra app deploy/upgrade
?/cc @nicksellen re: "One thing (aside from me reading the maintainers manual) that might be useful is something to check/update/validate the env configs when there are upgrades/changes..." from https://codeberg.org/bath.social/server/wiki/2023-07-19-Upgrade-tales
Lol ok
app check
has worked like this all along 🙃 Just need to improve the output & add a warning to the deploy/upgrade flow for flagging when env vars are missing. Then I think it would be a good idea to document our thoughts from here and close off #359