homebysix / recipe-robot

A kick ass tool for creating AutoPkg recipes.
Apache License 2.0
301 stars 28 forks source link

Switch option to specify description when you get "[WARNING] No GitHub description provided." while running Recipe Robot #191

Closed fseesink closed 2 years ago

fseesink commented 3 years ago

Is your feature request related to a problem? Please describe.

I tried using Recipe Robot 2.2.0 to build a recipe for the Murus Firewall. After finding their official site's download link was very version-specific, I eventually realized by looking at the URL that they use a GitHub repo. Unfortunately, when I ran Recipe Robot using the URL to that repo, I got a

[WARNING] No GitHub description provided. in the output... and no recipes.

I believe that is the only thing preventing Recipe Robot from generating the recipes, as it found the .ZIP and seemed to figure out the rest.

Describe the solution you'd like I would love to see an flag/switch parameter/option added such as --description the lets you simply enter a short description so that Recipe Robot can use that if it hits such an issue. This would allow Recipe Robot to generate recipes in more situations where a GitHub repo lacks that.

Describe alternatives you've considered At the moment, I don't know of an alternative to get Recipe Robot to get around this. My only option right now is likely to take another set of recipes generated for another GitHub repo and manhandle them into dealing with this.

Additional context That's it. Just hoping to add something that lets Recipe Robot generate recipes where currently it won't.

fseesink commented 3 years ago

Looking through the code, it appears as if the warning is generated around line 1390 in inspect.py inside the function inspect_github_url(). That, in turn, seems to be called in 2 places in the same file, notably in the function inspect_download_url().

If I am understanding the code logic correctly, you are leveraging this facts variable as a continually updated dictionary. And the particular missing element is facts['description']. If there was a way to "inject" facts into the dictionary when running Recipe-Robot (at least from the CLI), that might offer a lot of flexibility beyond just getting past this minor hangup that prevents recipe generation.

fseesink commented 3 years ago

Ok, I tried something, and now I'm wondering if this is a feature request, simply a lack of output, or a bug.

I modified inspect.py line 1382 to hard code "Murus" into the description variable so it wasn't empty, then re-ran Recipe Robot, figuring that was all that was stopping things. But it still generates the same error message, only now there are no warnings/etc. in the output:

 Processing: https://github.com/TheMurusTeam/Murus
Input path looks like a GitHub URL.
Getting GitHub repo...
    GitHub repo is: TheMurusTeam/Murus
Getting app name...
    App name is: Murus
Getting GitHub description...
    GitHub description is: Murus
Getting information from latest GitHub release...
    GitHub release download format is: zip
    GitHub release download URL is: https://github.com/TheMurusTeam/Murus/releases/download/v2.1.1/murus-2.1.1.zip
    Download URL is: https://github.com/TheMurusTeam/Murus/releases/download/v2.1.1/murus-2.1.1.zip
Downloading file for further inspection...
    Download content-type is application/octet-stream
    Downloaded to /Users/frank/Library/Caches/Recipe Robot/2021-10-02_16-02-27_073244/murus-2.1.1.zip
Determining download format...
    File extension is zip
    Successfully unarchived zip
Getting developer name from GitHub...
    GitHub developer is: The Murus Team
[ERROR] I wasn't able to gather enough information about this app to make recipes. If you saw any warnings above, they may contain more specific information.

Digging further, I'm wondering if things are crapping out because this .zip file, when decompressed, actually becomes a .dmg. And inside the .dmg you then have a typical Mac application bundle.

homebysix commented 3 years ago

As you deduced, the lack of a description is just a warning, and should not prevent the creation of recipes.

Apps distributed as dmg-in-a-zip are rare (since double compression provides no benefit), and Recipe Robot isn't built to handle that combination of formats. You might try providing the app itself as input — this would allow Recipe Robot to search for a Sparkle feed to use. If that fails, you might have to build recipes manually for this particular app.

fseesink commented 2 years ago

In the end that (build the recipe manually) is what I ended up doing. I took an existing recipe built with RecipeRobot for another GitHub-based app, one that worked, and then figured out the bits to deal with the dmg-in-a-zip situation.

So slowly but surely advancing from just using AutoPkgr and MunkiAdmin GUIs to using RecipeRobot to now dealing with the edge cases like this. I will say I love using the whole Munki ecosystem. Very much appreciate all the work put into it.

homebysix commented 2 years ago

Excellent! I'm going to continue considering dmg-in-a-zip out of scope unless it becomes more common.