COMOPT-1318: Update snowplow urls to be dynamic based on storefrontInstance environment#196
COMOPT-1318: Update snowplow urls to be dynamic based on storefrontInstance environment#196SarikaVanapalli wants to merge 1 commit intomainfrom
Conversation
| production: { | ||
| collectorUrl: "https://commerce.adobedc.net", | ||
| collectorPath: "/collector/tp2", | ||
| }, | ||
| qa: { | ||
| collectorUrl: "https://com-magento-qa1.collector.snplow.net", | ||
| collectorPath: "/com.snowplowanalytics.snowplow/tp2", | ||
| }, |
There was a problem hiding this comment.
Just to be certain - it is OK to expose the QA urls to the public?
One way to protect would be to have the initialization happen at runtime, and use a default value (prod url) or allow passing a collector url/path as argument to override. Then for QA you can intentionally set this in the integration code, without exposing the potentially secret/private QA endpoint.
There was a problem hiding this comment.
The qa urls have always been exposed in the webpack configs, so they probably won't be that big of a deal, but this change is going to have unintended consequences for magento users
There was a problem hiding this comment.
I'll mark this as a draft PR until we meet on Monday and decide next steps. Thanks for reviewing so quick! 🙏🏼
benjaminkalk
left a comment
There was a problem hiding this comment.
I don't think we can make this change. Merchants should not be sending event data to QA snowplow environment. They should be sending events to production using sandbox data space selection. Also, this would be a breaking change for all Luma test environments as we set value returned by Serviced Id configuration for the environment value.
|
I think the ideal outcome would be that the collector endpoint can be configured by an argument, but defaults to the same as they are today. As in, non-breaking change - prod bundle still uses prod endpooint by default, qa bundle uses qa endpoint by default. But now each build would allow passing of some argument which forces a different endpoint if provided.
@benjaminkalk can you clarify how this would be breaking? I don't know what you mean by "service id configuration for env value" |
|
As discussed with the team, this feature introduces breaking changes that will affect current ACCS merchants using the Luma storefront. Closing this PR. |
Description
Problem: Snowplow endpoints were hardcoded at build time via webpack, forcing events to the prod collector regardless of the storefront’s runtime environment.
Solution: Added a small config and runtime routing based on storefrontInstance.environment (qa/stage/test → QA; otherwise → Prod), preserving eventForwarding behavior and enabling a single build to work across environments.
The snowplow url defaults to
productionwhen no environment is detected or matches with the qa options, so the existing functionality will still work as it is without any issues.Related Issue
https://jira.corp.adobe.com/browse/COMOPT-1318
Motivation and Context
Problem: Snowplow endpoints were hardcoded at build time via webpack, forcing events to the prod collector regardless of the storefront’s runtime environment.
How Has This Been Tested?
The snowplow url defaults to
productionwhen no environment is detected or matches with the qa options, so the existing functionality will still work as it is without any issues.Screenshots (if appropriate):
Types of changes
Checklist