commercetools / commercetools-sunrise-java-starter

Bootstrap project using commercetools Sunrise Framework & Theme
http://demo.commercetools.com/
Apache License 2.0
8 stars 16 forks source link

FACETS ENV var #32

Open allcentury opened 7 years ago

allcentury commented 7 years ago

We're having trouble setting FACETS via an ENV variable. We currently receive:

[CompletionException: com.google.inject.ProvisionException: Unable to provision, see the following errors: 1) Error in custom provider, Configuration error: Configuration error[env var FACETS: pop.facets has type STRING rather than LIST] while locating com.commercetools.sunrise.productcatalog.productoverview.search.facetedsearch.FacetedSearch
ConfigListProvider at Module.configure(Module.java:65) (via modules: com.google.inject.util.Modules$OverrideModule -> Module) while locating com.commercetools.sunrise.productcatalog.productoverview.search.facetedsearch.FacetedSearch
ConfigList for field at com.commercetools.sunrise.productcatalog.productoverview.search.facetedsearch.FacetedSearchSelectorListFactory.facetedSearchConfigList(FacetedSearchSelectorListFactory.java:14) while locating com.commercetools.sunrise.productcatalog.productoverview.search.facetedsearch.FacetedSearchSelectorListFactory for field at com.commercetools.sunrise.productcatalog.productoverview.search.facetedsearch.FacetedSearch
Component.facetedSearchSelectorListFactory(FacetedSearchComponent.java:29) while locating com.commercetools.sunrise.productcatalog.productoverview.search.facetedsearch.FacetedSearch
Component for parameter 0 at productcatalog.ProductOverviewController.setFacetedSearchComponent(ProductOverviewController.java:32) at productcatalog.ProductOverviewController.class(ProductOverviewController.java:13) while locating productcatalog.ProductOverviewController

We've tried setting a few examples, such as:

FACETS="[{\"key\":\"productType\",\"type\":\"category_tree\",\"label\":\"catalog:filters.productType\",\"expr\":\"variants.categories.id\",\"count\":false,\"multiSelect\":false,\"mapper\":{\"type\":\"category_tree\"}}]

However, any environment variable is going to be interpreted as a string so I'm guessing we're not parsing the value.

Our use case here is to use the 1 click deploy as much as possible for POC's and only set ENV vars as needed. For the meantime we've forked the repo and changed facets in code and deployed that to heroku manually. This is low priority for us. If we're supposed to set FACETS in a different way, please let us know and we can update the documentation.