Skip to content

Create Strategy for Pre/Post Hook Functionality #183

Closed

Description

@rickmanelius

What happened (or feature request):

Feature Request

Acceptance Criteria:

  • Decision on jurisdiction and how/where to extend default ddev functionality.
  • Decision on storage locations for metadata and busienss logic.
  • Decision on metadata structure.
  • Decision on workflow for end-user creating and updating metadata.
  • Mocked out user journeys and example configuration files.
  • Documentation on how to extend pre/post hook functionality through plugins.

Related Conversations

This has been touched on within other issues:

Activity

  1. added this to the milestone on Apr 25, 2017
  2. rickmanelius commented on Apr 25, 2017

    @rickmanelius
    ContributorAuthor

    @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.

  3. rickmanelius commented on May 4, 2017

    @rickmanelius
    ContributorAuthor

    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:

    1. Jurisdiction: What portion of ddev OR the ddev plugins are responsible for the managing the metadata?
    2. Storage: Where is the metadata and business logic stored?
    3. Structure: What pattern should we adopt for the metadata and business logic to make this repeatable and extendable?
    4. Workflow: How does an end-user install, update, and otherwise interact with this information.

    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.

    Jurisdiction

    Given 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 ddev functionality as well as managing its own metadata required to power these additions. For example, if we had a plugin for drud hosting and wanted to extend the default ddev import-db command, the plugin might provide default keys in the YML file to target the remote server information.

    Storage

    • metadata: The question here is whether or not we place ALL the configuration into a single configuration file (currently .ddev/config.yml) or if we adopt an approach like we’re pursuing with the docker-compose.foo.yml (see As a developer, I want the ability to use custom containers. · Issue #121 · drud/ddev · GitHub).
    • business logic: I don’t have a preference here, but I’m assuming that if we rely on each plugin to control the metadata that it makes sense for it to also control the business logic. In essence, if we had a “drud hosting” plugin, we would require this plugin to extend the default ddev commands and/or provide its own commands.

    Structure

    This 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:

    $site-type:
      $provider-plugin:
        $ddev-command:
          $trigger:
            $insert-data
    

    An example:

    drupal:
      pantheon:
        _general:
          site-id: mysite
        import-db:
          post:
            prod:
              drush:
                - “cc all”
                - “updatedb” 
    

    Workflow

    Things get trick here and we need to work through the user journeys. Once a user has gone through the default ddev config step, we now have a key piece of information (the application type). At that point we can either prolong the ddev config process by asking questions from each plugin related to that site type. Example: a pantheon plugin could have questions specific to a wordpress site versus a Drupal site. Alternatively, we could not require ddev config to handle that and simply export a series of sane defaults and then prompt the user to visit the config file to modify. I prefer the questions through a wizard, but that could be a heavy lift.

  4. rickmanelius commented on May 4, 2017

    @rickmanelius
    ContributorAuthor

    Updated summary. I now consider this actionable from the perspective of driving this to a completion point.

  5. self-assigned this
    on May 16, 2017
  6. modified the milestones: , on May 19, 2017
  7. modified the milestones: , on May 30, 2017
  8. 16 remaining items

  9. modified the milestones: , on Jun 29, 2017
  10. rickmanelius commented on Jul 7, 2017

    @rickmanelius
    ContributorAuthor

    Functionality is merged. Great job, @tannerjfco!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions