drupalwxt / helm-drupal

Helm Chart for deploying an enterprise-grade Drupal environment.
https://drupalwxt.github.io/helm-drupal/index.yaml
MIT License
31 stars 22 forks source link

Update Drupal confs to support DB init_commands #110

Closed markwooff closed 2 years ago

markwooff commented 2 years ago

I'm hoping to add a new value to the external DB config to enable more customization using the Drupal init_commands DB settings field. This will allow a developer to modify DB variables on startup such as sql_mode or the isolation level using the format in the example below:

external:
  initCommands:
    - isolation: "SET SESSION tx_isolation='READ-COMMITTED'"

These Helm values will then be applied to the $databases Drupal array as follows:

$databases['default']['default'] = [
  'init_commands' => [
    'isolation' => "SET SESSION tx_isolation='READ-COMMITTED'",
  ],
];
markwooff commented 2 years ago

This also looks good! Thanks! If you could add an example (commented out) in values.yaml that would be great!

No problem at all. Hopefully this will help anyone else running into the same DB issues we had 👍

sylus commented 2 years ago

Oh just one more thing can you bump the chart.yaml version as well?

markwooff commented 2 years ago

Oh just one more thing can you bump the chart.yaml version as well?

Wasn't sure how your versioning works so I figured these bumps would be done on your end after the PRs are merged. However if you want, I can bump a minor or patch version for each PR?

zachomedia commented 2 years ago

@markwooff There's a bug in the current CI that will overwrite the current version if we merge with the same version number. We intend to fix this soon, so until then we unfortunately have to increase it in the PR. I think this is fine as a patch version increase.

markwooff commented 2 years ago

@zachomedia sounds good. I've bumped this up a patch version and will increment https://github.com/drupalwxt/helm-drupal/pull/111 by another!