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

DB gateway #81

Merged
merged 5 commits into from
Oct 26, 2018
Merged

DB gateway #81

merged 5 commits into from
Oct 26, 2018

Conversation

vidarl
Copy link
Member

@vidarl vidarl commented Oct 9, 2018

@vidarl vidarl changed the title DB gateway [WIP] DB gateway Oct 9, 2018
@vidarl vidarl changed the title [WIP] DB gateway DB gateway Oct 11, 2018
@vidarl vidarl requested review from andrerom and alongosz October 11, 2018 10:00
@vidarl
Copy link
Member Author

vidarl commented Oct 11, 2018

Move 0475d7e to separat PR?

Copy link
Member

@alongosz alongosz left a comment

Choose a reason for hiding this comment

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

Nice. I started on this as soon as I've created ticket, but didn't finish as other stuff came in the way.

What I would change:

bundle/Command/Gateway.php Outdated Show resolved Hide resolved
tests/bundle/Command/BaseTest.php Outdated Show resolved Hide resolved
tests/lib/SetupFactory/LegacyEmptyDBSetupFactory.php Outdated Show resolved Hide resolved
tests/bundle/Command/GatewayTest.php Outdated Show resolved Hide resolved
tests/bundle/Command/GatewayTest.php Outdated Show resolved Hide resolved
tests/bundle/Command/GatewayTest.php Outdated Show resolved Hide resolved
tests/bundle/Command/GatewayTest.php Outdated Show resolved Hide resolved
bundle/Command/Gateway.php Outdated Show resolved Hide resolved
tests/bundle/Command/BaseTest.php Outdated Show resolved Hide resolved
@vidarl
Copy link
Member Author

vidarl commented Oct 18, 2018

@alongosz : All review comments should be fixed now

bin/.travis/prepare_unittest.sh Outdated Show resolved Hide resolved
/**
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace EzSystems\EzPlatformXmlTextFieldTypeBundle\Command;
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally this should be in "lib" and not bundle
So code in lib is meant to be tested, does not rely on symfony framework (but components are fine), while code in bundle are thin commands and controllers for symfony that typically don't5 have automated tests.

Copy link
Member

Choose a reason for hiding this comment

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

Ideally this should be in "lib" and not bundle

Hmm, I didn't mind it "inside" Command namespace because of scope, but I'm also fine with changing that. However in that case we need better name than just Gateway.
Maybe ContentModelGateway? (because it covers both Content and ContentType aspects).

while code in bundle are thin commands and controllers for symfony that typically don't have automated tests.

btw. true, but that's bad, we've seen this approach failed us ;) // out of scope comment

Copy link
Member Author

Choose a reason for hiding this comment

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

@andrerom : so move it to lib/FieldType/XmlText/ContentModelGateway.php ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@alongosz wdyt?

Copy link
Member

Choose a reason for hiding this comment

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

so move it to lib/FieldType/XmlText/ContentModelGateway.php ?

Hmm, rather not directly in lib/FieldType/XmlText/.
I've just looked at existing files structure in this bundle... :)

Based on the convention we have in the Kernel, either:

  • lib/FieldType/XmlText/Persistence/Legacy/ContentModelGateway.php
    or
  • lib/FieldType/XmlText/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php
    but I think it's overkill here, so I'd suggest the former one.

@andrerom ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I moved it to lib/FieldType/XmlText/Persistence/Legacy/ContentModelGateway.php

Copy link
Member Author

@vidarl vidarl Oct 19, 2018

Choose a reason for hiding this comment

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

Forgot to move tests accordingly.
Fixed : /tests/lib/FieldType/Persistence/Legacy/ContentModelGatewayTest.php

Copy link
Contributor

@andrerom andrerom left a comment

Choose a reason for hiding this comment

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

+1

I think we can combine some of the Travis build jobs here to rather spread the testing across combinations of php, tests, and args instead to reduce number of jobs.

But I'll leave that to @vidarl to decide on.

@vidarl
Copy link
Member Author

vidarl commented Oct 23, 2018

@alongosz : review ping

@vidarl vidarl changed the base branch from master to 1.7 October 26, 2018 09:16
@vidarl vidarl merged commit b1c9485 into 1.7 Oct 26, 2018
@vidarl vidarl deleted the db-gateway branch October 26, 2018 09:19
@alongosz
Copy link
Member

Better late than never: looks good now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants