fix: breaking GetRecipeVersions when an invalid recipe versions exist #750
Reference in New Issue
Block a user
No description provided.
Delete Branch "fixBrokenRecipeCheckout"
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?
Currently, for example on the zammad recipe, we have a problem when using
abra app newandabra app deploywhere an old version, in zammads case1.0.0+6.3.1-95is selected and deployed.This is due to invalid compose files in the tags 1.0.1+6.3.1-95, 1.0.2+6.3.1-95 and 1.0.3+6.3.1-95 which break GetRecipeVersions() to early, which prevents the detection of newer releases.
This change changes the behavior from erroring silently to warning the user about it and still iterating over the newer versions.
This results in this case for example in an output like this:
This also changes abra app deploy from directly using
app.Recipe.Tags()toapp.Recipe.GetRecipeVersions()so it is utilizing the same logic here.This should be reviewed carefully, because i might not undestand all implications here.
fix: breaking GetRecipeVersions when an invalid recipe versions existto WIP: fix: breaking GetRecipeVersions when an invalid recipe versions existWIP: fix: breaking GetRecipeVersions when an invalid recipe versions existto fix: breaking GetRecipeVersions when an invalid recipe versions existgit fetch && git checkout fixBrokenRecipeCheckout && make build.abra app new zammadhas expected outputAmazing work @Apfelwurm, Can I nudge you to add some unit tests though?
fix: breaking GetRecipeVersions when an invalid recipe versions existto WIP: fix: breaking GetRecipeVersions when an invalid recipe versions existgone back to WIP, to implement tests :)
Great stuff @Apfelwurm @ammaratef45 🔥
Some times it's a pain to unit test stuff that are in these huge main blocks. In that case, I would just make a simple integration test which does
abra app new zammadand checks for the warning output.I would generally hope that running all
app_deploy*.batsintegration tests (see here) would help make you feel better about whether this works or not 🙃It might seem like a lot but you can run the entire suite locally thanks to the work of @p4u1. We did our best with the docs: https://docs.coopcloud.tech/abra/hack/#running-them-locally more eyeballs and people diving in is extremely welcome!
I find it helpful to extract some of the code from the huge main block into a function to unit test, I don't know what is the norm for go developers though (this is the only project written in Go that I ever worked on lol)
This is basically also my first go project 😆 dog bless us all
@Apfelwurm any updates on this?
tried it this evening, but had problems with even running both the unit as well as the integration tests in a consistent manner locally, so i gave up for the day after like 1,5h :D
I think with another try and maybe some help (@p4u1 ? <3 :D ) i will get through it. Gonna need some time though, cause currently a lot is going on :)
Cool! no rush, let me know if I can help too
a51a3b57f6to58b789121958b7891219toc08314e1ccOh dear, let us know how we can help!
Everything seems to be passing atm... https://build.coopcloud.tech/toolshed/abra/3538
thank you @Apfelwurm for pointing me to this issue, I will keep an eye on it and once it's resolved and I will try and push the updates for zammad on abra.
ah, just seeing this message here :D
you can either do that, or just quickly clone the abra repo, check out the fixBrokenRecipeCheckout branch and run
make build && make installto use it. The changes are working and should not break anything else, the only thing missing are the tests as of right now :)c08314e1cctod155333e20WIP: fix: breaking GetRecipeVersions when an invalid recipe versions existto fix: breaking GetRecipeVersions when an invalid recipe versions existfinnaly looked into the integration tests together with @p4u1 and we wrote this simple one based on the zammad recipe.
We tried to custom build a broken test recipe for the case, but somehow we could not reproduce the initial problemetic behaviour there, which is quiet strange, but i think this is a result of some cascading bugs which i don't understand yet :'D
Non the less, this PR does what its supposed to and fixes zammad deployment :)
PS: For unit tests the time is currently sadly to sparse
🥇
@Apfelwurm the test seems to be failing on the nightly CI
Oh no :/ cant reproduce this locally, is this maybe a timeout issue in the recipe? we could theoretically remove the assert_success, since it is not 100% required to make sure that the fix does its job, since the used version is what we care about, but that feels kind of ugly :D Is there any easy way to get the logs? maybe we should also consider to implement some mechanism, that automatically prints the abra logs contents when executed in the ci?
Ah fuck it, let's just do
7c3364f87a🤸♀️huh, what does
--no-converge-checksdo?