fix: make branches available as recipe source #453
Closed
stevensting
wants to merge 3 commits from
branch-recipes into main
pull from: branch-recipes
merge into: toolshed:main
toolshed:main
toolshed:local-integration-testing
toolshed:renovate/otel-weaver-0.x
toolshed:renovate/codespell-2.x
toolshed:renovate/github.com-charmbracelet-lipgloss-2.x
toolshed:renovate/github.com-charmbracelet-bubbletea-2.x
toolshed:renovate/tonistiigi-xx-1.x
toolshed:renovate/alpine-3.x
toolshed:renovate/github.com-charmbracelet-log-2.x
toolshed:chore-deps
toolshed:fix/492
toolshed:fix/deps
toolshed:fix/613
Dismiss Review
Are you sure you want to dismiss this review?
Labels
Clear labels
bug
build
ci/cd
critical fix
design
documentation
duplicate
easy-first-issue
enhancement
help wanted
i10n
i18n
installer
invalid
question
release
release-candidate
security
tech-debt
test
wontfix
Something is not working
go build related issues
Building things with CI/CD
https://docs.coopcloud.tech/federation/resolutions/passed/010/
UI/UX
Documenting all the things
This issue or pull request already exists
Something for new people to get stuck into. We hope it's easy!
New feature
Need some help
Everything to do with localisation
Everything to do with internationalisation
Everything to do with the install script.
Something is wrong
More information is needed
Release management
Related to the new release candidate
Security related
Unit/integration testing
This won't be fixed
No Label
enhancement
Milestone
No items
No Milestone
Projects
Clear projects
No project
abra v0.10.0
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
BornDeleuze
Brooke
carla
cas (Cassowary)
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
iexos
jade (Jade Ambrose)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
moosemower
moritz
notplants
oxaliq (sorrel)
p4u1
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
renovate-bot (Comrade Renovate Bot)
ripclap
simon
sixsmith (Sixsmith)
stevensting
trav
val (val (he/him))
yksflip
Clear assignees
No Assignees
stevensting
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: toolshed/abra#453
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "branch-recipes"
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?
Oh this is really cool @stevensting! Thanks for working on this!
A few minor comments below.
I'd be quite nervous to merge this without a test. Got any ideas? If it's really too awkward, lemme know how you manually tested it and I can also try.
@@ -95,6 +95,7 @@ func (r Recipe) GetVersionLabelLocal() (string, error) {for _, service := range config.Services {for label, value := range service.Deploy.Labels {log.Debugf("checking deploy label '%s'", label)Could we make this message more specific, e.g. what are we checking for?
Also, you don't log the
value, is that by choice?@@ -68,6 +68,7 @@ func (r Recipe) EnsureExists() error {// EnsureVersion checks whether a specific version exists for a recipe.func (r Recipe) EnsureVersion(version string) (bool, error) {isChaosCommit := falselog.Debugf("Ensuring version '%s'", version)%s/Ensuring/ensuring(lowercase convention everywhere else in the codebase).Also, can you make this more specific, e.g. using the
r.Namethere too?@stevensting FYI there is some prior art in unit testing this stuff below, thanks to @ammaratef45 🎉 Let me know if you have spoons / cycles to finish this up in the next days, we can try to coordinate to get this change into the new release? Thanks!
74108b0dd9/pkg/git/init_test.go (L11-L35)(Copying over from chats FYI)
decentral1se referenced this pull request from toolshed/organising2025-01-03 19:31:43 +00:00
Make branches available as recipe sourceto fix: make branches available as recipe sourceAnother terrifying reference: https://github.com/go-git/go-git/issues/363#issuecomment-943534705 Even Git itself has no idea how to figure this out 😱
There's an implementation of "if transport supports directly peeking where HEAD points to, use that" here which I also tested but
refs["HEADS"].Target()returnsniland it explodes for the Collabora recipe (usesmain).We're definitely not doing "if the git_default_branch_name (from the git configuration: key init.defaultbranch) exists at remote, use it" either.
We could try to implement all that?
@stevensting maybe you can explain what others branches you're using that are not
master/mainand how you've configured your Git setup? Then we can know how to "guess" this correctly in our implementation.🤔🤔🤔
Due to this being a hornest nest, we're gonna abandon it (just chatted on Matrix). I'm gonna try fix #464 which I hope is unrelated. If that works out, then I guess we will have to say "this is an upstream limitation and please use main for branches". Updates coming soon hopefully.
The goal of this PR was to make
RECIPE=backupbot-two:mycoolbranchwork. This should be possible right?#468
Pull request closed