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.
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | 3094699-28.patch | 1.32 KB | shubham chandra |
| #23 | 3094699-23.patch | 1.31 KB | rinku jacob 13 |
| #17 | interdiff_13-17.txt | 1.3 KB | neslee canil pinto |
| #17 | 3094699-17.patch | 1.32 KB | neslee canil pinto |
| #13 | 3094699-13.patch | 699 bytes | andy-blum |
Issue fork drupal-3094699
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
Comment #2
Deepthi kumari commentedComment #3
Deepthi kumari commentedChanged the file name from development.services.yml to example.development.services.yml
Comment #4
harishkunta commentedHi Deepthi
Good job, I have tested it and its working fine.
Comment #6
andy-blumLooks 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.Comment #7
meenakshig commentedChanged "['sites/development.services.yml', 'assets/scaffold/files/development.services.yml']" in /core/tests/Drupal/Tests/ComposerIntegrationTest.php on line 124
Comment #9
shubham.prakash commentedchanges done in composer.json
Comment #10
manuel garcia commentedThanks, 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?
And also at least update the documentation on the
example.development.services.ymlfile itself:Comment #11
berdirYes, 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?
Comment #12
xjmAs proposed this'd be a BC break. #11 sounds like a better approach indeed.
Comment #13
andy-blumPatch attached suggesting developers either add a new file, or remove development.services.yml from the drupal scaffolding files
Comment #14
andy-blumComment #15
andy-blumComment #17
neslee canil pintoComment #21
damienmckennaFWIW 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.
Comment #23
rinku jacob 13 commentedRe-rolled patch#17 for 9.5.x . Thanks @Neslee Canil Pinto
Comment #24
andy-blum@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.
Comment #25
andy-blumComment #26
andy-blumComment #28
shubham chandra commentedAdded patch #23 in Drupal 10.1.x
Comment #29
bnjmnm@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.
Comment #30
smustgrave commentedWon'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)
Comment #31
jwilson3whoops, I've commented on wrong issue, see link in previous comment. My apologies.
Comment #32
andy-blum@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.
Comment #33
smustgrave commentedThink 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.
Comment #34
andy-blumUpdate title/IS.
@catch per slack: "Removing it from scaffolding we could definitely do in a minor I think."