WIP: fix: breaking GetRecipeVersions when an invalid recipe versions exist #750

Draft
Apfelwurm wants to merge 3 commits from fixBrokenRecipeCheckout into main
Member

Currently, for example on the zammad recipe, we have a problem when using abra app new and abra app deploy where an old version, in zammads case 1.0.0+6.3.1-95 is 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:

abra app new zammad            ░▒▓ ✔  4s    18:59:07   
WARN zammad: ignoring unsupported options: restart
WARN skipping tag 1.0.1+6.3.1-95: invalid compose config: yaml: unmarshal errors:
  line 104: mapping key "deploy" already defined at line 91
WARN skipping tag 1.0.2+6.3.1-95: invalid compose config: yaml: unmarshal errors:
  line 103: mapping key "deploy" already defined at line 90
WARN skipping tag 1.0.3+6.3.1-95: invalid compose config: yaml: unmarshal errors:
  line 103: mapping key "deploy" already defined at line 90
  

This also changes abra app deploy from directly using app.Recipe.Tags() to app.Recipe.GetRecipeVersions() so it is utilizing the same logic here.
This should be reviewed carefully, because i might not undestand all implications here.

Currently, for example on the zammad recipe, we have a problem when using `abra app new` and `abra app deploy` where an old version, in zammads case `1.0.0+6.3.1-95` is 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: ``` abra app new zammad ░▒▓ ✔ 4s  18:59:07  WARN zammad: ignoring unsupported options: restart WARN skipping tag 1.0.1+6.3.1-95: invalid compose config: yaml: unmarshal errors: line 104: mapping key "deploy" already defined at line 91 WARN skipping tag 1.0.2+6.3.1-95: invalid compose config: yaml: unmarshal errors: line 103: mapping key "deploy" already defined at line 90 WARN skipping tag 1.0.3+6.3.1-95: invalid compose config: yaml: unmarshal errors: line 103: mapping key "deploy" already defined at line 90 ``` This also changes abra app deploy from directly using `app.Recipe.Tags()` to `app.Recipe.GetRecipeVersions()` so it is utilizing the same logic here. This should be reviewed carefully, because i might not undestand all implications here.
Apfelwurm added 1 commit 2026-01-11 18:06:26 +00:00
fix: breaking GetRecipeVersions when an invalid recipe version exists
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
ae9e49e1b5
Apfelwurm added the
bug
invalid
labels 2026-01-11 18:11:06 +00:00
Apfelwurm changed title from fix: breaking GetRecipeVersions when an invalid recipe versions exist to WIP: fix: breaking GetRecipeVersions when an invalid recipe versions exist 2026-01-11 18:14:51 +00:00
ammaratef45 added 1 commit 2026-01-11 18:19:16 +00:00
Merge branch 'main' into fixBrokenRecipeCheckout
Some checks failed
continuous-integration/drone/push Build is failing
683a3bbf3d
Apfelwurm added 1 commit 2026-01-11 18:34:51 +00:00
change usage of tags to recipe versions in deploy.go
Some checks failed
continuous-integration/drone/push Build is failing
a51a3b57f6
Apfelwurm changed title from WIP: fix: breaking GetRecipeVersions when an invalid recipe versions exist to fix: breaking GetRecipeVersions when an invalid recipe versions exist 2026-01-11 18:38:54 +00:00
Member
  • read the code and it lgtm
  • git fetch && git checkout fixBrokenRecipeCheckout && make build
  • .abra app new zammad has expected output
  • existing unit tests pass
  • change is not covered with unit tests

Amazing work @Apfelwurm, Can I nudge you to add some unit tests though?

- [x] read the code and it lgtm - [x] `git fetch && git checkout fixBrokenRecipeCheckout && make build` - [x] `.abra app new zammad` has expected output - [x] existing unit tests pass - [ ] change is not covered with unit tests Amazing work @Apfelwurm, Can I nudge you to add some unit tests though?
Apfelwurm changed title from fix: breaking GetRecipeVersions when an invalid recipe versions exist to WIP: fix: breaking GetRecipeVersions when an invalid recipe versions exist 2026-01-11 18:52:59 +00:00
Author
Member

gone back to WIP, to implement tests :)

gone back to WIP, to implement tests :)
Owner

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 zammad and checks for the warning output.

I would generally hope that running all app_deploy*.bats integration 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!

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 zammad` and checks for the warning output. I would generally hope that running all `app_deploy*.bats` integration tests (see [here](https://git.coopcloud.tech/toolshed/abra/src/branch/main/tests/integration)) 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!
decentral1se removed the
invalid
label 2026-01-11 21:36:05 +00:00
decentral1se added this to the Abra "next" project 2026-01-11 21:36:11 +00:00
Member

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)

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)
Owner

This is basically also my first go project 😆 dog bless us all

This is basically also my first go project 😆 dog bless us all
decentral1se moved this to In Progress in Abra "next" on 2026-01-16 23:06:22 +00:00
Some checks failed
continuous-integration/drone/push Build is failing
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fixBrokenRecipeCheckout:fixBrokenRecipeCheckout
git checkout fixBrokenRecipeCheckout
Sign in to join this conversation.
No description provided.