8000 [DependencyInjection] Fix regression in ordering service locators by priority by longwave · Pull Request #57345 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DependencyInjection] Fix regression in ordering service locators by priority #57345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 28, 2024

Conversation

longwave
Copy link
Contributor
@longwave longwave commented Jun 7, 2024
Q A
Branch? 7.0
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #57344
License MIT

Fixes a regression in Symfony 7.0 where service locators are no longer ordered by priority.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.2 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@longwave longwave force-pushed the service-locator-priority branch from c9c25c2 to 2b098d1 Compare June 7, 2024 09:45
@longwave
Copy link
Contributor Author
longwave commented Jun 7, 2024

I tried to rebase onto 7.0 but there is a conflict - if you want me to rebase anyway or open a separate PR for 7.0 let me know.

@nicolas-grekas
Copy link
Member

I had a quick look at the git history: #42532 removed this ksort, but it's still in 5.4?
I'm missing something then - why introduced in 7.0 if 5.4 has the ksort?
Can you dig this question a bit?

@longwave
Copy link
Contributor Author
longwave commented Jun 28, 2024

The break was introduced in 7.0 in #50578. Refactoring was done which somehow reintroduced the ksort, which broke the tests, and the test cases were altered to the ksorted order instead of finding/fixing the source of the break.

The test coverage was incorrectly changed in cc4ef49#diff-2d095e6b8882e9c562ea8541b1c0c995b8fd438946e73b4bd4a74f9895a47366L215-R215 but the services should be returned in the same order they were added, and not be sorted.

Similar changes to IntegrationTest also show this regression where the services are alphabetically sorted but should not be: cc4ef49#diff-4440c0daf07aa75a97e4cf9f147391d566ebaa04fe772bdf1c896f92f6292f38

…g (seriquynh)

This PR was merged into the 5.4 branch.

Discussion
----------

[Console] Test convert CompletionInput into string

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | N/A
| License       | MIT

CompletionInput can be converted into string but there are no tests for it. So, I a simple test here based on it's current behavior.

Commits
-------

0a7477d Test convert CompletionInput into string
…rekas)

This PR was merged into the 5.4 branch.

Discussion
----------

[Filesystem][Mime] Fix transient tests

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

HttpClient already uses this port so that when running concurrently, we get 404s for the logo.

Commits
-------

c3bf9a6 [Filesystem][Mime] Fix transient tests
* 5.4:
  [Filesystem][Mime] Fix transient tests
  Test convert CompletionInput into string
@nicolas-grekas nicolas-grekas modified the milestones: 7.1, 7.0 Jun 28, 2024
nicolas-grekas and others added 2 commits June 28, 2024 11:58
* 6.4:
  [Filesystem][Mime] Fix transient tests
  Test convert CompletionInput into string
@nicolas-grekas
Copy link
Member

Thank you @longwave.

@nicolas-grekas nicolas-grekas merged commit c9c8239 into symfony:7.0 Jun 28, 2024
8 of 10 checks passed
This was referenced Jun 28, 2024
@longwave longwave deleted the service-locator-priority branch July 17, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0