Problem/Motivation

AutowireTest currently checks for missing aliases, but it doesn't confirm that existing aliases actually match the interface of the service they map to.

A test for this would have prevented #3572050: plugin.manager.icon_extractor has incorrect service alias where we mapped the wrong interface to a service.

Steps to reproduce

Proposed resolution

Add test coverage for existing aliases.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3578486

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: Active » Needs review

Can be tested by reverting the change to block_content.services.yml (technically this is okay, but better to be consistent with no leading backslashes) and #3572050: plugin.manager.icon_extractor has incorrect service alias and running the test.

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

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Did exactly what @longwave suggested and revert the block_content.services change and ran the test locally

The following core service aliases do not match their interfaces:
Drupal\block_content\BlockContentUuidLookup aliases to @block_content.uuid_lookup (class \Drupal\block_content\BlockContentUuidLookup) which is not an instance of Drupal\block_content\BlockContentUuidLookup
Failed asserting that an array is empty.

Surprised we only had 1 instance but yay! Change LGTM.

alexpott’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 4851e09114e to main and d84c44e5b34 to 11.x. 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.

  • alexpott committed d84c44e5 on 11.x
    task: #3578486 Check aliases match interfaces in AutowireTest
    
    By:...

  • alexpott committed 4851e091 on main
    task: #3578486 Check aliases match interfaces in AutowireTest
    
    By:...

  • alexpott committed 34657473 on 11.x
    Revert "task: #3578486 Check aliases match interfaces in AutowireTest"...
alexpott’s picture

Version: 11.x-dev » main

Turns out we can't do this on 11.x because we're missing stuff from Autowire test - leaving in main only.

Status: Fixed » Closed (fixed)

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