drupal-scaffold icon indicating copy to clipboard operation
drupal-scaffold copied to clipboard

Issue #57: Distinguish files depending on dev environment.

Open FlorentTorregrosa opened this issue 8 years ago • 15 comments

FlorentTorregrosa avatar Feb 11 '17 21:02 FlorentTorregrosa

Hello,

Thanks for the review. I have pushed a commit to take your suggestion into account.

FlorentTorregrosa avatar Feb 12 '17 19:02 FlorentTorregrosa

LGTM. 👍

@derhasi @webflo Any feedback?

greg-1-anderson avatar Feb 12 '17 19:02 greg-1-anderson

Looks okay to me. One thing, I am currently not sure about: Maybe we can even put sites/example.settings.local.php and sites/example.sites.php in dev mode, but I don't know if this would break Drupal in any way.

derhasi avatar Feb 14 '17 19:02 derhasi

I am not convinced of this feature, because initially we told people to commit the files from drupal-scaffold to their repository. drupal-scaffold was meant to be run on the initial creation of a project (e.g. composer create-project) and on updates of drupal/core to have always the proper config in place.

I won't block the PR, its just for the discussion.

webflo avatar Feb 14 '17 19:02 webflo

Folks could .gitignore the dev files and run drupal-scaffold to get them in a dev environment, so this still seems useful, even if committing the scaffold files.

greg-1-anderson avatar Feb 14 '17 19:02 greg-1-anderson

Hello,

Thanks for the discussion, here are thoughts and opinion.

@derhasi, I intend to put sites/example.settings.local.php in excludes on my projects, I already have a sites/development.settings.php (better name in my opinion) https://github.com/Drupal-FR/socle-drupalcampfr/tree/8.x-1.x/www/sites.

For sites/example.sites.php, I have no idea. I remember having problem if it was not here, I scanned Drupal core and Drush, there are references to this file but I see nothing that would prevent an installation.

@webflo, even if Drupal scaffold is thought to be used with the files versionned, I personnally ignore them as they are "generated" (obtained from "contrib"), except files I have modified like settings.php.

Before I used a custom script to do what drupal-scaffold do and this weekend I decided to use it as it is one less script to maintain and to stick more with the best practice of the community. https://github.com/Drupal-FR/socle-drupalcampfr/commit/08b6606a2d9f74003904282451e77391299d5d58

FlorentTorregrosa avatar Feb 14 '17 20:02 FlorentTorregrosa

Ok, works for me. Can we add a test for it?

webflo avatar Feb 14 '17 22:02 webflo

Hello,

I have written a test case.

I wanted to extend the PluginTest class to avoid duplicate code but I got the following error in that case PHP Fatal error: Class 'DrupalComposer\DrupalScaffold\Tests\PluginTest' not found in drupal-scaffold/tests/HandlerTest.php on line 13

Also may I suggest to add prefer-stable' => true, for the composerJSONDefaults method to avoid having to clone almost all dependencies and to have quicker tests.

Thanks for the review.

FlorentTorregrosa avatar Feb 26 '17 17:02 FlorentTorregrosa

Hello,

Is the last patch ok for you?

FlorentTorregrosa avatar Apr 15 '17 10:04 FlorentTorregrosa

This looks great. Try having PluginTest and HandlerTest extend the same base class, and push duplicate code down there.

greg-1-anderson avatar Sep 29 '17 12:09 greg-1-anderson

Hello,

Both proposed changes has been addressed.

Is it ok now?

Edit: And thanks @greg-1-anderson for the review at DrupalCon Vienna!

FlorentTorregrosa avatar Oct 07 '17 12:10 FlorentTorregrosa

Hello,

I have rebased my changes to followup the last code changes in drupal-scaffold.

Would it be possible to have a review please?

FlorentTorregrosa avatar Dec 09 '17 11:12 FlorentTorregrosa

Hello,

I have rebased my pull request and made some adjustments following the recent commits.

Would it be possible to merge it please?

FlorentTorregrosa avatar Apr 21 '18 14:04 FlorentTorregrosa

Hello,

Now that #88 is ok and will be merged soon, I have rebased this PR to fix conflicts.

Will it be possible to have it reviewed one more/last time and hopefully merged please? :)

FlorentTorregrosa avatar Jul 05 '18 08:07 FlorentTorregrosa

Hi! There is some limitation with the current implementation, it doesn't allow to scaffold dev files in a different folder (if my drupal folder is in /web using drupal-project for example). I would suggest to create an "initial-dev" as you have done for "includes" with "includes-dev"?

RaphTbm avatar Aug 29 '18 10:08 RaphTbm