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

Expose transaction setting #814

Merged
merged 5 commits into from
Jan 19, 2024

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Dec 14, 2023

This complements doctrine/mongodb-odm#2586 by exposing the use_transactional_flush setting to the bundle configuration.

@alcaeus alcaeus self-assigned this Dec 14, 2023
@GromNaN GromNaN added this to the 4.7.0 milestone Dec 14, 2023
Copy link
Member

@malarzm malarzm left a comment

Choose a reason for hiding this comment

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

Configuration reference from docs should be updated in same PR :)

@alcaeus alcaeus removed this from the 4.7.0 milestone Dec 21, 2023
@alcaeus alcaeus changed the base branch from 4.7.x to 5.0.x January 9, 2024 12:04
@alcaeus alcaeus requested a review from malarzm January 9, 2024 12:04
@alcaeus alcaeus marked this pull request as ready for review January 9, 2024 12:04
@alcaeus
Copy link
Member Author

alcaeus commented Jan 9, 2024

Updated to target 5.0.x, which we may bump to 5.1.x. I've also added logic to support older ODM versions that don't support transactional flushes. We can decide whether to bump the ODM requirement at a later date.

Copy link
Member

@malarzm malarzm left a comment

Choose a reason for hiding this comment

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

which we may bump to 5.1.x

Please do, it's new config switch after all.

@alcaeus
Copy link
Member Author

alcaeus commented Jan 11, 2024

Please do, it's new config switch after all.

Will do once we have a 5.1.x branch - release automation doesn't handle pre-releases very gracefully, so once 5.0.0 is tagged everything should be in order.

@malarzm
Copy link
Member

malarzm commented Jan 11, 2024

Ah 5.0.0 is still in RC phase 🙈

@alcaeus alcaeus changed the base branch from 5.0.x to 5.1.x January 15, 2024 12:37
@alcaeus alcaeus added this to the 5.1.0 milestone Jan 15, 2024
@alcaeus alcaeus requested a review from GromNaN January 15, 2024 12:37
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

A suggested improvement, but SGTM as this.


public function testTransactionalFlushConfigurationWhenNotSupported(): void
{
if (method_exists(ODMConfiguration::class, 'setUseTransactionalFlush')) {
Copy link
Member

Choose a reason for hiding this comment

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

This is a weak test. If the method is renamed, the test is skipped while it should fail.

I think it would be more robust to use Composer\InstalledVersions:

Composer\InstalledVersions::satisfies(new VersionParser, 'doctrine/mongodb-odm', '>=2.7@dev')

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated. I wasn't even aware this existed. This is simply lovely :)

Copy link
Member

Choose a reason for hiding this comment

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

I see 3 skipped tests, is the version contraint correct?

@alcaeus alcaeus merged commit ee1e238 into doctrine:5.1.x Jan 19, 2024
12 checks passed
@alcaeus alcaeus deleted the expose-transaction-setting branch January 19, 2024 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants