Closed (fixed)
Project:
Drupal core
Version:
9.1.x-dev
Component:
configuration system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
4 Sep 2018 at 07:27 UTC
Updated:
4 Oct 2026 at 13:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
claudiu.cristeaHere's the patch.
Comment #3
claudiu.cristeaComment #4
claudiu.cristeaComment #5
tstoecklerFor what it's worth I think this patch is great. Great idea to put this in the schema checker! Could use some more eyes before RTBC, though.
Comment #6
claudiu.cristeaComment #7
longwaveIsn't this just @expectedDeprecation? I see two other uses of @expectedDeprecationMessage in core but don't see where this is actually handled.
Comment #8
claudiu.cristea@longwave, good point, switched to
@expectedDeprecation(I think@expectedDeprecationMessagedoes nothing).Comment #9
panchoRecategorized as Task, as we clearly need a mechanism to deprecate config schemata.
Re
@expectedDeprecationMessage:#2928645: \Drupal\Tests\migrate\Kernel\Plugin\MigrationDirectoryTest uses @expectedDeprecationMessage has a bit more on this. However, if
@expectedDeprecationMessagereally does nothing, then #2 should fail with the CI, shouldn't it?Comment #10
claudiu.cristea@Pancho, could you review this and RTBC or ask for changes?
Comment #11
claudiu.cristeaComment #14
penyaskitoIs this still feasible before 9.0.0?
I think we need this, and the proposal looks great.
During the 8.x lifecycle, has this even happened in core?
If it did, we would need a way to identify those and create child issues for deprecating them.
Comment #15
penyaskitoTagging as Needs product manager review, as I guess it does.
Comment #16
catchThis doesn't need product manager review, it's just an API addition.
Would need to go into 9.1.x at this point. I kicked off a test against 9.1.x
Would be good to know if we have a use-case per #14.
Comment #17
catchComment #18
alexpottMarking the whole test as legacy is wrong. We should not put config_schema_test.deprecated in install config. We should only create it in a specific legacy test.
The implementation looks fine. ONe thing I'm trying to work out is why you'd deprecate schema and not the config value itself... And once you've deprecated a specific config value what's the point of deprecating its schema? OTOH this might provide a nice way to deprecate config values and only have to add something to schema...
Comment #19
alexpottComment #20
claudiu.cristea@alexpott, in #2829919: Either avoid or explicitly test binary encoding in default configuration there's a use case that needs deprecating the schema. The configs are kept but with a new schema. So the old schema became stale
Comment #21
alexpott@claudiu.cristea how does that actually work though? If the config is the same with the same keys then we can't have a deprecated schema pointing to a non-deprecated config value.
Comment #22
alexpottAh I see that issue suggests we need to deprecate a type tat might be used in many places...looking at that issue I'm not convinced it's the way to go. But I guess the use-case makes some sense.
Comment #23
claudiu.cristeaFixing #18.
Comment #25
alexpottIt's best to not make the a module provide deprecated config.
Instead of installing config here we can write the configuration.
How about testing the expected config value. It's better than an assertTrue(TRUE).
Comment #26
claudiu.cristeaThank you. Fixing #25.
Comment #27
penyaskito#25 was taken care of.
We would need to add a change record and update https://www.drupal.org/node/1905070 docs, the later may be done after commit.
Needs something to be added to
\Drupal\Core\TypedData\PrimitiveInterfaceor anywhere else? Or we just rely on d.org documentation?Is there any kind of validation or could I add whatever key here? I'm already adding this 'deprecated' one even if it's not parsed, for example.
Comment #28
penyaskitoAnswering my own question, schema doesn't have a meta-schema, so there's no need to add anything else.
Comment #29
alexpott@penyaskito config schema is definitely meta enough :)
It would be good to update some documentation somewhere - the docs in core.api.php feel too much of an overview. The suggested docs for the policy page are good. We definitely need a CR here (needs work for that). Also a small snippet for the release notes (see issue summary).
Comment #30
claudiu.cristeaAdded CR: https://www.drupal.org/node/3129881.
Added release notes snippet.
I will update the policy at https://www.drupal.org/core/deprecation as soon as is committed and will update also https://www.drupal.org/node/1905070 with a link to https://www.drupal.org/core/deprecation.
Comment #31
claudiu.cristeaFixing also the example to be inserted in the deprecation policy documentation.
Comment #32
xjmThanks! This is a great idea.
This needs a CR too I think, as well as documentation somewhere in the codebase, like in an
api.phpgroup or such.Comment #33
claudiu.cristea@xjm, but the CR has been already added in #30.
Regarding...
Could you please elaborate? I have no idea where this could be documented more. As we'll document this in the Drupal core deprecation policy page and we have a CR, I think this should cover. I see no similar deprecation policy documented in an *.api.php group, but I might be wrong.
Comment #34
catchI think this is a bit different to other deprecations because it's adding a new key to a YAML format. It looks to me like we could add this to https://www.drupal.org/docs/drupal-apis/configuration-api/configuration-...
Comment #35
claudiu.cristea@catch, I've already mentioned that page to be updated, in #30. Now I've detailed that in IS. But I cannot update the docs pages until this is not approved/merged.
Comment #36
claudiu.cristeaBack to RTBC as per #35.
Comment #38
catch@claudiu.cristea sorry good point, that's a docs page and not api.drupal.org...
It might be worth a follow-up issue to move that documentation to an api.php somewhere, but yes we can't do that here.
Committed 0fb041f and pushed to 9.1.x. Thanks!
Comment #39
catchComment #40
andypostFiled follow-up for config inspector #3168268: Display deprecated schema usage
Comment #41
claudiu.cristeaFixed documentation according to IS:
Comment #42
wim leersPublished https://www.drupal.org/node/3129881.
Well done everyone!
Comment #44
quietone commentedCreated the followup asked for in #38, #3311747: Document configuration schema api key in an api.php.
Comment #45
quietone commented