Checking for env changes #446
Closed
opened 2023-04-14 15:33:56 +00:00 by moritz
·
4 comments
Labels
Clear labels
abra
awaiting-feedback
backups
bug
build
ci/cd
community organising
contributing
coopcloud.tech
design
documentation
duplicate
enhancement
fedi
fedi-infra
finance
funding
good first issue
help wanted
installer
legal
performance
proposal
question
security
test
wontfix
Everything to do with abra
Ping/pong on comms
Something is not working
Go build related issues
Getting the robots into the mix
Opening this thing up
Contributors stuff
Our main website
Design thinking required
Let's write things together
This issue or pull request already exists
New feature
Democratic decision making
Money things
Anything related to grant funding
Easy start with development
Need some help
Installation related issues
Performance related
Large change which requires feedback & decisin making
More information is needed
Securing our shit
Unit or integration test suite
This won't be fixed
No labels
enhancement
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
BornDeleuze
Brooke
carla
cas (Cassowary)
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
iexos
jade (Jade Ambrose)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
moosemower
moritz
notplants
oxaliq (sorrel)
p4u1
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
renovate-bot (Comrade Renovate Bot)
ripclap
simon
sixsmith (Sixsmith)
stevensting
trav (Trav Fryer)
val (val (he/him))
yksflip
Clear assignees
No Assignees
decentral1se
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: toolshed/organising#446
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
When upgrading apps I run vimdiff between the app
.envfile and the recipe.env.sampleto check for changes and apply them.It would be nice if this could be integrated into abra.
Either an extra command like
abra app diffconfor automatically checking changes at each upgrade and deploy.A good practice way would be to only comment out variables in the
.envinstead 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 coop-cloud/organising#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
.envas 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
upgradeprompt 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.envto 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
.envfiles 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 checkhas 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 coop-cloud/organising#359