During development, example.settings.local.php is frequently duplicated and used as is, or with minor modifications. One of the lines that's included by default is enabling local development services. Editing this file to turn on twig debug or disable caching is a common step in the development process.

However, because this file is part of Drupal's composer scaffolding, it is overwritten back to its default value any time core is updated via composer.

We should remove this file from core scaffolding so that local development modifications aren't overwritten by composer actions


Original Title & Issue Summary:

Rename development.services.yml to example.development.services.yaml

During development, example.settings.local.php is frequently duplicated and used as is, or with minor modifications. One of the lines that's included by default is enabling local development services. Editing this file to turn on twig debug or disable caching is a common step in the development process.

However, because this file is part of Drupal core, it is overwritten back to its default value any time core is updated via composer.

I would propose renaming development.services.yml to [example/default].development.services.yml while leaving the rest of the related core files as is. This would encourage developers to create a new file not included in core that is therefore not overwritten during the update process.

Issue fork drupal-3094699

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ablum created an issue. See original summary.

Deepthi kumari’s picture

Assigned: Unassigned » Deepthi kumari
Deepthi kumari’s picture

Assigned: Deepthi kumari » Unassigned
Status: Active » Needs review
StatusFileSize
new199 bytes

Changed the file name from development.services.yml to example.development.services.yml

harishkunta’s picture

Status: Needs review » Reviewed & tested by the community

Hi Deepthi
Good job, I have tested it and its working fine.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 3: development-services-3094699-3.patch, failed testing. View results

andy-blum’s picture

Looks like you'll need to change /core/tests/Drupal/Tests/ComposerIntegrationTest.php on line 124: ['sites/development.services.yml', 'assets/scaffold/files/development.services.yml'], as well.

meenakshig’s picture

Status: Needs work » Needs review
StatusFileSize
new1.17 KB

Changed "['sites/development.services.yml', 'assets/scaffold/files/development.services.yml']" in /core/tests/Drupal/Tests/ComposerIntegrationTest.php on line 124

Status: Needs review » Needs work

The last submitted patch, 7: development-services-3094699-7.patch, failed testing. View results

shubham.prakash’s picture

Status: Needs work » Needs review
StatusFileSize
new2.11 KB

changes done in composer.json

manuel garcia’s picture

Status: Needs review » Needs work
Issue tags: +DX (Developer Experience)

Thanks, current patch looks clean to me, and I think it is a valid proposal (and a good idea).

I had a look at how we're currently using development.services.yml file, should we change these lines on sites/example.settings.local.php, since the file may or may not be there?

/**
 * Enable local development services.
 */
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';

And also at least update the documentation on the example.development.services.yml file itself:

# To activate this feature, follow the instructions at the top of the
# 'example.settings.local.php' file, which sits next to this file.
berdir’s picture

Yes, this is not really an example as it's actually included now by most settings.local.php files and would break those sites as they updates. easy enough to fix, but then again, nothing stops anyone from copying it already now.

Might be enough to just comment in the file and on the include line that it should be copied to customize it?

xjm’s picture

Version: 9.0.x-dev » 9.1.x-dev
Priority: Minor » Normal

As proposed this'd be a BC break. #11 sounds like a better approach indeed.

andy-blum’s picture

StatusFileSize
new699 bytes

Patch attached suggesting developers either add a new file, or remove development.services.yml from the drupal scaffolding files

andy-blum’s picture

Status: Needs work » Needs review
andy-blum’s picture

Status: Needs review » Needs work

The last submitted patch, 13: 3094699-13.patch, failed testing. View results

neslee canil pinto’s picture

Status: Needs work » Needs review
StatusFileSize
new1.32 KB
new1.3 KB

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

damienmckenna’s picture

FWIW I found a related problem in #3272587 - changes made in development.services.yml won't override what's in services.yml, so there might be another problem here.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

rinku jacob 13’s picture

StatusFileSize
new1.31 KB

Re-rolled patch#17 for 9.5.x . Thanks @Neslee Canil Pinto

andy-blum’s picture

@xjm & @berdir:

Would it be a BC-breaking change to simply remove development.services.yml from the drupal scaffolding process? That would bypass this whole issue.

andy-blum’s picture

andy-blum’s picture

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

shubham chandra’s picture

StatusFileSize
new1.32 KB

Added patch #23 in Drupal 10.1.x

bnjmnm’s picture

@Shubham Sharma: Rerolls are not automatically needed if a Drupal dev branch version changes. In many cases, the patch still applies. If you click the "Add test / retest" link on the most recent patch of a given issue, you can test the patch on 10.1.x (or whatever the current dev branch is). If the patch applies there, then no reroll is needed.

You added a reroll that was not needed - I noticed you doing the same in at least 7 other recent issues. Credit is not granted for unnecessary rerolls.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs framework manager review

Won't this be made mute by #3278887: Update development.services.yml to include twig debug by default ?

Should this be closed for that one? Credit to be moved over of course.

Tagging for framework manager thought (May not be the correct tag but there's no sub system maintainer for base system in the MAINTAINERS.txt file)

jwilson3’s picture

whoops, I've commented on wrong issue, see link in previous comment. My apologies.

andy-blum’s picture

@smustgrave - I think this issue would be less impactful, but not fully nullified by those other issues. Developers may still use development.services.yml to set up other dev services, like CORS settings that differ from production environments.

Repeating my question from #24: Would it be a BC-breaking change to simply remove development.services.yml from the drupal scaffolding process? That would bypass this whole issue.

smustgrave’s picture

Think a framework manager would have to answer that but I would be for it. Almost all projects we have to tell composer to not touch that file.

andy-blum’s picture

Title: Rename development.services.yml to example.development.services.yaml » Remove development.services.yml from Drupal's composer scaffolding
Issue summary: View changes

Update title/IS.

@catch per slack: "Removing it from scaffolding we could definitely do in a minor I think."

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

carlos romero made their first commit to this issue’s fork.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.