- Issue created by @mlncn
- π¨πSwitzerland bircher π¨πΏ
I think using Drupal's API is the better choice. We can fork the config import command and adjust it to our needs, depending on how much of the things in it we need.
The only thing that it does differently than the drupal UI is shown the diff based on the diff of exported config to two temporary directories.
Maybe that is something that drush could do in a trait we could use... but that would mean requiring a yet unreleased version of drush. So in the meantime I would just fix this here. Config Split could use such a trait too and possibly other modules too. - First commit to issue fork.
- @trackleft2 opened merge request.
- πΊπΈUnited States trackleft2 Tucson, AZ πΊπΈ
For changes I referenced the following documentation:
- First commit to issue fork.
- Status changed to Needs work
over 1 year ago 4:09pm 1 August 2023 - πΊπΈUnited States joegraduate Arizona, USA
Setting to needs work for MR comments / suggestions
- πΊπΈUnited States trackleft2 Tucson, AZ πΊπΈ
Let's not introduce the Service folder convention here, as it will be a breaking change for no reason.
- Status changed to Needs review
over 1 year ago 8:12pm 2 August 2023 - πΊπΈUnited States joegraduate Arizona, USA
Thanks @trackleft2 for working on this!
I've tested MR !6 in conjunction with the config_sync MR for π Config Sync breaks with Drush 12, need to refactor not to use ConfigImportCommands Fixed and verified that:
- The `drush cd-update` command still works as expected with both Drush 11 and Drush 12
- config_sync's tests still pass
I think it would be good to commit this change and include it in a new 2.0.x release so that config_sync can require the new version as part of the fix for π Config Sync breaks with Drush 12, need to refactor not to use ConfigImportCommands Fixed .
@tadean is also planning to review / test this so not marking this RTBC yet.
- πΊπΈUnited States joegraduate Arizona, USA
I've tested MR !6 again (after all the recent changes) and verified that:
- The `drush cd-update` command still works as expected with both Drush 11 and Drush 12
- config_sync's tests still pass
- πΊπΈUnited States joegraduate Arizona, USA
Spoke to @tadean about this. We both think it'd be better to move the config import code from the new free-standing
ConfigDistroImporter
service introduced by this MR into a private method in the Drush command class for now since it currently relies on the Drush logger (so isn't particularly useful as a free-standing service for anything other than drush commands). Having the code in a private method for now also has the benefit of making it easier to change in the future.I've done this refactoring in a local working copy of the MR branch and will push up the changes shortly.
I've also verified that the following things still work after refactoring:
- The `drush cd-update` command still works as expected with both Drush 11 and Drush 12
- config_sync's tests still pass
Thanks for all the promising work on this issue! I tested the refactored
config-distro-update
command against Drush12.1.2
, used in conjunction with the related patch from theconfig_sync
issue π Config Sync breaks with Drush 12, need to refactor not to use ConfigImportCommands Fixed to avoid the similar error and was able to import configuration changes from a custom module without error:$ drush config-distro-update +------------+---------------------------+-----------+ | Collection | Config | Operation | +------------+---------------------------+-----------+ | | node.type.my_content_type | Update | +------------+---------------------------+-----------+ Import the listed configuration changes? (yes/no) [yes]: > yes [notice] Synchronized configuration: update node.type.my_content_type. [notice] Finalizing configuration synchronization. [success] The configuration was imported successfully.
I verified manually that the configuration seemed to be imported correctly.
-
joegraduate β
committed 898cb706 on 2.0.x authored by
trackleft2 β
Issue #3369336 by trackleft2, joegraduate, mlncn, tadean: Config Distro...
-
joegraduate β
committed 898cb706 on 2.0.x authored by
trackleft2 β
- Status changed to Fixed
over 1 year ago 8:36pm 11 August 2023 - πΊπΈUnited States joegraduate Arizona, USA
Merged into 2.0.x branch. Thanks all!
Automatically closed - issue fixed for 2 weeks with no activity.