Skip to content

Add asset imports for 'local' platform  #33

Closed

Description

@beeradb

Is this a BUG REPORT or FEATURE REQUEST? (choose one):
Task

Done criteria

  • Creation of import-db command
    • Has a --db-src flag which can be either a .sql file or a .tar.gz
    • If no --db-src flag is provided it will prompt for a value
    • Command will exit (not re-prompt) if the values entered via flag or prompt are invalid. Either by not existing or not being in the specified format.
    • Has no persistent configuration
  • Creation of import-files command
    • Has a --files-src flag which can be either a directory or a .tar.gz
    • If no --files-src flag is provided it will prompt for a value.
    • Command will exit (not re-prompt) if the values entered via flag or prompt are invalid. Either by not existing, or not being in the specified format.
    • Has no persistent configuration.
  • All new commands will only work within an active ddev configuration.
  • All new commands will only work on a running site. If the site is not started, the user will be asked to start the site before running the import

Testing Strategy

  • All 3 commands should have test coverage. Both for CLI flags and prompts
  • After import, we receive 200 status code and preferably check for the existence of a string which is only contained in a site archive.
  • Add an image to the site files import and check that it exists after startup.
  • Ensure files directory is writeable by nginx (known image variation?)

Behavior Mockup

The behavior mockup can be found below in this issue at #33 (comment)

This is just a best-effort mockup, understanding things often change during development. It is meant to be a guide.

Anything else we need to know:
This is a continuation of the work in #27 and #32

Activity

  1. added this to the milestone on Feb 27, 2017
  2. rickmanelius commented on Mar 6, 2017

    @rickmanelius
    Contributor

    Related but not required for 0.2 is the desire to have some shortcut mechanism for taking a standard drush archive import (generally files + db + code is a standard format that someone could unpack and get up and running quickly). This type of ability to spin up rapidly will be available when we have provider plugins like pantheon and DRUD hosting, but is harder with the local plugin given that we have fewer constraints and therefore cannot guarantee that consistency.

  3. rickmanelius commented on Mar 17, 2017

    @rickmanelius
    Contributor

    As per #28 (comment). We would like to ensure that the logic behind "import" is updated and clear from the perspective of end-users knowing the files and database will be destroyed on an import while the codebase will be left intact. This way an end-user can test reverting to a database state while keeping the code in the current working state. We will probably need to provide both options, but need to be thoughtful in how we proceed.

  4. rickmanelius commented on Mar 21, 2017

    @rickmanelius
    Contributor

    @cyberswat Before I update this issue any further. I'm curious if the removal of labels on this issue was intentional?

  5. cyberswat commented on Mar 21, 2017

    @cyberswat
    Contributor

    They needed to be removed and recreated for consistency. Some issues will simply need them added back.

  6. rickmanelius commented on Mar 21, 2017

    @rickmanelius
    Contributor

    Piggy backing off of and clarifying a previous comment (#33 (comment)), we were originaly focusing on importing directly from a drush archive (Drupal) or a WordPress zip file. As per a different conversation (digging it up), we want to keep things more agnostic and simplified during this initial release and then rely on provider plugins (e.g. Pantheon, newmedia, DRUD, drush, etc) to automate the extraction and placement into designated areas.

    The newer intention is for individuals to:

    1. Download/unzip whatever archive they wish to use.
    2. Clone down the repo and perform a ddev config
    3. Place the database and files assets in the appropriate location
    4. Run a ddev import

    Later on we can revisit and pull directly from an archive, but those will be moved to separate issues later down the roadmap.

  7. 29 remaining items

  8. beeradb commented on Mar 30, 2017

    @beeradb
    ContributorAuthor

    Responding to some feedback.

    @rickmanelius, first:

    We don't yet have the names of the configurations [...]

    For what is outlined here, I had not envisioned configurations. This assumes everything is local, and as such, it's probably not something we would want to add (and potentially version) in a .ddev/config.yaml. I do think we'll probably want some config items when we get into platform imports, such as pantheon, as those might have value in sharing among developers/versioning.

    I still believe we need to properly address post-import functionality [...]

    Agreed. We'll need to address it in the long-term. I do think there's room for a discussion about whether that's explicitly handled by us, or exposed via some extensibility mechanism (dcfg like functionality). I would prefer to do an MVP without, and then decide on and add that functionality, if possible.

    And now @tannerjfco

    If an archive is provided, what are we extracting out of it? [...]

    For files, I had assumed the archive root. For SQL, any .sql files in the root of the archive. It's possible we'll need to do more, but as the .sql and folder import options are available, if your archive is in the 'wrong' format, it's a fairly easy workaround.

    The ability to define destination by user [...]

    Almost certainly needed down the road, but we don't currently support that. We'll also need to address it in nginx and other places before we can fully support non-standard public file paths.

  9. beeradb commented on Mar 30, 2017

    @beeradb
    ContributorAuthor

    I've updated the original description in this post to contain done-criteria and testing strategy. Unless there are objections to the current approach or scope, I believe this is now actionable.

  10. rfay commented on Mar 30, 2017

    @rfay
    Member

    The updated OP works for me. My only hesitation is the redundant import command, but maybe it's required for future visions of importing complete drush/pantheon tarballs. In that case I'd suggest waiting until we add those, but I'm ok either way. This looks like something I'd be happy to use. Not sure I'm "normal", but sure looks fine to me.

  11. beeradb commented on Mar 30, 2017

    @beeradb
    ContributorAuthor

    Updated to remove import for now. We'll tackle it when we deal with platforms, as @rfay suggested. This is now actionable.

  12. self-assigned this
    on Mar 30, 2017
  13. beeradb commented on Apr 19, 2017

    @beeradb
    ContributorAuthor

    This can be closed out now that #123 is in! congrats!

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions