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

ReferenceIntegrity extension broken? #2319

Open
mbabker opened this issue Nov 18, 2021 · 2 comments
Open

ReferenceIntegrity extension broken? #2319

mbabker opened this issue Nov 18, 2021 · 2 comments
Labels
ReferenceIntegrity Still Relevant Mark PRs that might've been auto-closed that are still relevant.

Comments

@mbabker
Copy link
Contributor

mbabker commented Nov 18, 2021

ReferenceIntegrityMappingTest is currently disabled because it relies on the removed YAML driver from the MongoDB ODM. OK, I made an attempt at restoring the test using the annotation driver instead (see main...mbabker:restore-odm-test for the diff, pretty simple in and of itself).

Except, this exposes a problem. The annotation and YAML drivers built the mapping configuration inconsistently.

// Annotation driver config structure
$config = [
    'referenceIntegrity' => [
        'referencedDocuments' => 'nullify',
    ],
];

// YAML driver config structure
$config = [
    'referenceIntegrity' => [
        'referencedDocuments' => [
            'referencer' => 'nullify',
        ],
    ],
];

Essentially the Annotation driver doesn't do an array for the reference integrity configuration for each field, whereas the YAML driver did. This test used the YAML driver's configuration structure.

Changing the annotation driver to use the same structure as the YAML driver breaks ReferenceIntegrityDocumentTest because ReferenceIntegrityListener relies on the current config structure of the annotation driver, meaning the extension has never worked with the YAML driver.

I don't know what right's supposed to look like and I don't use the ODM to use this feature (I just happen to have gone through the effort to get MongoDB running locally for another OSS package and can run the MongoDB tests here as a result), but I can work out that with the inconsistent configuration it's impossible for me to tell what the correct configuration is and how to get to a green build.

@franmomu
Copy link
Collaborator

I haven't used this extension either. Since the YAML driver does not exist anymore, I guess I would change ReferenceIntegrityMappingTest to use annotations.

@github-actions
Copy link

github-actions bot commented Jul 7, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Jul 7, 2022
@franmomu franmomu added Still Relevant Mark PRs that might've been auto-closed that are still relevant. and removed Stale labels Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ReferenceIntegrity Still Relevant Mark PRs that might've been auto-closed that are still relevant.
Projects
None yet
Development

No branches or pull requests

3 participants