feat: recipe generate: load category and features #137
No reviewers
Labels
No Label
bug
build
ci/cd
contributing
design
documentation
duplicate
enhancement
help wanted
invalid
meta
question
security
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/abra#137
Loading…
Reference in New Issue
No description provided.
Delete Branch "catalogue-metadata"
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?
This (jankily) loads metadata from recipe README files to populate the
category
andfeatures
sections.Parsing
status
is not implemented yet, because I want to clean up how the scores are represented in the READMEs themselves first.This runs fine on several recipes.
@roxxers any tips on making the code less repetitive and more elegant? I have no real idea what I'm doing here :P
One problem is that I'm having trouble authenticating with Docker Hub to fetch manifests, for recipes that have tags:
04c6e4a30a
toe0fefd9fc6
🔥 G R E A T 🔥
@ -133,1 +133,4 @@
isClean, err := gitPkg.IsClean(rm.Name)
if err != nil {
return
logrus.Fatal(err)
@ -162,6 +171,8 @@ A new catalogue copy can be published to the recipes repository by passing the
logrus.Fatal(err)
}
features, category, err := catalogue.GetRecipeFeaturesAndCategory(recipeMeta.Name)
missing
if err != nil ...
dance for thiserr
?@ -374,6 +375,116 @@ func ReadReposMetadata() (RepoCatalogue, error) {
return reposMeta, nil
}
func GetStringInBetween(str string, start string, end string) (result string) {
can do
str, start, end string
as they're all typestring
also you can make the return
(result string, err error)
and then if you have success doreturn str..., nil
or if you have a failure doreturn str/"", fmt.Errorf(...)
where it doesn't matter whatstr
is becauseerr != nil
on the caller side.@ -377,0 +399,4 @@
}
if len(imgFields) < 3 {
logrus.Warnf("Image string has incorrect format: %s", imageRowString)
fyi most logging is all lowercase in the codebase for some reason idk
This is go formattings work. all logs should start with lowercase. I mean its a style thing and I don't know why it wants that but might as well keep the style going. Plus I personally think it looks nice.
Thanks @decentral1se @roxxers! Made those changes, anything else?
WIP: feat: recipe generate: load category and featuresto feat: recipe generate: load category and featurese602c70bea
to711c4e5ee8