-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allow config-import to be skipped when config is empty #2701
Comments
I am not per-se against it, but I am also not sure how this can happen without being an error of some sort. So an empty config directory seems to be an error. If a split directory is empty it will just simply not add anything to the sync directory when importing and you wouldn't get the failure you are getting. |
I have tried to execute drush config-import, it will get the same error. [error] Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization. in Drupal\Core\Config\ConfigImporter->validate() (line 728 of /home/local/RAGE/balajir/projects/drupal/cdstdev/drupal/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php). Please provide the any solution |
I could also use this. We have our own internal version of drupal-project that uses the |
+1, empty config directory because all configuration is deployed via code. Would be nice to still use drush deploy |
Are the config files not in your repo? That would be a non-standard workflow. You can't easily stage/test configuration changes. Is that true for other people in this issue? I'm not really understanding the reasoning behind this request. |
We are definitely encountering web teams that lack active developers, that do not want to manage their config via code, and want to only rely on the active config in the database. It would be nice if our tooling that uses |
I think the deploy command could have a skip config import option. But I think calling config import and the directory being empty should always fail. |
Thanks @alexpott. Your suggestion makes sense. Yet I looked into implementation, and nothing makes more sense to me than folks just using this 3 line custom script:
|
Currently, if you try to execute
drush config-import
and the config directory is empty, you will receive an error like this:At first, I tried to workaround this by checking to see if the config directory was empty prior to import. However, if you're using something like config_split, your config directory may change depending on environment. It's not easy (from the CLI) to know which directory to check. This makes it difficult to create a good CI build.
So, I propose adding a
--skip-if-empty
option todrush config-import
that will skip configuration import without failure if the config directory is empty.The text was updated successfully, but these errors were encountered: