WIP: fix(recipe): Prevent crash when recipe has no previous tag or release #706

Draft
p4u1 wants to merge 1 commits from p4u1/abra:fix-crash-sync into main
Member
No description provided.
p4u1 added 1 commit 2025-10-27 19:14:08 +00:00
fix(recipe): Prevent crash when recipe has no previous tag or release
Some checks failed
continuous-integration/drone/pr Build is failing
dc0cc20141
decentral1se reviewed 2025-10-28 12:26:33 +00:00
decentral1se left a comment
Owner

Thanks @p4u1.

One comment, as I'm not quite sure on the approach.

And an integration test, which creates a new recipe and syncs it, would be great.

🙏

Thanks @p4u1. One comment, as I'm not quite sure on the approach. And an integration test, which creates a new recipe and syncs it, would be great. 🙏
@ -132,3 +133,3 @@
}
latestRelease := tags[len(tags)-1]
latestRelease := "0.0.0+0.0.0"
Owner

Isn't the left-hand side supposed to be 1.0.0 / 0.1.0 following:

cli/recipe/sync.go Lines 85 to 100 in 11656c009d
fmt.Println(i18n.G(`
The following options are two types of initial semantic version that you can
pick for %s that will be published in the recipe catalogue. This follows the
semver convention (more on https://semver.org), here is a short cheatsheet
0.1.0: development release, still hacking. when you make a major upgrade
you increment the "y" part (i.e. 0.1.0 -> 0.2.0) and only move to
using the "x" part when things are stable.
1.0.0: public release, assumed to be working. you already have a stable
and reliable deployment of this app and feel relatively confident
about it.
If you want people to be able alpha test your current config for %s but don't
think it is quite reliable, go with 0.1.0 and people will know that things are
likely to change.

I thought this case was covered 🤔 The logic of the code above doesn't look right because it tests len(tags) == 0 and then access tags later on 😬 I would assume if have no previous release/tag we can construct a choice from the above question and the tag of the app? Otherwise, probably 0.0.0+0.0.0 is going to explode somewhere else 🙃

Isn't the left-hand side supposed to be `1.0.0` / `0.1.0` following: https://git.coopcloud.tech/toolshed/abra/src/commit/11656c009df0f6acb272a0614b12264cf08e82e5/cli/recipe/sync.go#L85-L100 I thought this case was covered 🤔 The logic of the code above doesn't look right because it tests `len(tags) == 0` and then access `tags` later on 😬 I would assume if have no previous release/tag we can construct a choice from the above question and the tag of the `app`? Otherwise, probably `0.0.0+0.0.0` is going to explode somewhere else 🙃
p4u1 force-pushed fix-crash-sync from dc0cc20141 to e11f775260 2025-11-03 16:26:16 +00:00 Compare
Author
Member

@decentral1se thanks for the review. I still have to dive deeper into this... I'm just adding fixes while working on a new recipe and abra panicing

@decentral1se thanks for the review. I still have to dive deeper into this... I'm just adding fixes while working on a new recipe and abra panicing
decentral1se changed title from fix(recipe): Prevent crash when recipe has no previous tag or release to WIP: fix(recipe): Prevent crash when recipe has no previous tag or release 2025-11-04 13:54:26 +00:00
Owner

@p4u1 I wired up a bunch of tests to cover some cases where this might have been going wrong: ce1aa3d870

It doesn't seem to be failing in any obvious way? I'd be curious if you can reproduce your stack trace?

Bonus: it's actually not that bad to simulate user input with the 'ol bash -c "echo ... | ..." trick!

@p4u1 I wired up a bunch of tests to cover some cases where this might have been going wrong: ce1aa3d8705ad0291f0cb3e45888892d99ebc714 It doesn't seem to be failing in any obvious way? I'd be curious if you can reproduce your stack trace? Bonus: it's actually not that bad to simulate user input with the 'ol `bash -c "echo ... | ..."` trick!
Owner
https://git.coopcloud.tech/toolshed/abra/pulls/738
First-time contributor

I am trying to develop a recipe for Friendica. I think I ran into this problem. I run this command for the first time:

abra app deploy friendica.example.dk --chaos

And I get:

panic: interface conversion: reference.repository is not reference.NamedTagged: missing method Tag

Do you have a quick fix I can use, while you get the fix into abra release?
Thanks!!

I am trying to develop a recipe for Friendica. I think I ran into this problem. I run this command for the first time: `abra app deploy friendica.example.dk --chaos` And I get: > panic: interface conversion: reference.repository is not reference.NamedTagged: missing method Tag Do you have a quick fix I can use, while you get the fix into abra release? Thanks!!
Owner

@jeppebundsgaard can you open up a new issue with the output of the command while using --debug? Thanks!

@jeppebundsgaard can you open up a new issue with the output of the command while using `--debug`? Thanks!
This pull request has changes conflicting with the target branch.
  • cli/recipe/sync.go
View command line instructions

Checkout

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