Skip to content
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

Site Splits Broken #3674

Closed
mikemadison13 opened this issue May 22, 2019 · 7 comments · Fixed by #3676
Closed

Site Splits Broken #3674

mikemadison13 opened this issue May 22, 2019 · 7 comments · Fixed by #3676
Labels
Bug Something isn't working
Milestone

Comments

@mikemadison13
Copy link
Contributor

mikemadison13 commented May 22, 2019

Describe the bug
This is an issue impacting both BLT 9.2.x and 10.x (and perhaps previous versions as well).

Currently, config splits based on a site (or site splits) should be functional when a config split has the exact same name as a site on ACSF.

After #3362 got fixed (which resolved a site name detection issue) I had hoped we were good, but after extensive troubleshooting, this is still not working.

To Reproduce
Steps to reproduce the behavior, ideally starting from a fresh install of BLT:

  1. Create a "site split" that properly matches the site name of at least one acsf site
  2. Deploy code to acsf
  3. Confirm that the site split didn't get activated
  4. Using drush php print out the global $config array
  5. see output:
global $config;
>>> print_R($config);
Array
(
    [config_split.config_split.local] => Array
        (
            [status] => 
        )

    [config_split.config_split.dev] => Array
        (
            [status] => 
        )

    [config_split.config_split.stage] => Array
        (
            [status] => 
        )

    [config_split.config_split.prod] => Array
        (
            [status] => 
        )

    [config_split.config_split.ci] => Array
        (
            [status] => 
        )

    [config_split.config_split.ah_other] => Array
        (
            [status] => 1
        )

    [config_split.config_split.g/files/<directory>] => Array
        (
            [status] => 1
        )

Expected behavior
I would expect an additional item in the config array above that corresponds with the site split. I could understand if the split wasn't getting activated for "some reason" but the fact that it's not in the config object at all is highly suspect given https://github.com/acquia/blt/blob/10.x/settings/config.settings.php#L89

Detailed error output
N/A

BLT doctor output
N/A

System information

  • BLT version: 9.2.3 (but persists across all 9.2.x and 10.x versions)

Additional context
This issue fits into a broader issue with config splits and the current landscape. While not directly related, #3575 is a similar set of broken config split detection (but for profiles).

I think environment splits have been fine all along (because BLT can detect that). Site splits should also be fine, once we merge these PRs, as BLT can easily detect the site on ACSF (thanks to the post-sites factory hook). However, as mentioned, profile splits require bootstrapping Drupal (so are a slightly different ball of wax).

Solution
We tested this by adding a global $_acsf_site_name, re-deployed, and confirmed that the site splits were actually working.

@mgamshad
Copy link

mgamshad commented Jul 17, 2019

Hi,
We have an ACSF BLT application and it seems that site split is still not working. In looking at the code in blt.settings.php, the $_acsf_site_name is being set based the local environment's hostname. Furthermore this comment indicates a pattern for naming local sites:

// The hostname must match the pattern local.[sitename].com, where // [sitename] is a value in the multisites array.

In our project setup we use a generic d8.site.com name, which of course does not match that pattern. So when in config.settings.php the $_acsf_site_name is used:

// Set acsf site split if explicit global exists. if (isset($_acsf_site_name)) { $config["$split_filename_prefix.$_acsf_site_name"]['status'] = TRUE; }

the site split won't be applied since the site name variable is not set. Is that correct or am I reading this wrong?

Thanks,
mohsen

@mikemadison13
Copy link
Contributor Author

What version of BLT?

@mgamshad
Copy link

What version of BLT?

9.2.8.

thanks,
mohsen

@mikemadison13
Copy link
Contributor Author

mikemadison13 commented Jul 17, 2019

Site splits were fixed after the release of BLT 9.2.8. You either need to manually patch the fix (see #3675) or you need to update to 10.x!

@mgamshad
Copy link

Perfect, thanks.

@mgamshad
Copy link

One other question: if we are trying to move a BLT 9.x application off of Features to core CMI and config-split, apart from moving to BLT 10.x (based on your reply), do we need to pull in any other specific version of any other dependencies?

thanks,
mohsen

@mikemadison13
Copy link
Contributor Author

not really, no. mostly it's just making sure config split is enabled and your configuration is moved out of the feature modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants