Problem/Motivation

Following #3295751: Autowire core services that do not require explicit configuration we can also autowire services.yml files provided by modules.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#21 autowire.patch68.81 KBdcam
#10 3397041-nr-bot.txt90 bytesneeds-review-queue-bot

Issue fork drupal-3397041

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

longwave created an issue. See original summary.

longwave’s picture

Status: Postponed » Needs review

This was easier than I thought. Not sure if #3295751: Autowire core services that do not require explicit configuration should go first or whether we should just commit this all in one go.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Autowiring is so cool. Wise I understood the sorcery fully.

But change didn't break anything so seems good.

Spokje made their first commit to this issue’s fork.

spokje’s picture

Not sure if #3295751: Autowire core services that do not require explicit configuration should go first or whether we should just commit this all in one go.

If we have 2 issues about that, let's at least not have duplicate changes in both of them.

Came for the reroll, stayed for the community, but now removed the changes from core/core.services.yml and its testing, since that already/also lives in #3295751: Autowire core services that do not require explicit configuration.

spokje’s picture

And then stuff broke and testCoreAutowiring shows _way_ less services that could/should be auto-wired, because they are in core.services.yml.

Let's just postpone them on getting #3295751: Autowire core services that do not require explicit configuration so we don't have to reroll both on every change in core.services.yml

longwave’s picture

Status: Reviewed & tested by the community » Postponed

Let's postpone this on the other one, it is smaller in scope and hence easier to get in, then this can be rerolled on top.

spokje’s picture

Status: Postponed » Reviewed & tested by the community

Was just about to do that, thanks @longwave

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new90 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

longwave’s picture

Status: Needs work » Postponed

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.

longwave’s picture

Status: Postponed » Needs work

Given we have run into some difficult problems with #3295751: Autowire core services that do not require explicit configuration it might be easier to get this one in first instead. Let's try rerolling and see where we are.

longwave’s picture

Status: Needs work » Needs review
godotislate’s picture

Have one question on the MR, but otherwise this look close.

dcam’s picture

Status: Needs review » Needs work

This needs a rebase due to module removals. For the record I haven't done my own review of it yet.

longwave’s picture

Status: Needs work » Needs review
godotislate’s picture

Status: Needs review » Reviewed & tested by the community

Comments addressed and lgtm.

dcam’s picture

Status: Reviewed & tested by the community » Needs review

Sorry about this. I started my own review of the former changes hours ago before @godotislate's last reply. But I was making so many notes about new opportunities for autowiring that I eventually decided to start editing it myself. The biggest change is obviously the use of the #[Autowire] attribute for services. I noticed that these changes were originally written before its introduction. It allowed me to autowire a bunch more of them.

I split up the commits by module, aside from the few fixes that came later. So if it's easier for someone to review the changes module-by-module (as opposed to in one big list in the MR changes page), then you have that option.

longwave’s picture

The "that do not require explict configuration" in the title was meant to imply that we would not add any attributes here, but only handle the trivial cases and add attributes for more complex scenarios in followup(s). I thought it would be easier to scope and review the issues this way.

dcam’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new68.81 KB

The "that do not require explict configuration" in the title was meant to imply that we would not add any attributes here

Obviously I didn't understand that. Oh well. It's easily reverted. I saved the work that I did in a patch so it can be applied to the next issue.

I reverted all of my commits back to the last thing from @longwave and was RTBC. So I'm resetting that status.

catch’s picture

Status: Reviewed & tested by the community » Needs work

Needs a rebase.

longwave’s picture

Status: Needs work » Reviewed & tested by the community

Rebased.

  • catch committed 5afd135e on main
    task: #3397041 Autowire core modules that do not require explicit...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to main, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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