Add recipe ls command #8
Merged
decentral1se
merged 1 commits from 2021-07-21 11:30:15 +00:00
recipe-ls 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
enhancement
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#8
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.
This works and outputs a sorted list of apps 😀
Not sure how I should organise the helpers tho, any thoughts?
Also, what can be tested here? Can I mock the JSON to do offline tests?
Not much to review since most of it is good! Just one note, and a situation where you don't return an error where you should. So gunna label it as requesting a change for that reason but its a one line change 💙
@@ -0,0 +61,4 @@url := "https://apps.coopcloud.tech"apps := make(AppsJson)if err := getJson(url, &apps); err != nil {logrus.Fatal(err.Error())Your function never returns this error. It is just logging it and exiting the program. You should change this to
return nil, err. This can then be dealt with by the command itself.@@ -0,0 +83,4 @@Action: func(c *cli.Context) error {apps, err := GetAppsJSON()if err != nil {logrus.Fatal(err.Error())This will never be run because you never return an error, see comment on
GetAppsJSON@@ -0,0 +87,4 @@}tableCol := []string{"Name", "Category", "Status"}table := createTable(tableCol)for _, name := range sortByAppName(apps) {I am not totally against this approach. I worry about the speed of it but honestly might just say fuck it and use this as our baseline for sorting maps.
I've seen rumblings on mocking an actual http call in a unit test for a mock one that returns what ever you want. No rush on that right now since this is early days.
5f4d2b88f5to302ebcb394WIP: add recipe ls commandto Add recipe ls commandFixed that one-liner, rebased and will merge when CI is green 🚀