Skip to content

added playground url for the stage#540

Open
BaskarMitrah wants to merge 3 commits intostagefrom
playground/stage
Open

added playground url for the stage#540
BaskarMitrah wants to merge 3 commits intostagefrom
playground/stage

Conversation

@BaskarMitrah
Copy link
Collaborator

@BaskarMitrah BaskarMitrah commented Mar 3, 2026

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

@aem-code-sync
Copy link

aem-code-sync bot commented Mar 3, 2026

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

❌ Test Results

Status: Some tests failed!

🔍 Click to view failed tests
📁 test/blocks/columns/columns.test.js:

❌ Columns block > Columns > columns-container
      AssertionError: expected false to be true
      + expected - actual
      
      -false
      +true
      
      at n.<anonymous> (test/blocks/columns/columns.test.js:29:117)

❌ Columns block > Columns > buttons
      AssertionError: expected false to be true
      + expected - actual
      
      -false
      +true
      
      at test/blocks/columns/columns.test.js:100:86
      at NodeList.forEach (<anonymous>)
      at n.<anonymous> (test/blocks/columns/columns.test.js:95:50)


📁 test/blocks/embed/embed.test.js:

❌ Could not import your test module. Check the browser logs or open the browser in debug mode for more information.


📁 test/blocks/contributors/contributors.test.js:

❌ Contributors block > contributors > firstDiv
      AssertionError: expected null to exist
        at n.<anonymous> (test/blocks/contributors/contributors.test.js:32:28)


📁 test/blocks/tab/tab.test.js:

❌ Tab block > Tab Button Structure > tab > button load structure
      AssertionError: expected 'tab-button active' to equal 'tab-button'
      + expected - actual
      
      -tab-button active
      +tab-button
      
      at n.<anonymous> (test/blocks/tab/tab.test.js:60:38)

❌ Tab block > Sub-tabs > sub-tab > attributes
      AssertionError: expected 'subTab1' to equal 'subTab3'
      + expected - actual
      
      -subTab1
      +subTab3
      
      at test/blocks/tab/tab.test.js:135:58
      at NodeList.forEach (<anonymous>)
      at n.<anonymous> (test/blocks/tab/tab.test.js:133:23)



Test Coverage Report

Overall Coverage Summary

Metric Percentage Coverage
Statements 59.85% 3275/5472
Branches 86.37% 431/499
Functions 54.82% 108/197
Lines 59.85% 3275/5472

Coverage by File/Directory

File Statements Branches Functions Lines
blocks/accordion 100% 100% 100% 100%
blocks/announcement 76.69% 60% 100% 76.69%
blocks/banner 94.28% 62.5% 100% 94.28%
blocks/cards 94.04% 94.73% 100% 94.04%
blocks/carousel 76.9% 77.77% 75% 76.9%
blocks/columns 67.51% 78.94% 100% 67.51%
blocks/contributors 100% 100% 100% 100%
blocks/edition 91.22% 57.14% 100% 91.22%
blocks/fragment 19.37% 100% 0% 19.37%
blocks/image-text 57.5% 55.55% 100% 57.5%
blocks/info 96.87% 100% 100% 96.87%
blocks/info-card 73.86% 30% 100% 73.86%
blocks/info-columns 75% 100% 100% 75%
blocks/list 59.09% 85.71% 100% 59.09%
blocks/mini-resource-card 97.89% 87.5% 100% 97.89%
blocks/product-card 78.57% 94.11% 100% 78.57%
blocks/profile-card 96.29% 100% 100% 96.29%
blocks/site-hero 93.93% 80% 100% 93.93%
blocks/summary 98.36% 88.88% 100% 98.36%
blocks/tab 92.76% 88.46% 100% 92.76%
blocks/table 100% 84.61% 100% 100%
blocks/text 49.01% 83.33% 50% 49.01%
blocks/title 84% 66.66% 100% 84%
components 47.58% 100% 57.14% 47.58%
scripts 48.15% 93.04% 43.66% 48.15%

Coverage report generated at 2026-03-03T13:26:54.345Z

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

❌ Test Results

Status: Some tests failed!

🔍 Click to view failed tests
📁 test/blocks/columns/columns.test.js:

❌ Columns block > Columns > columns-container
      AssertionError: expected false to be true
      + expected - actual
      
      -false
      +true
      
      at n.<anonymous> (test/blocks/columns/columns.test.js:29:117)

❌ Columns block > Columns > buttons
      AssertionError: expected false to be true
      + expected - actual
      
      -false
      +true
      
      at test/blocks/columns/columns.test.js:100:86
      at NodeList.forEach (<anonymous>)
      at n.<anonymous> (test/blocks/columns/columns.test.js:95:50)


📁 test/blocks/embed/embed.test.js:

❌ Could not import your test module. Check the browser logs or open the browser in debug mode for more information.


📁 test/blocks/contributors/contributors.test.js:

❌ Contributors block > contributors > firstDiv
      AssertionError: expected null to exist
        at n.<anonymous> (test/blocks/contributors/contributors.test.js:32:28)


📁 test/blocks/tab/tab.test.js:

❌ Tab block > Tab Button Structure > tab > button load structure
      AssertionError: expected 'tab-button active' to equal 'tab-button'
      + expected - actual
      
      -tab-button active
      +tab-button
      
      at n.<anonymous> (test/blocks/tab/tab.test.js:60:38)

❌ Tab block > Sub-tabs > sub-tab > attributes
      AssertionError: expected 'subTab1' to equal 'subTab3'
      + expected - actual
      
      -subTab1
      +subTab3
      
      at test/blocks/tab/tab.test.js:135:58
      at NodeList.forEach (<anonymous>)
      at n.<anonymous> (test/blocks/tab/tab.test.js:133:23)



Test Coverage Report

Overall Coverage Summary

Metric Percentage Coverage
Statements 59.95% 3281/5472
Branches 86.4% 432/500
Functions 54.82% 108/197
Lines 59.95% 3281/5472

Coverage by File/Directory

File Statements Branches Functions Lines
blocks/accordion 100% 100% 100% 100%
blocks/announcement 76.69% 60% 100% 76.69%
blocks/banner 94.28% 62.5% 100% 94.28%
blocks/cards 94.04% 94.73% 100% 94.04%
blocks/carousel 76.9% 77.77% 75% 76.9%
blocks/columns 67.51% 78.94% 100% 67.51%
blocks/contributors 100% 100% 100% 100%
blocks/edition 91.22% 57.14% 100% 91.22%
blocks/fragment 19.37% 100% 0% 19.37%
blocks/image-text 57.5% 55.55% 100% 57.5%
blocks/info 96.87% 100% 100% 96.87%
blocks/info-card 73.86% 30% 100% 73.86%
blocks/info-columns 75% 100% 100% 75%
blocks/list 59.09% 85.71% 100% 59.09%
blocks/mini-resource-card 97.89% 87.5% 100% 97.89%
blocks/product-card 78.57% 94.11% 100% 78.57%
blocks/profile-card 96.29% 100% 100% 96.29%
blocks/site-hero 93.93% 80% 100% 93.93%
blocks/summary 98.36% 88.88% 100% 98.36%
blocks/tab 92.76% 88.46% 100% 92.76%
blocks/table 100% 84.61% 100% 100%
blocks/text 49.01% 83.33% 50% 49.01%
blocks/title 84% 66.66% 100% 84%
components 47.58% 100% 57.14% 47.58%
scripts 48.34% 93.08% 43.66% 48.34%

Coverage report generated at 2026-03-04T06:56:41.101Z

Copy link
Collaborator

@melissag-ensemble melissag-ensemble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ticket asks to use the stage playground URL on stage and local dev:

Suggested change
const playgroundURL = isStageEnvironment(window.location.host) || isHlxPath(window.location.host)
const playgroundURL = isStageEnvironment(window.location.host) || isLocalHostEnvironment(window.location.host)

@aem-code-sync
Copy link

aem-code-sync bot commented Mar 5, 2026

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

❌ Test Results

Status: Some tests failed!

🔍 Click to view failed tests
📁 test/blocks/columns/columns.test.js:

❌ Columns block > Columns > columns-container
      AssertionError: expected false to be true
      + expected - actual
      
      -false
      +true
      
      at n.<anonymous> (test/blocks/columns/columns.test.js:29:117)

❌ Columns block > Columns > buttons
      AssertionError: expected false to be true
      + expected - actual
      
      -false
      +true
      
      at test/blocks/columns/columns.test.js:100:86
      at NodeList.forEach (<anonymous>)
      at n.<anonymous> (test/blocks/columns/columns.test.js:95:50)


📁 test/blocks/embed/embed.test.js:

❌ Could not import your test module. Check the browser logs or open the browser in debug mode for more information.


📁 test/blocks/contributors/contributors.test.js:

❌ Contributors block > contributors > firstDiv
      AssertionError: expected null to exist
        at n.<anonymous> (test/blocks/contributors/contributors.test.js:32:28)


📁 test/blocks/tab/tab.test.js:

❌ Tab block > Tab Button Structure > tab > button load structure
      AssertionError: expected 'tab-button active' to equal 'tab-button'
      + expected - actual
      
      -tab-button active
      +tab-button
      
      at n.<anonymous> (test/blocks/tab/tab.test.js:60:38)

❌ Tab block > Sub-tabs > sub-tab > attributes
      AssertionError: expected 'subTab1' to equal 'subTab3'
      + expected - actual
      
      -subTab1
      +subTab3
      
      at test/blocks/tab/tab.test.js:135:58
      at NodeList.forEach (<anonymous>)
      at n.<anonymous> (test/blocks/tab/tab.test.js:133:23)



Test Coverage Report

Overall Coverage Summary

Metric Percentage Coverage
Statements 57.06% 3472/6084
Branches 85.08% 462/543
Functions 53.27% 114/214
Lines 57.06% 3472/6084

Coverage by File/Directory

File Statements Branches Functions Lines
blocks/accordion 100% 100% 100% 100%
blocks/announcement 76.69% 60% 100% 76.69%
blocks/banner 94.28% 62.5% 100% 94.28%
blocks/cards 94.04% 94.73% 100% 94.04%
blocks/carousel 76.9% 77.77% 75% 76.9%
blocks/columns 67.51% 78.37% 100% 67.51%
blocks/contributors 100% 100% 100% 100%
blocks/edition 91.22% 57.14% 100% 91.22%
blocks/fragment 48.83% 100% 50% 48.83%
blocks/image-text 57.5% 55.55% 100% 57.5%
blocks/info 96.87% 100% 100% 96.87%
blocks/info-card 73.86% 30% 100% 73.86%
blocks/info-columns 75% 100% 100% 75%
blocks/inlinealert 18.64% 100% 0% 18.64%
blocks/list 59.09% 85.71% 100% 59.09%
blocks/mini-resource-card 97.89% 87.5% 100% 97.89%
blocks/product-card 78.57% 94.11% 100% 78.57%
blocks/profile-card 96.29% 100% 100% 96.29%
blocks/side-nav 18.57% 42.85% 16.66% 18.57%
blocks/site-hero 93.93% 80% 100% 93.93%
blocks/site-wide-banner 35.04% 25% 100% 35.04%
blocks/summary 98.36% 88.88% 100% 98.36%
blocks/tab 92.76% 88.46% 100% 92.76%
blocks/table 100% 84.61% 100% 100%
blocks/text 49.01% 83.33% 50% 49.01%
blocks/title 84% 66.66% 100% 84%
components 47.58% 100% 57.14% 47.58%
scripts 48.97% 93.53% 44.36% 48.97%

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)
Copy link
Collaborator

@melissag-ensemble melissag-ensemble Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Suggested change
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

Copy link

@timkim timkim Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants