Skip to content
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

[2.0] Merge ClassMetadataInfo into ClassMetadata #1733

Merged
merged 18 commits into from
Feb 4, 2018
Merged

[2.0] Merge ClassMetadataInfo into ClassMetadata #1733

merged 18 commits into from
Feb 4, 2018

Conversation

carusogabriel
Copy link
Contributor

This closes #1727 by merge ClassMetadataInfo into ClassMetadata as suggested by @alcaeus in #1714

@carusogabriel carusogabriel changed the title Class metedata [2.0] Merge ClassMetadataInfo into ClassMetadata Jan 12, 2018
@@ -5,7 +5,7 @@
use Doctrine\ODM\MongoDB\DocumentRepository;
use Doctrine\ODM\MongoDB\Events;
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
use Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo;
use Doctrine\ODM\MongoDB\Mapping\ClassMetadata;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file and test class should be renamed (or merged with ClassMetadataTest).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is the conflict, I was tring to find. I’ll merge them as we only have ClassMetadata now ☺️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's still something going wrong, but is with tests, not the merge 😢

@malarzm malarzm added this to the 2.0.0 milestone Jan 12, 2018
@alcaeus
Copy link
Member

alcaeus commented Jan 15, 2018

I only checked one test (ClassMetadataTest::testOwningSideAndInverseSide), but the issue is that the original test called ClassMetadataInfo::mapManyReference which doesn't work with the reflection fields and thus didn't fail when a property didn't exist. With the logic combined in one class, the code now errors because we're trying to map a non-existing property. I assume this is the reason for all the failures.

Solution: either create the properties that are causing failing tests or change the failing tests to map existing properties.

@carusogabriel
Copy link
Contributor Author

@alcaeus These are the failing tests in ClassMetadataTest:

  • testOwningSideAndInverseSide;
  • testDefaultDiscriminatorField;
  • testDefaultStorageStrategyOfEmbeddedDocumentFields;
  • testNoIncrementFieldsAllowedInShardKey;
  • testNoCollectionsInShardKey;
  • testNoEmbedManyInShardKey;
  • testNoReferenceManyInShardKey;

May I ask you to fix them? I barely understand mongodb-odm to fix them 😞

@alcaeus
Copy link
Member

alcaeus commented Jan 15, 2018

Sure, I'll take a look at them tonight. I'll push changes to your branch 👍

@alcaeus
Copy link
Member

alcaeus commented Jan 15, 2018

@carusogabriel looks like I can't push changes for some reason, so I created https://github.com/carusogabriel/mongodb-odm/pull/1.

@carusogabriel
Copy link
Contributor Author

Strange, but okay, merged 😄

Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @carusogabriel!

@alcaeus alcaeus requested a review from malarzm January 15, 2018 19:24
@@ -32,7 +31,7 @@ class AnnotationDriver extends AbstractAnnotationDriver
*/
public function loadMetadataForClass($className, ClassMetadata $class)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use FQCN for Common's ClassMetadata and get rid of aliasing our own one?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd alias the common one. 😇

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for being a layman, but what means FQCN? The full namespaces class?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fully-Qualified Class Name.

@@ -32,7 +31,7 @@ public function __construct($locator, $fileExtension = self::DEFAULT_FILE_EXTENS
*/
public function loadMetadataForClass($className, ClassMetadata $class)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to rename here as this driver is removed in #1734 anyway

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I'll wait and rebase!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need, I first need to tackle documentation. Please change the other places and let's get this merged, I'll rebase my PR later :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, you'll need to rebase after all as I've just finished with docs and merged YAML removal ;)

@@ -2,7 +2,7 @@

namespace Doctrine\ODM\MongoDB\Tools\Console\Command;

use Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo;
use Doctrine\ODM\MongoDB\Mapping\ClassMetadata;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm seeing correctly this is unused, should be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll see that, thanks!

@@ -30,7 +29,7 @@ public function __construct($locator, $fileExtension = self::DEFAULT_FILE_EXTENS
*/
public function loadMetadataForClass($className, ClassMetadata $class)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd appreciate getting rid of alias here as well

@carusogabriel
Copy link
Contributor Author

The only thing that should be done is the rebase?

@malarzm
Copy link
Member

malarzm commented Jan 18, 2018

Rebase to solve conflicts and then if you could apply my remarks it'd be great 👍

@carusogabriel
Copy link
Contributor Author

@malarzm 96f2d7b: you were correct 👍

6ff884b: is that you were talking about? I didn't fully understand that 😅

@malarzm
Copy link
Member

malarzm commented Feb 4, 2018

Thanks @carusogabriel, sorry for long merging I must have overlooked notification about last change you did :)

@malarzm malarzm merged commit fc4c802 into doctrine:master Feb 4, 2018
@carusogabriel
Copy link
Contributor Author

@malarzm NP, now, let's finish #1714 🚧

@carusogabriel carusogabriel deleted the class-metedata branch February 4, 2018 14:45
alcaeus added a commit to alcaeus/mongodb-odm that referenced this pull request Jan 9, 2019
@alcaeus alcaeus mentioned this pull request Jan 9, 2019
alcaeus added a commit to alcaeus/mongodb-odm that referenced this pull request Jan 10, 2019
alcaeus added a commit to alcaeus/mongodb-odm that referenced this pull request Jan 10, 2019
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.

[2.0] Merge ClassMetadata and ClassMetadataInfo
5 participants