babashka / bbin

Install any Babashka script or project with one command
MIT License
138 stars 9 forks source link

Consider keeping metadata and scripts separate #34

Open borkdude opened 2 years ago

borkdude commented 2 years ago

Splitting the metadata has the following benefits:

rads commented 1 year ago

Picking up where we left off on https://github.com/babashka/bbin/issues/62#issuecomment-1751995807:

I think there are pros/cons with both approaches. That said, it will be a bit before I change anything here because I want to focus on more user-facing features such as https://github.com/babashka/bbin/issues/33, https://github.com/babashka/bbin/issues/18, and https://github.com/babashka/bbin/issues/69. Let's keep talking about the tradeoffs in the mean time.

teodorlu commented 1 year ago

My thoughts on how to store bbin script metadata (copied from https://github.com/babashka/bbin/issues/62#issuecomment-1751995807, edited for brevity):

I think @borkdude's proposal of having one EDN file per installed script and an operation in bbin to install a script for each EDN file is a good solution.

Why: because implementation complexity and User can track EDN files in Git, and have bbin ensure the scripts are installed on all computers are important, and bbin uninstall safety/atomicity can still be solved in the future.


I mapped this out with a Rich Hickey style decision matrix (as advocated for in Design in Practice). Screenshot:

image

Full document: https://docs.google.com/spreadsheets/d/1AWiYHYteuTtTGCaHWg0DNuX2rTXXJTzZzl0pbOzFsWU/edit#gid=0

(send me a Google account if you want write access, eg to add a new column for a different approach, or to add a new row for a different criterium).

I think "metadata by script install name" is the best place to start, then consider "metadata in transaction log" or "metadata by script hexdigest" later if safe/atomic uninstall is desired.