Skip to content

[FrameworkBundle][Validator] Fix apc cache service & config #16795

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
Jan 25, 2016
Merged

[FrameworkBundle][Validator] Fix apc cache service & config #16795

merged 1 commit into from
Jan 25, 2016

Conversation

ogizanagi
Copy link
Contributor

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

Keep track of #16794 (comment)

NOTE: This PR is on standby. If #16822 is merged, this one might probably be closed, as everything will be done during the merge.

->scalarNode('cache')
->beforeNormalization()
// Can be removed in 3.0, once ApcCache support is dropped
->ifString()->then(function ($v) { return 'apc' === $v ? 'validator.mapping.cache.apc' : $v; })
Copy link
Member

Choose a reason for hiding this comment

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

The previous deprecated notice says, the class ApcCache will be removed, not that the alias "APC" will be discontinued.
This is a new BC break

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Three options then:

  1. trigger a deprecation in 2.8, now released ? (as a "bugfix": a missing deprecation notice)
  2. keep the ability to pass "apc", but trigger a new deprecation in 3.0. Then, remove this ability in 3.1
  3. keep the ability to pass "apc"

Copy link
Member

Choose a reason for hiding this comment

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

Given Symfony 3 had been released, the options 1 is not valid
Given it's a BC break, the option 2 is not valid. => Have to wait Symfony 4
IMO option 3 is the only one available

ping @nicolas-grekas

Copy link
Contributor

Choose a reason for hiding this comment

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

@jderusse I don't agree. There is no BC break in 3.0 if we remove the apc logic. Configuring apc in 3.0 does not work anyway. ApcCache does not exist anymore.

So we should go with option 1 as planned: Add missing deprecation in 2.8 and remove validator.mapping.cache.apc service in 3.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Tobion : Thanks. See #16822 about this.

Copy link
Member

Choose a reason for hiding this comment

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

Removing the feature because it's not documented, mays be a point.
BUT, If someone use the configuration cache: apc with symfony 2.7, he never been warned about the deprecation. Upgrading to Symfony 3 lead to an error due to the missing class.
He may expect we fix the bug, instead of removing the feature.

Just my 2 cents and playing the devil's advocate. I understand the point, to cleanup this code 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In order to upgrade from symfony 2.7 to 3.0, he'll need to update to 2.8 first. Then adding the deprecation in 2.8 in a bugfix is the right thing to do, and no one should expect having this service anymore in 3.0.

I removed the BC flag from the PR description accordingly. The existence of the validator.mapping.cache.apc service and the removal of the validator.mapping.cache.doctrine.apc one in 3.0 (as well as its deprecation in 2.8 instead of first one) is a bug and should be fixed in both branches.

@Tobion
Copy link
Contributor

Tobion commented Dec 3, 2015

Status: Needs Work

@jderusse
Copy link
Member

jderusse commented Dec 3, 2015

Notice that service validator.mapping.cache.doctrine.apchad been previously declared and merged (https://github.com/symfony/symfony/pull/14429/files) and documented (http://symfony.com/doc/current/reference/configuration/framework.html#reference-validation-cache) but then removed by @nicolas-grekas 5aa4a3b

@ogizanagi
Copy link
Contributor Author

Yes, we can also notice that the validator.mapping.cache.doctrine.apc was a feature of 2.8. It would have been really strange to make this feature and deprecate it directly.
So everything seems to confirm this line was unintentional and logically targeting the validator.mapping.cache.apc service instead.

@dunglas
Copy link
Member

dunglas commented Dec 7, 2015

👍 but the serializer.mapping.cache.apc service should have be deprecated has well and new serializer.mapping.cache.doctrine.apc created.

As the serializer and the validator only support Doctrine Cache, I don't see what the doctrine in the service name brings.

@jakzal
Copy link
Contributor

jakzal commented Dec 8, 2015

Something went wrong here. The validator.mapping.cache.doctrine.apc service exists in 2.8. Looks like it was deprecated in 2.8 instead of validator.mapping.cache.apc, and then removed in master.

@ogizanagi
Copy link
Contributor Author

@jakzal : Yes, it's exactly what happened. But let's forget about this PR for now.
Instead, a decision should be taken first on #16822 where we should either:

What bothers me however is to deprecate a service in the same version it appeared. Maybe we should only fix the deprecation on the right service in 2.8, and then deprecate validator.mapping.cache.doctrine.apc as well as serializer.mapping.cache.doctrine.apc in 3.1, for a complete removal in 4.0...

@dunglas
Copy link
Member

dunglas commented Dec 10, 2015

👍 to merge this one.

@dunglas
Copy link
Member

dunglas commented Dec 15, 2015

Any update regarding this PR? This is a blocker to use Symfony 3 in prod.

/cc @symfony/deciders

@xabbuh
Copy link
Member

xabbuh commented Dec 15, 2015

I would be in favour of merging this one and trigger a deprecation in 2.8.

@ogizanagi
Copy link
Contributor Author

I suggest removing the second commit in #16822 (I'll do it right now) and merge it first. The deprecation should be fixed in 2.8 anyway. Then merge this one if necessary, but everything should be properly updated during the merge of 2.8 into 3.0.

@jonathanbull
Copy link

Any update regarding this PR? It looks like a fresh Symfony project still features an invalid validator.mapping.cache.apc setting.

@wouterj
Copy link
Member

wouterj commented Dec 27, 2015

Isn't it better to just quickly fix this error by merging this or mine PRs and then later decide on whether more actions should be taken? Currently, Symfony 3 with validator mapping cache just doesn't work as it should: bad dev experience...

@peterrehm
Copy link
Contributor

Any update on this?

fabpot added a commit that referenced this pull request Jan 21, 2016
…tion (ogizanagi)

This PR was merged into the 2.8 branch.

Discussion
----------

[FrameworkBundle][Validator] Fix apc cache service deprecation

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

Related to #16795

I guess the deprecation was on the wrong service.
Also, no deprecation notice was triggered about using `"apc"` as the value of the `framework.validation.cache` configuration option. This PR adds the missing deprecation.

> 📝 _NOTE_: The standard edition will need to be updated [here](https://github.com/symfony/symfony-standard/blob/2.8/app/config/config_prod.yml#L6).

Commits
-------

907bbec [FrameworkBundle][Validator] Fix apc cache service deprecation
@ogizanagi
Copy link
Contributor Author

@fabpot : Since #16822 is now merged, this one can be merged too in order to remove the last leftover of the framework.validation.cache.apc service :)

@fabpot
Copy link
Member

fabpot commented Jan 25, 2016

Thank you @ogizanagi.

@fabpot fabpot merged commit 94a1728 into symfony:3.0 Jan 25, 2016
fabpot added a commit that referenced this pull request Jan 25, 2016
…g (ogizanagi)

This PR was merged into the 3.0 branch.

Discussion
----------

[FrameworkBundle][Validator] Fix apc cache service & config

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

_Keep track of #16794 (comment)

_NOTE_: This PR is on standby. If #16822 is merged, this one might probably be closed, as everything will be done during the merge.

Commits
-------

94a1728 [FrameworkBundle][Validator] Fix apc cache service & config
@ogizanagi ogizanagi deleted the 16793_validator_apc_cache_service branch January 25, 2016 18:35
@fabpot fabpot mentioned this pull request Feb 3, 2016
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.