fix: keep abra working if recipe catalogue is offline #235
Merged
moritz
merged 2 commits from 2022-12-13 14:42:56 +00:00
moritz/abra:main into main
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#235
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.
In case the recipe catalogue server is not accessible most abra commands will not work anymore.
Proposal for coop-cloud/organising#292 :
Show an error and continue with the local recipe catalogue.
This way
abra app deploy -Candabra app upgrade -Cshould still work when the server is down.I'm not sure if supressing this error could lead to any unexpected behaviour.
As I could follow the flow, the following commands will use the
ReadRecipeCataloguefunciton:abra app list --statusabra app rollbackabra app upgradeabra app catalogue generateabra app versionabra app backupabra app errorsabra app restoreabra app newabra recipe lintabra recipe versionsabra recipe releaseabra recipe syncabra recipe upgrade@moritz
This is a nice approach! I had a look at the code again, perhaps we could be more specific on the kind of error return value handling from
recipeCatalogueFSIsLatest? E.g. when it does:And fails, instead of
return false, errwe can doreturn false, CatalogueOfflineError()or something. Then we can do anerrors.Is(...)check on theerr != nilcheck and do thelogrus.Error("unable to retrieve catalogue from internet, using local copy")change as you suggested here? Because some of the errors thatrecipeCatalogueFSIsLatestare valid and should result in failing to continue.One thing to check for is the "first use" case, when there is no local catalogue copy. If we do indeed fail to retrieve it from the internet we should check there is a local copy. If not, there isn't much we can do and we should fail to continue? That shouldn't happen too much ofc.
I changed it,so it catches only
CatalogueOfflineErrors.The check if there is a local copy is already present:
4e78b060e0/pkg/recipe/recipe.go (L725)LGTM
@moritz if you're happy with it, please merge away!
1892e068a3to7bba18b47b