Run automatic pre and post migration scripts #813
Open
opened 2026-03-31 17:14:52 +00:00 by p4u1
·
11 comments
No Branch/Tag Specified
main
fix/492
local-integration-testing
renovate/github.com-charmbracelet-lipgloss-2.x
renovate/otel-weaver-0.x
renovate/codespell-2.x
renovate/github.com-charmbracelet-bubbletea-2.x
renovate/tonistiigi-xx-1.x
renovate/alpine-3.x
renovate/github.com-charmbracelet-log-2.x
chore-deps
fix/deps
fix/613
0.13.0-beta
0.13.0-rc2-beta
0.13.0-rc1-beta
0.12.0-beta
0.11.0-beta
0.10.1-beta
0.10.0-beta
0.10.0-rc2-beta
0.10.0-rc1-beta
0.9.0-beta
0.8.1-beta
0.8.0-beta
0.8.0-rc2-beta
0.8.0-rc1-beta
0.7.0-beta
0.7.0-rc3-beta
0.7.0-rc2-beta
0.6.0-beta
0.5.1-beta
0.5.0-alpha
0.4.1-alpha
0.4.0-alpha
0.4.0-alpha-rc8
0.4.0-alpha-rc7
0.4.0-alpha-rc6
0.4.0-alpha-rc5
0.4.0-alpha-rc4
0.4.0-alpha-rc3
0.4.0-alpha-rc2
0.4.0-alpha-rc1
0.3.1-alpha-rc2
0.3.1-alpha-rc1
0.3.1-rc1
0.3.0-alpha
0.2.2-alpha
0.2.1-alpha
0.2.0-alpha
0.1.8-alpha
0.1.7-alpha
0.1.6-alpha
0.1.5-alpha
0.1.4-alpha
0.1.3-alpha
0.1.2-alpha
0.1.1-alpha
0.1.0-alpha
10.0.5
10.0.3
10.0.2
10.0.1
10.0.0
9.0.0
8.0.1
8.0.0
0.7.4
0.7.3
0.7.2
0.7.1
0.7.0
checkout
0.6.0
0.5.0
0.4.1
0.4.0
0.3.1
0.3.0
0.2.0
0.1.2
0.1.1
0.1.0
Labels
Clear labels
bug
build
ci/cd
critical fix
design
documentation
duplicate
easy-first-issue
enhancement
help wanted
i10n
i18n
installer
invalid
question
release
release-candidate
security
tech-debt
test
wontfix
Something is not working
go build related issues
Building things with CI/CD
https://docs.coopcloud.tech/federation/resolutions/passed/010/
UI/UX
Documenting all the things
This issue or pull request already exists
Something for new people to get stuck into. We hope it's easy!
New feature
Need some help
Everything to do with localisation
Everything to do with internationalisation
Everything to do with the install script.
Something is wrong
More information is needed
Release management
Related to the new release candidate
Security related
Unit/integration testing
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
Notifications
Due Date
No due date set.
Blocks
#811 abra app upgrade stability
toolshed/abra
Reference: toolshed/abra#813
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.
Thanks Tobias Featherbutt for starting the discussion and for the great problem and solution statements
Problem:
I have to do manual steps when upgrading a recipe like:
Solution:
Allow writing pre and post scripts in
abra.sh. This way they could also be run manually (for example during testing).Each upgrade can have up to four scripts, which are executed in the order as given here:
upgrade_<version>_pre_local:Execute before actual upgrade locally
Equivalent abra command:
abra app cmd example.com upgrade_1.0.0+1.0.0_pre_local --localupgrade_<version>_post_<service>Execute after actual upgrade in the given
Equivalent abra command:
abra app cmd example.com app upgrade_1.0.0+1.0.0_post_appupgrade_<version>_post_localExecute after actual upgrade locally
Equivalent abra command:
abra app cmd example.com app upgrade_1.0.0+1.0.0_post --localUsing next instead
<version>It is possible to use function names with out the actual version but instead with "next". When running abra recupe release
allnext` upgrade functions will be coverted to functions. This is the same logic as with release notesRelated:
Should we create a wiki page somewhere and start to note what kind of events people want to be able to subscribe to, where they could be found?
For this specific proposition, can @p4u1 give some pros and cons between:
upgrade_pre_localscript?To me the second is more versatile, specifically if you want to pass
from_versionandto_version, which would give a lot of scripts...@ineiti can you give a use case for 2? Also would it still be possible to name the version next and let Abra insert the actual version? I'm not strictly against the more generic entrypoint but still need to be convinced :)
Maybe create a pad and then we can collaborate there?
We are doing this with alakazam, see here
We have hooks for
For example, the stuff we tell Nextcloud to do:
https://git.local-it.org/local-it/kolli-config/src/commit/08e9f8ad9ff5c6300a0a694bc59159229a4d43fd/alaka-defaults.yml#L58-L71
So we just write abra.sh functions and in our alaka-config, the syntax is
<container> <function> <arguments>A usecase for the secret-hook is vaultwarden or kimai
That way we also can run those manually again whenever needed. Works very reliable for us. Having more pre-hooks e.g. to check the Nextcloud apps would be nice though!
Guess we really should develop a plan on how to upstream alakazam features step by step 🤭
this sounds more readable to me (to have one generic script that uses the version numbers as an argument), but both options sound good
I am not sure if it would be able to handle this case still, but it could handle a lot of things!
What alakazam is missing are pre upgrade hooks and hooks bound to specific versions. I really like the idea to bound specific commands to specific versions. I don't have a strong opinion if the version should be part of the function name, which makes the complexity of the hook functions more simple or if it should be passed as argument.
This could be handled by this proposal: #812
For me the main argument in favor of having a separate upgrade function per version is that abra can convert next to the actual version.I don't have a very strong opinion though
sorry for the late reply - when doing upgrades, you can either describe every upgrade step you need to do, but this can get very long. If you have a function with the
from_versionandto_version, then the function can define itself whether it should update things in one go, split it by major/minor/patch versions, or whatever.In the simplest case, the function loops over
upgrade_${version}whereversiongoes fromfrom_versiontoto_version.