Fork me on GitHub
#babashka
<
2021-10-09
>
nate19:10:09

hey, I'm making some progress on the babashka pod to wrap archiver (https://github.com/mholt/archiver)

🎉 2
borkdude19:10:34

cool! meanwhile @U051N6TTC is looking at adding docstring support for pods :)

borkdude19:10:08

feel free to make a PR to the registry when you think it's ready. I'll play around with it

nate19:10:10

the functions provided map to their equivalents in https://pkg.go.dev/github.com/mholt/archiver#pkg-functions

nate19:10:40

I need to add docs to the README and a few other things, but this should work

nate19:10:49

yeah, will do a registry PR when things are stable

quoll19:10:23

Argh! Please don’t commit me to anything until I’ve got into it! I’m actually editing 2 different projects at the same time right now!

nate19:10:27

cool, glad that the docstring support is coming. That makes me think about other things, like arglists, would those be useful to specify and publish?

borkdude19:10:54

yes, we'll just support meta

borkdude19:10:58

so you can add anything you want

borkdude19:10:28

@U051N6TTC oh no pressure! you can quit any time and then I'll just take it over. you asked for something to do, but there are of course no strings attached :) and there is no deadline

borkdude19:10:58

this is not a critical feature, just a nice to have addition

quoll19:10:38

I get that. I’m just asking to not be called out by name 😊

borkdude19:10:58

sorry about that

borkdude19:10:13

@U051N6TTC I can remove my messages with your name and then you can retract yours if you wish :)

quoll19:10:13

It’s fine

borkdude21:10:50

@U0510902N What would, from e.g. https://github.com/justone/pod-babashka-archiver/blob/95bccbf07e2fc11dfb077fc955a26d51b0d2bada/main.go#L20, be a good format for adding metadata under the meta key? An EDN string, JSON (since you're using that as the payload format) ?

borkdude21:10:07

Say you wanted to add {:doc "foobar" :private true} , you could just write this literally as EDN, wrap it in a string and then be done. but would there be a reason to generate this programmatically from a pod, where you don't always have an EDN library?

nate22:10:18

I really like the fidelity of using edn. I can't think of a reason to need to dynamically generate edn, but there are libs in most languages for it. https://github.com/edn-format/edn/wiki/Implementations#recommended-implementations

borkdude06:10:41

Well let’s settle on an EDN string then. When people want to pass the payload format such as JSON we could make another option for this, like meta-format or so.

borkdude20:10:18

@U0510902N a small note: the pod-<your-id>-<name-of-pod> convention is intended to use a unique name for your-id, the babashka is reserved for pods created within the bb org, so pod-justone-archiver would be a good name I think instead

borkdude20:10:12

the name of your github repo doesn't really matter but this convention exists to prevent having binary name clashes in case you installed the pod using brew or so

nate22:10:04

Cool, makes sense, I'll rename it.

nate03:10:13

anyone have a chance to try it out? here's some sample code:

#!/usr/bin/env bb

(require '[babashka.pods :as pods])
(pods/load-pod "./pod-justone-archiver")

(require '[pod.archiver :as archiver])

(archiver/archive ["."] "../archive.tgz")
(archiver/unarchive "../archive.tgz" "test-dir")
(archiver/compress-file "main.go" "main.go.gz")
(archiver/decompress-file "main.go.gz" "main.go.new")
(archiver/extract "../archive.tgz" "main.go" "test-dir-2")

borkdude07:10:27

I'll try it now!

borkdude07:10:31

Haha, I was trying it from my Downloads directory and didn't notice it archived the entire dir :)

borkdude07:10:36

Works for me!

nate13:10:50

Haha. Oops. Thanks for trying it out.

borkdude17:10:12

@U0510902N quoll (and now I can finally mention her name since she has done the work!) made metadata support: https://github.com/babashka/pods#metadata I bumped babashka master using this. You can grab it from #babashka-circleci-builds or build yourself and test with your pod (or test directly with the pods repo)

nate17:10:43

awesome!! I will grab a build

nate17:10:21

speaking of pods, is there a way to test my pod registry change before opening the PR?

borkdude17:10:58

yeah, you could just place the manifest in the expected location in your ~/.babashka directory

nate17:10:16

ah cool, makes sense

nate17:10:17

thank you