---
# System prepended metadata

title: Vista Sites notes

---

# Vista Sites notes
PR: https://github.com/99designs/shared-configuration-bundle/pull/214

## Next Steps:
- Swap out tenant to `vista` instead of `vistaprint`
- Assertain whether anything uses the domain -> site relationship within Shared Config. Understand what's loadbearing about domain to site? The getByDomain method should continue to fail, that's expected.
- Remove the domain php test. What is it protecting against in the PHP implementation?
- Release a new version of shared-config-bundle that deletes DOMAINS_CONFIG_KEY as it doesn't appear to be consumed by anything
- Test out the new SCB package in our PHP apps ie: Contests, Projects

---

## PHP Implementation
Error: Duplicate config definition for domain vistaprint.com
https://buildkite.com/99designs/shared-configuration-bundle/builds/1142#0185f137-3ab1-41af-9242-˜˜a0c0dfb3acdf/1030-1220

The SitesExtensionTest fails when loading the sites yaml:
https://github.com/99designs/shared-configuration-bundle/blob/8de3ebdfa7302fcff4232790b5b14238249fddfd/php/src/Tests/DependencyInjection/SitesExtensionTest.php#L171

When the container sets the DOMAINS_CONFIG_KEY parameter using the private generateDomainList(sites) function it errors:
https://github.com/99designs/shared-configuration-bundle/blob/8de3ebdfa7302fcff4232790b5b14238249fddfd/php/src/DependencyInjection/SitesExtension.php#L63

This is because generateDomainList() will error if it detects duplicate domains (ie a site config that repeats a domain):
https://github.com/99designs/shared-configuration-bundle/blob/8de3ebdfa7302fcff4232790b5b14238249fddfd/php/src/DependencyInjection/SitesExtension.php#L118-L124

generateDomainList() is only called by DOMAINS_CONFIG_KEY
https://github.com/search?q=org%3A99designs+generateDomainList&type=code

DOMAINS_CONFIG_KEY is only called by SitesExtension and it's test:
https://github.com/search?q=org%3A99designs+DOMAINS_CONFIG_KEY&type=code

So it's likely this feature is not used? When was it added?

DOMAINS_CONFIG_KEY was added 9 years ago as part of setting up the Symfony bundle to cache the site configs. This was probably ripped out of contests and the DOMAINS_CONFIG_KEY might have not been put to use.
https://github.com/99designs/shared-configuration-bundle/pull/1


### SiteFactory:

In SiteFactory there's also findSiteKeyByDomain() which is called by createByDomain()

findSiteKeyByDomain() is called in contests here:
https://github.com/search?q=org%3A99designs+findSiteKeyByDomain&type=code


createByDomain() isn't called anywhere else except for the SiteFactory:
https://github.com/search?q=org%3A99designs+createByDomain&type=code


Summary: Delete all the things

---



## Go implementation

siteconfig.go has MustGetByDomain() which will eventually be deprecated as part of the public shared-config

MustGetByDomain() is called in numerous other codebases:
https://github.com/search?q=org%3A99designs+MustGetByDomain&type=code

Bastion calls MustGetByDomain() several times within its redirect middleware, requestmatcher, lang utils etc:


...

---


## Ruby implementation

...

---


## JS implementation



---

## Other notes
There's a hack in place in Contests for our 99designs Argentinian domain:
https://github.com/99designs/contests/blob/a00dfb2a9bc41c0f7a8d13f1fd9b83ff278be36e/src/Contests/Sites/SiteFactory.php#L40-L45

Global nav locale-data?


acquisition-frontend:
https://github.com/99designs/acquisition-frontend/blob/81ee96a7bf9c67b3052ee225d6d828597da6f752/acquisition/components/I18nProvider.tsx#L30


## Site example config:

{
    "99designs.en_US": {
        "sitegroup": "99designs",
        "name": "99designs",
        "domain": "99designs.com"
    },
    "99designs.en_AU": {
        "sitegroup": "99designs",
        "name": "99designs",
        "domain": "99designs.com.au"
    },
    "vistaprint.en_AU": {
        "sitegroup": "vistaprint",
        "name": "vistaprint",
        "cookiedomain": ".vistaprint.com.au",
        "domain": "vistaprint.com.au",
        "locale": "en_AU",
        "currency": "AUD"
    }
}



