feat: recipe generate: load category and features #137
Reference in New Issue
Block a user
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
categoryandfeaturessections.Parsing
statusis 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:
04c6e4a30atoe0fefd9fc6🔥 G R E A T 🔥
@ -133,1 +133,4 @@isClean, err := gitPkg.IsClean(rm.Name)if err != nil {returnlogrus.Fatal(err)@ -162,6 +171,8 @@ A new catalogue copy can be published to the recipes repository by passing thelogrus.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 stringas they're all typestringalso you can make the return
(result string, err error)and then if you have success doreturn str..., nilor if you have a failure doreturn str/"", fmt.Errorf(...)where it doesn't matter whatstris becauseerr != nilon 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 featurese602c70beato711c4e5ee8