Smoother Support for hacking on recipes #606
Closed
opened 2024-04-08 10:04:44 +00:00 by p4u1
·
5 comments
Labels
Clear labels
abra
awaiting-feedback
backups
bug
build
ci/cd
community organising
contributing
coopcloud.tech
design
documentation
duplicate
enhancement
fedi
fedi-infra
finance
funding
good first issue
help wanted
installer
legal
performance
proposal
question
security
test
wontfix
Everything to do with abra
Ping/pong on comms
Something is not working
Go build related issues
Getting the robots into the mix
Opening this thing up
Contributors stuff
Our main website
Design thinking required
Let's write things together
This issue or pull request already exists
New feature
Democratic decision making
Money things
Anything related to grant funding
Easy start with development
Need some help
Installation related issues
Performance related
Large change which requires feedback & decisin making
More information is needed
Securing our shit
Unit or integration test suite
This won't be fixed
No labels
abra
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
BornDeleuze
Brooke
carla
cas (Cassowary)
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
iexos
jade (Jade Ambrose)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
moosemower
moritz
notplants
oxaliq (sorrel)
p4u1
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
renovate-bot (Comrade Renovate Bot)
ripclap
simon
sixsmith (Sixsmith)
stevensting
trav (Trav Fryer)
val (val (he/him))
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: toolshed/organising#606
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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
--chaosflag. This works in general but has some inconveniences:--chaosflag 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 hackcommand should output that directory, to easily navigate there.It should be possible to give a fixed location with a
--pathflag: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
.envfile 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
.envfile 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 flagIssue 3: If I hack on a recipe and commit the
.envfile 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
:chaosdo 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.envfiles 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.envcontainsOPERATOR_SYNC_VERSION=00acabacab.If anyone runs
abra app deploy wordpress.example.com, the same00acabacabcommit (on thefeat/sqlitebranch) is deployed.--chaosis 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.comare unaffected, and can be upgraded normally without warning.Advantages
Other collaborators can still redeploy
wordpress.example.com.The deployed version of
wordpress.example.comis 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/wordpressaway from thefeat/sqlitebranch 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-worktreeis recommended for long-term recipe hacking.We're further along now with #533.
coop-cloud/organising#467 is still outstanding though.
I believe this is resolved with the 2 following approaches which have been in testing for months now but not really well documented. You can use the
abra.ymland "remote recipes" to have a collaborative, per-project, recipe-hacking-friendly setup now.I think a lot of these "tips & tricks" for smoother workflows while hacking/collaborating with others could be better understood and we'll have to see we can bring this to the forefront with the documentation. I am hoping we will make progress on #665 in the near future.
Gonna close for now. Feel free to re-open or open specific tickets for improvements (e.g. toolshed/abra#468) or missing parts. Thanks for all the input 💝