Fix branch checking logic #204
Closed
Frando
wants to merge 1 commits from
Frando/abra:fix-branch-detection into main
pull from: Frando/abra:fix-branch-detection
merge into: :main
:main
:renovate/golang-1.27
:renovate/github.com-charmbracelet-bubbletea-2.x
:fix/492
:local-integration-testing
:renovate/github.com-charmbracelet-lipgloss-2.x
:renovate/otel-weaver-0.x
:renovate/codespell-2.x
:renovate/tonistiigi-xx-1.x
:renovate/alpine-3.x
:renovate/github.com-charmbracelet-log-2.x
:chore-deps
:fix/deps
:fix/613
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 labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
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 (Trav Fryer)
val (val (he/him))
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: toolshed/abra#204
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.
Hi,
I was playing with a local recipe (not part of the catalogue) and
abra app deploykept complaining with this error message:FATA[0002] failed to select default branch, even though the repo has a regular main branch.I then went to debugging, and it turns out the
repository.Branch()method somehow does not actually check for branch names, but instead only looks at the git config, where only remote-tracking branches are listed.See https://github.com/go-git/go-git/issues/518 for details.
The attached patch fixes this and thus allows to deploy if
mainis not configured as a remote-tracking branch.An alternative would be to display a more helpful error message if it's actually required that branches have to be configured as remote-tracking branches. Currently the error message
failed to select default branch, while the repo clearly has amainbranch, makes it hard to see what's going on (apart from diving into Go debugging which is new for me too, haven't been doing much in Go so far).Thanks!
Frando
Thanks for diving into this! This looks legit 👍 The
go-gitAPI is pretty obscure, so easy to miss this one. I've run into random issues with the branch logic over time but couldn't really track it down... maybe this is it!Merged in
8458e61d17(with amended git commit message that matches the 'ol https://www.conventionalcommits.org/en/v1.0.0/ for the change log) and added you to https://git.coopcloud.tech/coop-cloud/abra/src/branch/main/AUTHORS.md. Thanks!Pull request closed