Follow-up to #2855675: Add orderby key to all sequences in core
Problem/Motivation
Sequences that are not sorted can result in unexpected configuration differences whilst importing configuration. Which confuses users because they are being told something is different when it is not. Also this behaviour can result in random test fails
Third party settings are ordered by the order in which the third party settings are added. This means that the same configuration can be different on depending on the order in which it is was configured.
Proposed resolution
Add orderby key and test it.
Remaining tasks
User interface changes
None
API changes
None.
Data model changes
All sequences in configuration sorted. This patch will introduce the generic upgrade path for all #2855675: Add orderby key to all sequences in core sub-issues.
Comment | File | Size | Author |
---|---|---|---|
#36 | 2860531-36.patch | 4.52 KB | ameymudras |
#31 | 2860531-31.patch | 4.35 KB | ameymudras |
#27 | 2860531-nr-bot.txt | 144 bytes | needs-review-queue-bot |
#25 | 11-25-interdiff.txt | 1.32 KB | eleonel |
#25 | 2860531-25.patch | 133.13 KB | eleonel |
Issue fork drupal-2860531
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
alexpottComment #3
alexpottHmmm... thinking about this some more perhaps we should just introduce the generic update path test here and add to it as we add schema that's sorted.
I have to generate a new dump because I wanted to test with config_test entities and that requires config_test to be installed and its entity schema. Furthermore, we need a new dump so something like system_post_update_recalculate_configuration_entity_dependencies() doesn't come a do all the fixing for us.
Comment #4
alexpottTagging for 8.4.0 release notes since exporting configuration after doing the update is going to be important.
Comment #7
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedLooks like you included a .gz file as well while creating patch. Leading to such content in the patch.
Comment #8
swentel CreditAttribution: swentel as a volunteer commenteds/to/with ?
@gaurav.kapoor : that's intented - that's how you can add a large dump of a db which will be imported for upgrade tests.
Comment #9
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedthanks for info @swentel.
Comment #10
alexpottFixing the test fail.
Comment #11
alexpottOops forget to fix #8 - thanks for the review @swentel.
Comment #13
Wim LeersAFAICT this patch was just waiting to be RTBC'd, unfortunately I only discovered it now :(
It's not just about resaving configuration, it's about resaving configuration to ensure correct sorting.
So "ResaveConfigForCorrectSorting" or something like that would make more sense. Because "resave config" is something that's likely to happen again in the future.
Other than that, I think this looks totally ready! I do think this will need a change record though, because it'll cause config managed via git to be changed for existing sites.
Comment #23
larowlanComment #24
eleonelRe-rolled patch.
Comment #25
eleonelRe-rolled patch (ignore patch from #24)
Comment #27
needs-review-queue-bot CreditAttribution: needs-review-queue-bot as a volunteer commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #30
rpayanmReeolled.
Comment #31
ameymudras CreditAttribution: ameymudras at Salsa Digital commentedComment #32
smustgrave CreditAttribution: smustgrave at Mobomo commentedThis issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.
moving to NW for change record.
Comment #34
borisson_Added a CR. Back to rtbc.
Comment #35
alexpottDuring updates you need to save with trusted data set to TRUE otherwise you can get in the way of other updates. Therefore you need to do sort here. Also you should only same them if they have third party settings.
Comment #36
ameymudras CreditAttribution: ameymudras at Salsa Digital commentedComment #37
smustgrave CreditAttribution: smustgrave at Mobomo commented@ameymudras thanks for working on this. Please include interdiffs though to easily see the changes.
+ $config_factory->getEditable($config_name)->save(TRUE);
Seems to address #35
Since this was previously RTBC going to restore but do wonder about
unset($sandbox['config_names'][$key]);
Comment #38
alexpottTrusting the configuration here means that it will not sort. So this update function will not work. See discussions on #3017054: Consistently sort filter formats to simplify config exports for lots about this.
I think here we should change the update to do the sorting and continue to use the trusted data feature as this update should not be fixing other things.
We also need to add a sort to \Drupal\Core\Config\Entity\ConfigEntityBase::preSave() in the same place as we do the dependency sorting.
Comment #39
borisson_Removing the needs CR tag,