WIP: 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
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.