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

GH-1443: Fix default option when --all-or-nothing option is used as intended #1444

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

agustingomes
Copy link
Contributor

@agustingomes agustingomes commented Aug 23, 2024

Q A
Type bug
BC Break no
Fixed issues #1443

Summary

After a review of the issue reported (linked above), it seems the default behavior of specifying the option is opposite of what was intended, and also what is currently documented. This PR applies the correct default when the user specifies the --all-or-nothing option in the command line.

Background:

Previous PR's and their linked issues contain more context regarding each iteration so far. They are presented below in the chronological order in which they were merged:

@agustingomes
Copy link
Contributor Author

@greg0ire The CI/CD failures do not seem directly related to my changes as far as I could see. Can you take a look if it's something I need to fix in my PR?

@greg0ire greg0ire changed the base branch from 3.7.x to 3.8.x August 24, 2024 07:43
@greg0ire
Copy link
Member

You were targeting a branch that is no longer maintained. Please rebase.

@greg0ire
Copy link
Member

Still, the errors occur on 3.8.x, I'll try to address them.

@agustingomes
Copy link
Contributor Author

@greg0ire rebasing the branch and the extra commit fixed the CI issues.

@greg0ire
Copy link
Member

Sorry, I forgot to mention I made an attempt to address the SA issues in #1445

@agustingomes agustingomes force-pushed the 3.7.x branch 3 times, most recently from 2fc5665 to 754b035 Compare August 25, 2024 18:45
@@ -243,18 +243,23 @@ Setting ``transactional`` to ``false`` will disable that.
From the Command Line
~~~~~~~~~~~~~~~~~~~~~

You can also set this option from the command line with the ``migrate`` command and the ``--all-or-nothing`` option:
To enable all the migrations to complete together, you can also set this option from the command line with
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure people will understand what is meant by "completing together". I think we might not want to shy away from being technical here, talking about transactions should make clarify things IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed a new phrasing, let me know if it's ok the way is written now.

@greg0ire
Copy link
Member

The SA issues are fixed, you can now rebase and drop your second commit.

@agustingomes
Copy link
Contributor Author

@greg0ire with the release of PHPStan 1.12 today a new error surfaced. How do you want to proceed?

@agustingomes agustingomes marked this pull request as draft August 27, 2024 19:41
@agustingomes agustingomes marked this pull request as ready for review August 27, 2024 19:54
@SenseException
Copy link
Member

SenseException commented Aug 27, 2024

with the release of PHPStan 1.12 today a new error surfaced. How do you want to proceed?

It affects code that you haven't touched. It needs to be fixed, but not by this PR. See #1453.

@greg0ire
Copy link
Member

@agustingomes you may rebase :)

These extra tests may help in the future to catch unintended behavior changes for the default of these 2 specific settings.
As result of some past changes to improve the way the option was inferred, several attempts to build a mechanism to handle the absence of value of this option were built via the following commits:

4da00c5
5335951
5038099
799f16d
f726a5f

This commit leverages all the iterative improvements introduced along the way, and setting the correct value when the option is correctly specified.

This should bring the behavior inline with what is currently documented, while additionally adding a documentation deprecation informing users that passing a value to that option won't be allowed in 4.x

As an extra addition, this commit also introduces the negated option `--no-all-or-nothing`. The intent is to leverage the native Symfony >= 5.3 [Negatable command options](https://symfony.com/blog/new-in-symfony-5-3-negatable-command-options) in the future once the optional value from `--all-or-nothing` is completely removed.
@greg0ire greg0ire added the Bug label Aug 28, 2024
@greg0ire greg0ire added this to the 3.8.1 milestone Aug 28, 2024
@greg0ire greg0ire merged commit 7760fbd into doctrine:3.8.x Aug 28, 2024
12 checks passed
@agustingomes agustingomes deleted the 3.7.x branch August 28, 2024 14:19
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.

4 participants