Annotated vs lightweight tags confuse go-git #185

Closed
opened 2021-10-05 14:46:21 +00:00 by knoflook · 7 comments
Owner

go-git uses different incompatible functions with different types of returned objects to list annotated and unannotated tags (to make programming more fun and challenging I suppose). We have to decide on which tags we'll be using for our apps. I think we can go with annotated tags as we can put release notes in the tag metadata and also they automatically include info like the name of the person that created the tag (which would be useful if we want to bully them for making a mistake). If you use the wrong type of tag and then try to use abra recipe release -x/y/z appname it's gonna do this:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xbbad3e]

a third option would be to write our own function to collect both annotated and lightweight tags and then present them as an array of plumbing.Tag objects but this is additional work

https://pkg.go.dev/github.com/go-git/go-git/v5#Repository.Tags
https://pkg.go.dev/github.com/go-git/go-git/v5#Repository.TagObjects

go-git uses different incompatible functions with different types of returned objects to list annotated and unannotated tags (to make programming more fun and challenging I suppose). We have to decide on which tags we'll be using for our apps. I think we can go with annotated tags as we can put release notes in the tag metadata and also they automatically include info like the name of the person that created the tag (which would be useful if we want to bully them for making a mistake). If you use the wrong type of tag and then try to use `abra recipe release -x/y/z appname` it's gonna do this: ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xbbad3e] ``` a third option would be to write our own function to collect both annotated and lightweight tags and then present them as an array of `plumbing.Tag` objects but this is additional work https://pkg.go.dev/github.com/go-git/go-git/v5#Repository.Tags https://pkg.go.dev/github.com/go-git/go-git/v5#Repository.TagObjects
knoflook added this to the Versioning and deploy stability milestone 2021-10-05 14:46:21 +00:00
knoflook added the
design
abra
labels 2021-10-05 14:46:21 +00:00
Owner

if we want to bully them for making a mistake

No bullying in Co-op Cloud

If you use the wrong type of tag and then try to use abra recipe release -x/y/z appname it's gonna do this

So, to reproduce, one should git tag -a and write some stuff then abra recipe release ... and it explodes or?

I guess my first take is to bring as much as possible out of Git because it is Git. We can do release notes in a text file instead and can track other meta from the log if really necessary.

Can we write a function to convert annotated tags to the ones we expect?

I may not be understanding the issue correctly ofc 😆

> if we want to bully them for making a mistake No bullying in Co-op Cloud ✋ > If you use the wrong type of tag and then try to use abra recipe release -x/y/z appname it's gonna do this So, to reproduce, one should `git tag -a` and write some stuff then `abra recipe release ...` and it explodes or? I guess my first take is to bring as much as possible out of Git because it is Git. We can do release notes in a text file instead and can track other meta from the log if really necessary. Can we write a function to convert annotated tags to the ones we expect? I may not be understanding the issue correctly ofc 😆
Author
Owner

No bullying in Co-op Cloud

oh no 😢

So, to reproduce, one should git tag -a and write some stuff then abra recipe release ... and it explodes or?

yeah that's what happening to me

I may not be understanding the issue correctly ofc 😆

me neither, i think i might have to come back to it tomorrow with a clear mind 😆

> No bullying in Co-op Cloud ✋ oh no 😢 > So, to reproduce, one should git tag -a and write some stuff then abra recipe release ... and it explodes or? yeah that's what happening to me > I may not be understanding the issue correctly ofc 😆 me neither, i think i might have to come back to it tomorrow with a clear mind 😆
Owner

Thanks for laying this out so clearly @knoflook. I agree with your leaning towards annotated tags, I've used non-annotated tags exactly zero times in my life, why start now 🙃

I can imagine (and am happy to write) a tortured script to change it over after if we decide that unannotated was in fact the move.

Thanks for laying this out so clearly @knoflook. I agree with your leaning towards annotated tags, I've used non-annotated tags exactly zero times in my life, why start now 🙃 I can imagine (and am happy to write) a tortured script to change it over after if we decide that unannotated was in fact the move.
Owner

Shall we just mandate annotated tags for now and document that that is what must be used?

Shall we just mandate annotated tags for now and document that that is what must be used?
Author
Owner

Shall we just mandate annotated tags for now and document that that is what must be used?

i think that's gonna be for the best.

Also I'm working on a change in tagcmp to properly parse tags with "+", we'll see how it's gonna work out

> Shall we just mandate annotated tags for now and document that that is what must be used? i think that's gonna be for the best. Also I'm working on a change in tagcmp to properly parse tags with "+", we'll see how it's gonna work out
Owner

If someone can send a docs patch to https://docs.coopcloud.tech/recipe-maintainer-guide/ stating that we need to use annotated tags then we can close this off for now 🚀

If someone can send a docs patch to https://docs.coopcloud.tech/recipe-maintainer-guide/ stating that we need to use annotated tags then we can close this off for now 🚀
Owner

Threw down something in 8cbc3dbc02 about how I'm doing it now (using git tag manually due to #187). Feel free to update as we go along with all this :)

Threw down something in https://git.coopcloud.tech/coop-cloud/docs.coopcloud.tech/commit/8cbc3dbc02fc9c29d1a7f2e0d35380213e138547 about how I'm doing it now (using `git tag` manually due to https://git.coopcloud.tech/coop-cloud/organising/issues/187). Feel free to update as we go along with all this :)
Sign in to join this conversation.
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/organising#185
No description provided.