Conversation
❌ Test ResultsStatus: Some tests failed! 🔍 Click to view failed testsTest Coverage ReportOverall Coverage Summary
Coverage by File/Directory
Coverage report generated at 2026-03-03T13:26:54.345Z |
❌ Test ResultsStatus: Some tests failed! 🔍 Click to view failed testsTest Coverage ReportOverall Coverage Summary
Coverage by File/Directory
Coverage report generated at 2026-03-04T06:56:41.101Z |
hlx_statics/scripts/scripts.js
Outdated
|
|
||
| const playgroundExecutionMode = pre?.getAttribute('data-playground-execution-mode'); | ||
| const playgroundURL = pre?.getAttribute('data-playground-url'); | ||
| const playgroundURL = isStageEnvironment(window.location.host) || isHlxPath(window.location.host) |
There was a problem hiding this comment.
The ticket asks to use the stage playground URL on stage and local dev:
| const playgroundURL = isStageEnvironment(window.location.host) || isHlxPath(window.location.host) | |
| const playgroundURL = isStageEnvironment(window.location.host) || isLocalHostEnvironment(window.location.host) |
|
❌ Test ResultsStatus: Some tests failed! 🔍 Click to view failed testsTest Coverage ReportOverall Coverage Summary
Coverage by File/Directory
Coverage report generated at 2026-03-05T05:02:10.628Z |
|
|
||
| const playgroundExecutionMode = pre?.getAttribute('data-playground-execution-mode'); | ||
| const playgroundURL = pre?.getAttribute('data-playground-url'); | ||
| const playgroundURL = isStageEnvironment(window.location.host) || isLocalHostEnvironment(window.location.host) |
There was a problem hiding this comment.
To handle .page urls, please modify the env checks so you can use it as a util:
export function isStageEnvironment(host, includeAemHosts = false) {
return host.indexOf('stage.adobe.io') >= 0
|| host.indexOf('developer-stage') >= 0
|| (includeAemHosts && host.indexOf('.page') >= 0 && host.indexOf('--adp-devsite-stage--') >= 0);
}
export function isDevEnvironment(host, includeAemHosts = false) {
return host.indexOf('developer-dev') >= 0
|| (includeAemHosts && host.indexOf('.page') >= 0 && host.indexOf('--adp-devsite--') < 0);
}
export function isProdEnvironment(host, includeAemHosts = false) {
return host.indexOf('developer.adobe.com') >= 0
|| (includeAemHosts && host.indexOf('.live') >= 0);
}
Then update your logic to:
| const playgroundURL = isStageEnvironment(window.location.host) || isLocalHostEnvironment(window.location.host) | |
| const playgroundURL = isStageEnvironment(window.location.host, true) || isLocalHostEnvironment(window.location.host) |
For details, please see slack discussion: https://adobeio.slack.com/archives/C06M1C7UBV3/p1772728512877719?thread_ts=1772608055.424379&cid=C06M1C7UBV3
There was a problem hiding this comment.
Since there are situations where we want to know if we're on developer-stage.adobe.com, developer.adobe.com, localhost, or on a .page or .live url, I think the above should handle our needs.
Description
I’ve added separate stage and production URLs for the playground. Previously, stage, local, and production were all using the production URL. Now I’ve updated it so that the URLs are handled differently.
If the environment is stage or local, it will render the stage URL. Otherwise, it will render the production URL.
I’ve fixed the issue with this change.
Ticket
https://jira.corp.adobe.com/browse/DEVSITE-2244
Test URL
Previous: https://stage--adp-devsite-stage--adobedocs.aem.page/github-actions-test/test/code-playground-button
Updated : https://playground-stage--adp-devsite-stage--adobedocs.aem.page/github-actions-test/test/code-playground-button