Consider reimplementing abra in $x language (not Bash) #102
Labels
No Label
automation
bug
community organising
democracy
design
documentation
duplicate
enhancement
finance
funding
help wanted
invalid
publishing
question
security
wontfix
No Milestone
No project
No Assignees
2 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/organising#102
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
It is generally acknowledged that large Bash scripts are hard to write, maintain and extend. However, the context is important: the current iteration of
abra
was written in our free time and without any idea that we'd get paid for it. It has come up a few times, about a re-write of this tool in some other language. So, here is a space for that.My thoughts:
This would be something for Beta -> Stable stage I think. Why? Using Bash is currently super flexible for changes. It has warts but while we're still really exploring interfaces, it is handy imho. The
abra
command-line is still a big design question, so the less boilerplate to move through, the better, right now.If we were considering a rewrite, whatever we were considering would have to retain this "single binary" setup we have now. So, we do not push the responsibility of installing dependencies to the end-user (like is typically done in the world of Python).
I know that projects like https://github.com/dokku are eventually rewriting parts of their tool in Golang after years of running in Bash and finally running into insurmountable Bash nightmares around CLI parsing and UI/UX experience. They are doing a kind of piecemeal replacement where they rewrite some sub-commands and drop them in seamlessly. That sounds like something we could also do.
Consider re-implementing abra in $x language (not Bash)to Consider reimplementing abra in $x language (not Bash)More motivation to rewrite: I've been thinking about it more, and we currently don't have a "single-binary" setup. The shell completion scripts will only be available if you install the dev version, or clone it manually, and we're also vendoring
yq
,jq
, and requiring a growing list of OS packages to be installed.I agree we can probably get away without worrying about a major
jq
oryq
version upgrade, and maybe rolling the shell completions into the main script, until after the Beta, but consider me Very Interested.Python, Go, Rust, are there any other options people have in mind?
Hmmmm good point yep 🤔
Looking at https://git.autonomic.zone/coop-cloud/pyabra, it wasn't actually that bad a proof-of-concept and it could actually deploy things already. As for the single binary, I might give another shot and building it with https://github.com/Nuitka/Nuitka to see if it can indeed generate a x-platform binary.
If not, probably Golang is a safe bet here (I do not say this lightly) because the the Docker APIs are really suited for that and you can even drive Docker via non-public internals if needed? Also, single binaries are the default?
But I still think Python is probably the best fit for us, as we know it already?
Nuitka/Pyoxidizer are still really experimental 🤔
https://github.com/dokku is all Bash and is migrating to Golang:
Where the last one is the reasons listing.
So, I'm tipping towards Golang at the moment...
The CLI package that Gitea are using (the main Golang reference I have) looks very usable:
In some ways, the CLI kinda feels "stable" and we haven't really changed it fundamentally in some time. We've been adding and tweaking but in terms of the design, it has been somewhat fixed.
The final open design questions on the CLI seem to be these tickets?
If we could squash those then we could freeze the CLI in Bash mode. Then we'd have a fixed target to catch up with. Any additions could then be postponed until we archive the Bash implementation.
I've changed my mind from the original "This would be something for Beta -> Stable stage" thoughts because reading https://github.com/dokku/dokku/discussions/4258#discussioncomment-289670 and #102 (comment) and with all the nigtmarish
ensure_stack_deploy
wrangling in coop-cloud/abra#165 I feel like it might just be a better investment to ditch the Bash sooner rather than later?Annnnnndddd we're off!