New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Strategy for Pre/Post Hook Functionality #183
Comments
@rfay @beeradb @tannerjfco Given the larger implications, I wanted to at least draw your attention to this ticket because it will likely a lot of input from one or more of you before this can get to an actionable state. Nothing to do at this moment, but something we'll likely discuss at tomorrow's planning meeting. |
This is an extension of the work previously done by @beeradb here https://gist.github.com/beeradb/e67995bed62f8d9b823c2bc89caac6ea#pull-in-data-from-an-external-source. IMHO, a proper solution will require addressing the following areas:
And beyond a philosophical discussion, we should provide mock examples to help illustrate the points listed above. If we can agree on the 4 items above and the necessity of examples, I would like to put forth a proposal to help push this conversation along. JurisdictionGiven that it’s been years since I’ve developed in an OO language like C++/Java and given that I’m not familiar with how Golang provides extensibility, I may be making an incorrect assumption or two here. In an ideal scenario, each plugin would be responsible for extending the base Storage
StructureThis is where things might get a little more controversial. Namespacing is going to be important, and this might add what appears to be unnecessary levels of hierarchy for simple scenarios. My vote might be something akin to the following:
An example:
WorkflowThings get trick here and we need to work through the user journeys. Once a user has gone through the default |
Updated summary. I now consider this actionable from the perspective of driving this to a completion point. |
Some ideas/thoughts here. Hopefully it all makes sense, happy to clarify if something's fuzzy.
I think the config.yaml that 'ddev config' generates should provide the minimal post-deploy steps for drupal or wordpress for the start/import commands, and link off to docs for users to determine what else they can do. We could have plugins provide expanded post-deploy steps specific to their requirements, depending on how we end up handling plugins. e.g. If we provided the option to "ddev config pantheon", the generated config would have any pantheon-specific deploy steps.
metadata: I think a new section in config.yaml is fine, and I think we should avoid introducing more configuration files if possible
I like the idea of specifying the deploy steps related to ddev command. I don't really see why we would need to specify site type or plugin though. As for the steps themselves, I think we should simply provide ways to define commands to run. It would be great if you could also specify ddev commands to run after other ddev commands, e.g. allow for import to run after start.
The user would be introduced to the information upon their first viewing of the config.yaml file generated by ddev config. They could then customize the configuration to meet their specific needs, referencing documentation we provide. |
After an initial/quick review of @tannerjfco's last comment here #183 (comment), I'm mostly in agreement. The one area that I'm not quite sure about is the counter proposal on the extend_commands. However, given that we only have a few provider plugins out of the gates and we've discussed versioning our config files, I'm fine with starting with this structure for now and extending/evolving as needed. |
One other item that we probably need to resolve before this is truly actionable. We'll need to determine whether or not re-running ddev config wipes out any user defined configurations (e.g. do they persist after the initial ddev config run). Another moment in time worth considering is upgrades. At each version release, there is a possibility to break previous config structures and that might be a moment in time to prompt a user to save a copy of their pre-existing config before it's replaced. The trick at this stage is to not overthink this too much so we can start somewhere. Still, I think we're close to getting to specific acceptance criteria for an initial release of this functionality. |
Slept on this and have some feedback after review (w/coffee) this morning. I wanted to drop this quick note in case anyone caught my comments last night and is actively responding. TL;DR, I think we have a path forward. |
Feedback
|
Proposed Next Actions:
I know there is still some work, but given that we're wanting to really wait for end-user feedback to help guide the future direction of how we handle plugins, the same will be true for this type of config and I'd rather ship something versus hold this in purgatory. I don't think anything I've requested above will be controversial, so my hope is that there is alignment and we just need to pick an option for the peristence, workflow, and just get this to actionable! |
I think that's more a question as to what we test. I would expect we have the underlying "hook" functionality itself to test. It could also be that for drupal/wordpress we provide a minimal "hook" configuration to address the basics, such as search-replace or cache clear, at which point those minimal configurations get tested.
This feature could lead to users doing all sorts of interesting things. We'll have to decide how much we should / can handle bad configurations.
There definitely needs to be output to the user to indicate additional tasks are occurring
My perspective regarding config.yml is that we help create it initially via "ddev config", but from that point forward it is the user's file to control. We need to decide if that's true though, and related decide if we control the main docker-compose.yml or not. We currently allow "ddev config" to "re-configure" a site, so we would have to address how to handle reconfiguring. A possibility could be that we allow to reconfigure still, with the understanding that it would replace their existing configuration.
I would expect we leverage
I mentioned this somewhat as a possibility in the first question, but a possibility is to provide a minimal set of extend_command usage relevant to their platform (drupal/wordpress). We could have ddev config prompt the same way it does now, and add messaging to the completion to instruct the user to review the configuration file. The configuration file itself should then have comments explaining what things do, and link off to documentation for more details. It makes sense to me to consider ddev config as how you start your configuration, but to then provide documentation for how to expand the configuration to meet their needs. |
Well, that is frustrating... I had a comment in progress that didn't get submitted. Going to attempt a shorter summary. |
It sounds like we're fine to start pursuing this as follows:
The only up in the air section is whether config persists or not. My vote is to have some flag in the middle of the yml file. ddev config will control everything above the line and leave everything below the line. So user defined extends would carry if someone re-ran @tannerjfco if you're in agreement (and might want a sanity check from @beeradb), let's detail out a little more and convert to actionable. |
Follow-up based on a convo w/@tannerjfco on hangouts:
|
Functionality is merged. Great job, @tannerjfco! |
What happened (or feature request):
Feature Request
Acceptance Criteria:
ddev
functionality.Related Conversations
This has been touched on within other issues:
The text was updated successfully, but these errors were encountered: