Skip to content

[FrameworkBundle] deprecated cache:clear with warmup #21038

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

Merged
merged 1 commit into from
Mar 22, 2017

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Dec 23, 2016

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

The warmup part of cache:clear does not work well, and does not deliver the guarantee that the generated cache is exactly the same as the one that would have been generated via cache:warmup.

As one of the goal of Symfony 4 is to be able to generate all the cache for read-only filsystem, I propose to deprecate the warmup part of cache:clear in 3.3 to be able to remove it completely in 4.0. In 4.0, the --no-warmup option would be a noop (and can then be removed in 5.0).

UPGRADE-3.3.md Outdated
FrameworkBundle
---------------

* The cache:clear command should always be called the --no-warmup option.
Copy link
Member

Choose a reason for hiding this comment

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

missing "without"

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I meant "with".

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

}
$filesystem->remove($warmupDir);
}
@trigger_error('Calling cache:clear without the --no-warmup option is deprecated version 3.3. Cache warmup should be done with the cache:warmup command instead.', E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

missing "since"

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@fabpot fabpot force-pushed the cache-clear-warmup-deprecation branch from dffd2fc to d0b43d8 Compare December 23, 2016 21:16
@ro0NL
Copy link
Contributor

ro0NL commented Dec 24, 2016

@fabpot is the deprecation notice really needed though? I mean it can be a info/warning log message on behavior change as well right? And perhaps dont log anything in non-quiet mode, but display it to the user instead. Meaning we could deprecate --no-warmup right away..

Point is; half the internet does bin/console c:c by now, and im not sure getting a deprecation by default, makes really sense 🤔 (opposed to informing about cache:warmup / changing behavior).

@stof
Copy link
Member

stof commented Dec 24, 2016

This looks like a good idea to me

@fabpot
Copy link
Member Author

fabpot commented Dec 24, 2016

@stof you think @ro0NL is a good idea? or just the fact that we deprecate the warmup process in cache:clear?

@stof
Copy link
Member

stof commented Dec 24, 2016

I was talking about the deprecation of the warmup part. But @ro0NL is right about deprecations by default though

@ro0NL
Copy link
Contributor

ro0NL commented Dec 24, 2016

I know for sure i wouldnt care about the deprecation; it would work rather confusing instead, ie;

I must/should run cache:warmup now to upgrade properly?

While we're actually trying to separate things, and let users decide. Hence, it should be informational imo.

Meaning we could deprecate --no-warmup right away..

Not sure though, as removing it is not the right upgrade path till 4.0.. tough one :)

edit: yep.. we should definitely deprecate --no-warmup after the default behavior has changed.

@ro0NL
Copy link
Contributor

ro0NL commented Dec 24, 2016

Now im not even sure we should log/display anything opposed to adding a changelog note?

Doing it in code kinda implies "people dont read changelogs" ;-)

We could just drop it, right?

@nicolas-grekas nicolas-grekas added this to the 3.3 milestone Dec 26, 2016
@fabpot fabpot force-pushed the cache-clear-warmup-deprecation branch 2 times, most recently from d565d18 to d8b0c2c Compare February 16, 2017 23:59
@fabpot fabpot force-pushed the cache-clear-warmup-deprecation branch from d8b0c2c to e9533f0 Compare March 21, 2017 21:59
@fabpot
Copy link
Member Author

fabpot commented Mar 21, 2017

Just dropping the flag won't work as it would break people using it currently. I don't see any other better way.

@fabpot fabpot force-pushed the cache-clear-warmup-deprecation branch from e9533f0 to 7ed3237 Compare March 21, 2017 22:16
@fabpot
Copy link
Member Author

fabpot commented Mar 22, 2017

I'm going to merge it as is. We will have 2 months to tweak the message if needed.

@fabpot fabpot merged commit 7ed3237 into symfony:master Mar 22, 2017
fabpot added a commit that referenced this pull request Mar 22, 2017
…fabpot)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] deprecated cache:clear with warmup

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

The warmup part of `cache:clear` does not work well, and does not deliver the guarantee that the generated cache is exactly the same as the one that would have been generated via `cache:warmup`.

As one of the goal of Symfony 4 is to be able to generate all the cache for read-only filsystem, I propose to deprecate the warmup part of `cache:clear` in 3.3 to be able to remove it completely in 4.0. In 4.0, the `--no-warmup` option would be a noop (and can then be removed in 5.0).

Commits
-------

7ed3237 [FrameworkBundle] deprecated cache:clear with warmup
@fabpot fabpot deleted the cache-clear-warmup-deprecation branch April 7, 2017 17:17
@fabpot fabpot mentioned this pull request May 1, 2017
nicolas-grekas added a commit to nicolas-grekas/symfony that referenced this pull request Aug 8, 2017
…r with warmup (fabpot)"

This reverts commit 3495b35, reversing
changes made to 7f7b897.
nicolas-grekas added a commit to nicolas-grekas/symfony that referenced this pull request Aug 8, 2017
…r with warmup (fabpot)"

This reverts commit 3495b35, reversing
changes made to 7f7b897.
fabpot added a commit that referenced this pull request Aug 18, 2017
…clear with warmup (fabpot)" (nicolas-grekas)

This PR was merged into the 3.3 branch.

Discussion
----------

Revert "feature #21038 [FrameworkBundle] deprecated cache:clear with warmup (fabpot)"

This reverts commit 3495b35, reversing
changes made to 7f7b897.

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21038
| License       | MIT
| Doc PR        | -

Sibling to #23792: there is no need to trigger the deprecation in 3.3 if we un-deprecate in 3.4.

Commits
-------

9009970 Revert "feature #21038 [FrameworkBundle] deprecated cache:clear with warmup (fabpot)"
nicolas-grekas added a commit that referenced this pull request Aug 18, 2017
* 3.3:
  Revert "feature #21038 [FrameworkBundle] deprecated cache:clear with warmup (fabpot)"
nicolas-grekas added a commit that referenced this pull request Aug 18, 2017
* 3.4:
  [HttpKernel][FrameworkBundle] Add RebootableInterface, fix and un-deprecate cache:clear with warmup
  [DI] Fix merging of env vars in configs
  Allow to get alternatives when ServiceNotFoundException occurs.
  [DI] Rererence parameter arrays when possible
  Revert "feature #21038 [FrameworkBundle] deprecated cache:clear with warmup (fabpot)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants