-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Continue merge up #10909
Continue merge up #10909
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as off-topic.
This comment was marked as off-topic.
*/ | ||
interface InternalProxy extends Proxy | ||
{ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the solution is to have the proxy classes also implement this interface. That's what I did in my second commit anyway.
@nicolas-grekas @derrabus can you please look into this one? 🙏 |
Sure, ASAP! |
In the first failing test, it looks like Doctrine interacts with the DBAL at some point, performing an SQL query, when it really should not: the test does not create an entity in the database, it merely creates entities in the cache, and I think what's expected is that the entity is fetched from the cache. I think we expect the closure inside orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php Lines 194 to 196 in 62ed63b
The test line that causes the initialization on 3.0.x is this one:
It calls that one:
This is caused by a change in a UnitOfWork code block from from if ($entity instanceof Proxy && ! $entity->__isInitialized()) {
$entity->__setInitialized(true);
} else {
if (
! isset($hints[Query::HINT_REFRESH])
|| (isset($hints[Query::HINT_REFRESH_ENTITY]) && $hints[Query::HINT_REFRESH_ENTITY] !== $entity)
) {
return $entity;
}
} to if ($this->isUninitializedObject($entity)) {
$entity->__setInitialized(true);
} else {
if (
! isset($hints[Query::HINT_REFRESH])
|| (isset($hints[Query::HINT_REFRESH_ENTITY]) && $hints[Query::HINT_REFRESH_ENTITY] !== $entity)
) {
return $entity;
}
} On 3.0.x, the |
Unsurprisingly, the issue is caused by my unresolved comment: the proxy does not implement |
@derrabus @nicolas-grekas I pushed a commit with a very ugly fix, please have a look at it and let me know whether you think I should introduce an interface ( |
@greg0ire shouldn't proxy from Common not be used anymore in the 3.0.x branch ? |
@stof I think so, but I try to keep merges up diffs as small as possible. The cleanup should IMO happen in a separate PR. |
@greg0ire the conflict comes from the fact that the old proxy logic is already removed from the 3.0.x (based on the version of the codebase before the refactoring you are trying to merge up). So you cannot delay the cleanup here. You need to solve the conflicts between the past cleanup and the refactoring. |
@stof really? I don't think I truly understand what you mean by "old proxy logic" because the proxy logic relying on orm/.github/workflows/continuous-integration.yml Lines 42 to 43 in 9a1085d
orm/tests/Doctrine/Tests/TestUtil.php Lines 94 to 112 in 9a1085d
Line 27 in 9a1085d
Can you please clarify what you are referring to? |
As pointed out by @stof , this is all going to disappear soon, so let's not bother with a short-lived interface. This addresses my only concern about this, so let's mark this as ready for review. Regarding the docs job, it should get fixed in a subsequent merge up. |
@derrabus @SenseException can I get an approval on this? I'd like to continue and possibly finish the merge up before the hackathon. |
By all means, please continue. |
I want to check if the imerge steps also pass the build when running on Github with more jobs.