Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Messenger] Doctrine Transport: Support setting auto_setup from DSN#32392

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:4.3frombendavies:doctrine-auto-setup-from-dsn
Jul 8, 2019
Merged

[Messenger] Doctrine Transport: Support setting auto_setup from DSN#32392

fabpot merged 1 commit intosymfony:4.3frombendavies:doctrine-auto-setup-from-dsn
Jul 8, 2019

Conversation

@bendavies
Copy link
Contributor

@bendaviesbendavies commentedJul 5, 2019
edited
Loading

QA
Branch?4.3
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

It was not possible to setauto_setup via the dsn, as the result would always be a string, resulting in setup always being performed because a bool is required.
The same was true ifauto_setup was provided inoptions as a string.

I've fixed ensuring that the final configuration contains a bool forauto_setup.

Additionally, constructing theconfiguration was overly complex and hard to grok, so I've hopefully simplified it as part of this PR.

As an aside the three transports all do configuration construction in different ways with varying styles. It would be nice to neaten them up.

@bendavies
Copy link
ContributorAuthor

travis failure seems unrelated.

// test options from options array wins over options from dsn
[
'dsn' =>'doctrine://default?table_name=name_from_dsn&redeliver_timeout=1200&queue_name=normal',
'dsn' =>'doctrine://default?table_name=name_from_dsn&redeliver_timeout=1200&queue_name=normal&auto_setup=true',
Copy link
Member

Choose a reason for hiding this comment

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

Why not use1 and0 instead?

Copy link
ContributorAuthor

@bendaviesbendaviesJul 8, 2019
edited
Loading

Choose a reason for hiding this comment

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

no reason other than the docs are written withtrue andfalse everywhere, and it matches the yaml.
I can add another test covering that1 and0 are handled correctly?

Copy link
Member

Choose a reason for hiding this comment

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

IMHO, supportingtrue andfalse is a mistake (I mean, there are strings). When using a query string, 0 and 1 is the "native" way to go.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

sure, i'm not precious either way, but note that boolean strings are also supported in the AMQP transport, i.eamqp://localhost?persistent=true

what do you want to do?

Copy link
ContributorAuthor

@bendaviesbendaviesJul 8, 2019
edited
Loading

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I think consistency is the key here. If we are already supportingtrue/false elsewhere, let's support it here. Adding support for1/0 would be nice as well.

We don't have a generic way of handling DSNs, but as we are now using them in many different components, it probably makes sense to create something? Could it be a new component?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

added covering test for0/1

Copy link
Member

@fabpotfabpot left a comment

Choose a reason for hiding this comment

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

auto_setup=1 seems missing in the tests.

@bendavies
Copy link
ContributorAuthor

Added specifically.

@fabpot
Copy link
Member

@bendavies Would you like to have a look at creating aDSN component? The first step would be to have a look at all implementations (like Messenger, Cache, Mailer, ...) and see if we could have a standalone component that would cover all needs.

sstok, deguif, linaori, kunicmarko20, and vasilvestre reacted with hooray emoji

@fabpot
Copy link
Member

Thank you@bendavies.

@fabpotfabpot merged commit213dfd1 intosymfony:4.3Jul 8, 2019
fabpot added a commit that referenced this pull requestJul 8, 2019
… from DSN (bendavies)This PR was squashed before being merged into the 4.3 branch (closes#32392).Discussion----------[Messenger] Doctrine Transport: Support setting auto_setup from DSN| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | yes| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets |    <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        |  <!-- required for new features -->It was not possible to set `auto_setup` via the dsn, as the result would always be a string, resulting in setup always being performed because a bool is required.The same was true if `auto_setup` was provided in `options` as a string.I've fixed ensuring that the final configuration contains a bool for `auto_setup`.Additionally, constructing the `configuration` was overly complex and hard to grok, so I've hopefully simplified it as part of this PR.As an aside the three transports all do configuration construction in different ways with varying styles. It would be nice to neaten them up.Commits-------213dfd1 [Messenger] Doctrine Transport: Support setting auto_setup from DSN
@bendavies
Copy link
ContributorAuthor

@bendavies Would you like to have a look at creating aDSN component? The first step would be to have a look at all implementations (like Messenger, Cache, Mailer, ...) and see if we could have a standalone component that would cover all needs.

@fabpot it seems there is a good usecase for a new component.
I'm afraid I'm a bit time strapped at the moment however.
Also, It would be quite a small component, and I'd really struggle to create something that wasn't a complete ripoff of enqueues component, as I use it extensively.

@Simperfit
Copy link
Contributor

@bendavies@fabpot I have time to do it if you want to :)

@jderusse
Copy link
Member

@fabpot Should I reopen#24267 ?

@fabpotfabpot mentioned this pull requestJul 28, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@weaverryanweaverryanweaverryan approved these changes

+1 more reviewer

@SimperfitSimperfitSimperfit approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@bendavies@fabpot@Simperfit@jderusse@weaverryan@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp