Smoother Support for hacking on recipes #606
Labels
No Label
abra
abra-gandi
awaiting-feedback
backups
bug
build
ci/cd
community organising
contributing
coopcloud.tech
democracy
design
documentation
duplicate
enhancement
finance
funding
good first issue
help wanted
installer
kadabra
performance
proposal
question
recipes.coopcloud.tech
security
test
wontfix
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/organising#606
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?
Hacking on recipes as an operator is a task, that occurs quite regularly. Currently the concept of "take the local git repo for that recipe as it is and don't do any magic with it" is supported with the
--chaos
flag. This works in general but has some inconveniences:--chaos
flag for every commandTo mitigate these problems I propose to have a new abra app sub command:
This will do the following things:
The
abra app hack
command should output that directory, to easily navigate there.It should be possible to give a fixed location with a
--path
flag:In that case it looks for a git repository in that location. Only when no git repository is found it will do the cloning/copying
.env
file for that app to include the local path of the git repository. Something like this:Before:
After:
After done hacking you either manually remove the chaos line in the
.env
file or you callThis should more or less solve the issues described above:
Issue 1: You now only have to indicate once that you want to start hacking on a recipe and once for ending
Issue 2: The hacked recipe is now specific to the app, that I'm working on (while still possible to use the same hacked recipe for all deployments with the
--path flag
Issue 3: If I hack on a recipe and commit the
.env
file with the chaos modification, my comrades will know not to touch this recipe (have to think some more on how to better prevent accidents here)Great proposal @p4u1 thank you!! I totally support this concept 👍
Question: What does
:chaos
do inRECIPE=~/.abra/recipes/wordpress-mywordpress.example.com:chaos
? To check, I assume this means "always use latest commit" because you might want aRECIPE=~/...
which uses the default behaviour (checkout latest tag orHEAD
)?I think issue 3 is a broader discussion which was attempted to be addressed by R013 (which needs a re-write /cc @3wordchant @wolcen). If you commit locally your "hack"/"chaos" marker to the
.env
, you need to sync that. If you're friends are also hacking at the same time, they should get a "oh no someone is hacking" when they try to deploy and the.env
files sync.I think there are several things which will be enabled by the
RECIPE=...
syntax proposal @p4u1 and we should aim for that first. Then we should try to make a plan what use-cases to work on after, towards actually stable hacking/deploy ops in Co-op Cloud. So many moving parts...Thanks for raising & prototyping this UI 👏
@p4u1 thanks so much for proposing, awesome efforts as usual 🙏
These are all certainly annoying problems which I also run into regularly.
My questions to you are: could all 3 problems be solved adequately by Resolution 013's
OPERATOR_SYNC_VERSION=00acabacab
? And do you agree that there are advantages to doing it that way? I am certainly open to this proposed if your answer to either question is "no".Example
I want to hack on the Wordpress recipe, for example to add sqlite support.
Now
~/.abra/servers/example.com/wordpress.example.com.env
containsOPERATOR_SYNC_VERSION=00acabacab
.If anyone runs
abra app deploy wordpress.example.com
, the same00acabacab
commit (on thefeat/sqlite
branch) is deployed.--chaos
is not required.If anyone (including me) runs
abra app upgrade wordpress.example.com
, there is a warning that the upgrade will move away from a chaos version.Deployments of
wordpress2.example.com
are unaffected, and can be upgraded normally without warning.Advantages
Other collaborators can still redeploy
wordpress.example.com
.The deployed version of
wordpress.example.com
is stored in version control.Disadvantages / mitigations
The one downside I can think of is that it could be annoying that if I deploy / upgrade
wordpress2.example.com
, it will switch~/.abra/recipes/wordpress
away from thefeat/sqlite
branch to a checkout of a specific tag onmain
. My suggested mitigation for this (bearing in mind that no data loss would ever occur here) is to document thatgit-worktree
is recommended for long-term recipe hacking.