I’m not sure if it’s good etiquette to post announcements for new orbs here (please let me know if this is the case). I wrote a new orb for automating Leanpub API operations, to automate my book preview/publishing workflow. Thought others who use Leanpub might find it useful.
@zzamboni I can offer some fuller feedback later, but glancing over this orb quickly, one thing that stands out—
Anywhere you have a parameter whose default value is an environment variable (e.g, $LEANPUB_API_KEY), I would strongly encourage you to change that parameter’s type to env_var_name:
Hi @zzamboni - This is really interesting and unique. Great work! I think your orb covers the use case well, so I’m not planning to reach out to Leanpub separately.
@rose, @tomtrahan - thanks for the kind words! I have been invited to appear in an upcoming episode of Leanpub’s Frontmatter author podcast, so I might mention this there as well. I’ll post an update here if/when this happens.
@rose: thanks for the feedback about the env_var_name parameters. I have updated my orb to use it. I have one question: is it possible to specify that an env var parameter must be specified (i.e. that the corresponding environment variable must be defined)? At the moment I had to insert check code to make sure the job fails when the variable is not defined, like this: https://github.com/zzamboni/leanpub-orb/blob/master/src/%40orb.yml#L87-L90
Thanks again for the feedback and the encouragement - I look forward to any other comments you may have.
@zzamboni No, what you’re doing there is great. It’s not that much boilerplate, but still, it’s a common-enough situation that we could probably abstract that logic into its own orb command. Something like check-env-var-param. It would probably be a great fit for our Orb Tools orb:
Now if only we had top-level parameters, and a list type parameter—then we could use this to easily/automatically check all of an orb job/command’s defined env_var_name parameters…