fix: make recipe name autocomplete less slow #604
Merged
decentral1se
merged 4 commits from 2025-08-24 07:24:48 +00:00
fix/567 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#604
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.
See #567. My proposal was #567 (comment).
Benefit along the way: it's now possible to autocomplete remote recipes.
@@ -39,3 +40,3 @@// RecipeNameComplete completes recipe names.func RecipeNameComplete() ([]string, cobra.ShellCompDirective) {catl, err := recipe.ReadRecipeCatalogue(false)catl, err := recipe.ReadRecipeCatalogue(true)Even when offline, I think it would be nice to "cache" the catalogue in memory. Otherwise everytime we hit it reads the recipe catalogue again. What do you think @decentral1se
@p4u1 good idea, that does make a lot of sense. I can see we are doing multiple calls in some code paths. Should we maybe try something like https://github.com/kofalt/go-memoize for this? Otherwise,
cobradoes provide context, but it might be awkward putting that in / retrieving it elsewhere...I tried it out but I fear the situation that people then want a flag or some way to bust the cache or they don't even realise it is being cache and can't seem to get the latest catalogue values... I am gonna leave this off for someone smarter than me 🙃
@@ -50,2 +57,4 @@}for _, recipeLocal := range localRecipes {recipeNames = append(recipeNames, recipeLocal)Sweet!
2e37c14fc4toa30282e1c1a30282e1c1to727753bd2e727753bd2eto42dde0930d