In order to being able to test and and also present the module and it's features in connection with the l10n_client module it would be a very nice feature to have a drush scenario builder integration.

This integration would be able to automatically setup a server with some example project, release and translations, as well as a client which is connected to this same server.
This would enable quick reviews of new features of the module and testing without prior manual setup of this entire environment.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

miro_dietiker’s picture

Find here our presentation about the dsb project features ad Dev Days in Dublin.
http://dublin2013.drupaldays.org/node/92

This is the project page:
http://drupal.org/project/dsb

Done right, this is an enabler for participation: Complex multi system setups can be done within few minutes, including automated and content pre-population. Thus jumping into coding is easy.

While reviewing l10n_server and testing its functionality, we have written DSB integration.
Patch will follow soon.

s_leu’s picture

Status: Active » Needs review
FileSize
13.16 KB

Ok here's the patch finally

Gábor Hojtsy’s picture

I'm not sure this will be compatible much with different hosting environments (different hostnames, etc), but may be compatible with some. My only concern was that committing this may leave executable PHP/shell files in the project which may cause problems when loaded from the server and/or serve as injection points. Looking through I did not find a specific point where this would be an issue. Do you see any?

miro_dietiker’s picture

Status: Needs review » Needs work

dsb allows with local overrides to change hostnames / domains. (yes, we introduce something like a wildcard domain and all systems [server, client] we setup is below that domain.) You can override pretty anything. DSB is just a helper. And in case a different environment needs different adaptions, we are happy to add its specific requirements. For now no windows port :-)

I suggest moving to .inc for all script files. Thus all injection point concerns no more apply.
The dsb.config.php is similar to settings.php and only contains configuration arrays.

s_leu’s picture

Status: Needs work » Needs review
FileSize
11.53 KB
13.16 KB

adding a patch and interdiff with the suggested changes

miro_dietiker’s picture

Status: Needs review » Needs work

Here we go :-)

  1. +++ b/dsb.config.php
    @@ -0,0 +1,97 @@
    +$config['domain'] = 'l10n.local';
    

    The .local domain leads to some trouble in certain local environments such as Mac. We thus decided to recommend *.dev for all scenarios.

  2. +++ b/dsb.config.php
    @@ -0,0 +1,97 @@
    +    // @todo dsb should support post install scripts per host.
    

    Yes this todo needs to stay.

  3. +++ b/scripts/dsb_client_setup.inc
    @@ -0,0 +1,60 @@
    + * @todo
    ...
    + * @todo replace echo with drush_print.
    ...
    +// @todo Setup / Get the connection key from the server.
    

    The other @todos are no more relevant or should be fixed.

s_leu’s picture

Status: Needs work » Needs review
FileSize
1.09 KB
13.21 KB

Ok i made the suggested changes.

miro_dietiker’s picture

Status: Needs review » Needs work
+++ b/README.txtundefined
@@ -53,11 +53,44 @@ INSTALLATION
+# drush dsb server --workspace=`pwd`

In case the workspace is the pwd, the --workspace is unneeded. Please check the latest dsb version.

+++ b/README.txtundefined
@@ -53,11 +53,44 @@ INSTALLATION
+browser with http://server.l10n.local/.

Still the wrong / old pattern URL.

+++ b/dsb.l10n.makeundefined
@@ -0,0 +1,27 @@
+projects[drupal][version] = 7.22

Is it possible to rely on the latest 7.x core version instead?

s_leu’s picture

Status: Needs work » Needs review
FileSize
910 bytes
13.19 KB

changes as suggested...

miro_dietiker’s picture

Status: Needs review » Needs work

Almost :-)

  1. +++ b/dsb.config.php
    @@ -0,0 +1,97 @@
    +        'wget -O files/simplenews-7.x-1.0.de.po http://ftp.drupal.org/files/translations/7.x/simplenews/simplenews-7.x-1.0.de.po',
    +        // Setup the server configuration.
    +        "drush php-script \$WORKSPACE/scripts/dsb_server_setup.inc",
    

    Once double, once single quotes. No other pattern/reason.

  2. +++ b/dsb.config.php
    @@ -0,0 +1,97 @@
    +      'test objects' => array('"Localization server"'),
    

    The double quotes confuse me. Looks wrong.

  3. +++ b/dsb.l10n.make
    @@ -0,0 +1,27 @@
    +projects[l10n_pconfig][type] = module
    +projects[l10n_pconfig][download][type] = git
    +projects[l10n_pconfig][download][url] = http://git.drupal.org/project/l10n_pconfig.git
    +projects[l10n_pconfig][download][branch] = 7.x-1.x
    

    And i still didn't figure out where you use pconfig. :-)

  4. +++ b/dsb.l10n.make
    @@ -0,0 +1,27 @@
    +projects[simplenews][type] = module
    +projects[simplenews][download][type] = git
    +projects[simplenews][download][url] = http://git.drupal.org/project/simplenews.git
    +projects[simplenews][download][branch] = 7.x-1.x
    

    No reason to depend to simplenews. You download the .po file separately later.

  5. +++ b/local.dsb.config.php
    @@ -0,0 +1,11 @@
    + * Local DSB config overrides.
    
    +++ b/scripts/dsb_client_setup.inc
    @@ -0,0 +1,62 @@
    + * Script executed by drush dsb.
    

    DSB or dsb?

s_leu’s picture

Status: Needs work » Needs review
FileSize
1.4 KB
12.97 KB

"Once double, once single quotes. No other pattern/reason."

The commands that contain a variable need double quotes, in order to escape the variables proper. Double quotes for the other commands aren't necessary, therefore i would leave it like it is now.

"No reason to depend to simplenews. You download the .po file separately later."

There is a good reason. If someone installs the client-server scenario, that person should be able to send some translations suggestions to the server. Since the only project, whose strings get imported on the server , is simplenews, we should have that project installed for the client. Otherwise it's not possible to send suggestions to the server and see them listed there as well.

I fixed the rest according to your comments:

miro_dietiker’s picture

Status: Needs review » Reviewed & tested by the community

Pattern / quotes: fine. Wasn't looking right :-)

Project dependencies: To make it less heavy, we could either use our own project l10n_client or l10n_server and make translation suggestions... or even introduce a hidden dummy module like with testing.

But it works as it is now and it is a good real example. Thus RTBC.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Yay, thanks, committed!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.