Skip to content

Commit abd4446

Browse files
sf-shikhar-prasoonjeremy-jung1larnelleankundashethjalexvuong
authored
update feature/manual-bonus-products-v3 with latest commits in develop (#3225)
* Some temporary? changes to get it to work * Update config * bundlesize increase * Update CHANGELOG.md * Update react-rendering.js * reverting jest config changes * linted files * Apply feedback * Apply feedback * Enhancing observability by adding more granular tracing to the react.rendering.js file to the SSR process using the functions implemented in * updating change log * updating change log * linted files and re-wrote as well as removed some tests * linted files and re-wrote as well as removed some tests * linted files and re-wrote as well as removed some tests * Fixing flaky lighthouse test * Fixing flaky lighthouse test and addressing reviews * Fixing flaky lighthouse test and addressing reviews * Making sure functions from spike file are added and addressing reviews * adjusting bundle size * adjusting bundle size * updating template retail react app change log after adjusting bundle size * addressed reviews * linted files and updated open telemetry file * added tests to meet coverage and linted files * added tests to meet coverage and linted files * added tests to meet coverage and linted files * added tests to meet coverage and linted files * linted files and updated open telemetry file * linted files and updated open telemetry file * linted files and updated open telemetry file * linted files and updated open telemetry file * added tests and linted files * made sure the logs output span data without the open telemetry span data prefix * made sure the logs output span data without the open telemetry span data prefix * made sure the logs output span data without the open telemetry span data prefix * made sure the logs output span data without the open telemetry span data prefix * removing duplicate span names from monitoring cloud * removing duplicate span names from monitoring cloudand making sure all span durations show * updating open telemetry tests * Add S3 client with role based access * Get and put S3 objects with ETag * Create MRTTargetManager script * Update mrt-target-manager with status command * Organize coded * Update release command * Implement composite action for e2e_acquire_mrt_target * Restore credentials * Restrict write actions in local dev * Clean up env vars * Added Install monorepo dependencies step * Update S3 client options * Add Configure AWS credentials step for github actions * Update OIDC Permissions for Github AWS Auth * Fix roleSessionName * Check read only * Check process.env.ci * Fix readonly logic * Return output from script to Github * Update output format * Echo outputs in github actions * Echo output * Print github output * print github output * Set output using @actions/core * Test outputs * Add shell * Update sessionName * Return outputs to workflows * Return outputs * output * addressing reviews and linting files * addressing reviews and linting files * addressing reviews and linting files * Print MRT target details to a json file * Fix imports * Fix imports * making sure duplicates dont show in monitoring cloud * making sure duplicates dont show in monitoring cloud * Use slug to match MRT key instead of mrtEnvId * Update pool json properties * Remove MRT target scaling for now * Remove sample json * adressing reviews * Remove code for release env * Refactor commander options * Update role session name * Extract string literals to constants * Extract externalId to env var and remove for CI runs * Added todo to remove roleARN * Remove roleArn for CI * Combine ciRunInfo into own object * Added jsdoc and removed unused functions * Remove unused imports * Add docs explaining the output file is automatically deleted * Add unit tests * Add unit tests for e2e/scripts * Remove gtime check when running npm ci * addressed reviews and made sure spans are showing on monitoring cloud again * addressed reviews and made sure spans are showing on monitoring cloud again * Added tests * Fix dependency cycles * Fix test issues * Fix linting * Restore gtime check * reverting a package.json change * addressing reviews * Move e2e/scripts/package.json up a level * Fix linting in other e2e test files * Remove redundant package defs * Exclude playwright tests from jest runs * Use test instead of it for tests * Use more robust JS Object method to check if a property exists in an object * Update e2e/scripts/pageHelpers.js Co-authored-by: Alex Vuong <alex.vuong@salesforce.com> Signed-off-by: Jainam Sheth <99490559+shethj@users.noreply.github.com> * Added release env command to mrt-target-manager * Setup post hook to release MRT target back to pool * FIx release action file name * Fix node version on release mrt action * Exclude github dist from gitignore * Remove external dependency when running cleanup * addressing reviews * addressing reviews * Added unit tests for release target * addressing reviews * addressing reviews * Remove indentations * Sleep workflow for 30s * try removing node env checks * linting * remove some new lines * Optionally send ci args to acquire * Added action and helpers to update MRT Target * CI trigger * Ci trigger * Handle JSON input in bash * Fix proxy json input * Remove double string quotes * Remove double string quotes * Handle JSON string as inputs * Fix mrt hostname * Update MRT API secret * Remove stringify from fetch body * remove unnecessary change * Fix json formatting for payload * Handle bash escaping * Fix command * FIx args * Set env vars to dynamic MRT target * Debug invalid key * Pass in cloud origin to env-var API * Pass in cloud origin to e2e-pr workflow * Added tests for update-mrt-target * Remove redundant tests * Remove unused functions * make actions description clearer * Use overwrite for env vars * Fix duration issue * Remove changelog from retail app * Modify changelog * @W-18760799 - E2E tests for SSR logs with B3-Traceid header (#3028) * created e2e tests for SSR logs with B3-Traceid header * reverting a package.json change * Clean up tests * Update CHANGELOG.md * Clean up comments and remove similar test * Update failing test --------- Co-authored-by: Jang ho Jung <jangho.jung@salesforce.com> * A changelog change * Updates supporting SERVER_TIMING env var, fix x-b3 headers sometimes not showing up, error message included in logging, linting * Bring back performanceTimer.log * Update CHANGELOG.md * Refactor update MRT target * Fix incorrect project slug * Fix filename * Remove console.log * Update tests and add samples * FIx linting * Add dotenv to e2e-scripts package.json * Link test runs to acquired MRT target * Don't pass cloud origin to create_mrt * Update project slug * Restrict test runs to .spec.js files * Parallelize test runs for e2e and a11y * Parallelize only the test runs * Revert parallel runs * Run playwright tests in parallel * Optimize test run * Optimize playwright browser installs * Optimize test run * Fix linting * Rename job * Clean up test run command * Document parallel runs * Add docs for playwright workers * Update prettier settings * Clean up comments * Fix playwright test command * Fix test run command * Address some feedback * linting * Decrease bundlesize by separating server-side logic * Remove stack traces * Update CHANGELOG.md * Remove unused package * Update CHANGELOG.md * commerce-sdk-react v4 - Remove deprecated properties + fix private client proxy endpoint prop name (#3177) * Clean up useDNT deprecations * Breaking: remove /mobify path constants from commerce-sdk-react * Fix private client prop name * Update changelogs * Update CHANGELOG.md * update more places that called updateDNT * Update a11y snapshots to include unique landmark for toasts * Revert peridot from a11y snapshot * Revert MRT flag * Feat: Consume new OAS Isomorphic SDK (@W-19105545@) (#2879) * refactor * fix build issues * trim uncessarry changes * remove most usages of * fix tests * update test files * fix unit tests * Bump commerce-sdk-isomorphic * Fix tests and lint errors * Bump commerce-sdk-react major version * Revert "Bump commerce-sdk-react major version" This reverts commit a62fcdf. * Bump bundle size * Try with larger runner * Update imports * Update bootstrap config * Update tsconfig * Rename ShopperSeo directory to ShopperSEO & Fix test-commerce-sdk-react * Clean up * Major bump commerce-sdk-react * Create CHANGELOG.md * Remove changelog file from test-commerce-sdk-react * PR Feedback * PR Feedback address TODO * PR Feedback use `helpers.authorizeIDP` instead of manual URL * Use `ShopperLoginTypes.getPasswordResetTokenBodyType` in getPasswordResetToken * Use `ShopperLoginTypes.resetPasswordBodyType` in resetPassword * Use DATA_MAP token_type * Use `loginRegisteredUserB2C` in register() and updateCustomerPassword() * Restore original API interface for `authorizeIDP`, `loginIDPUser` and `authorizePasswordless` * Restore original type names removing Public * Restore `privateClient` parameter in `authorizeIDP` --------- Signed-off-by: Adam Raya <adamraya@users.noreply.github.com> Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> Co-authored-by: Adam Raya <adamraya@users.noreply.github.com> * Exit workflow if app validation fails * Fix docs * Fix project key * [CI workflow] Send Slack notification to multiple channels (@W-19432819@) (#3182) * Send Slack notification to multiple channels * Add link to the MRT project * Make sure to update all webhook url * Rename job to be more accurate * Debugging * Revert "Debugging" This reverts commit c7f6ef0. * Inject sfdc_user_agent request header into all SCAPI requests (@W-18404859@) (#3183) * Inject `sfdc_user_agent` request header * Update App Generator pwa-kit-create-app hbs files * Use package name pwa-kit-react-sdk and version in sfdc header * Include headers in commerce-sdk-react auth request * lint * Rename utils file * lint * Fix import path in generated project * Update Changelog.md * PR Feedback * PR Feedback * Bump max bundle size (#3191) * @W-18891305 MULTISHIP merge to develop (#3056) * Apply more feedback * linting * more linting * @W-19442561 - Fix Incorrectly Disabled Continue to Shipping Method Button for Multiship (#3199) * Comment out problematic job * Update e2e-pr.yml * @W-19443375,@W-19350149 MULTISHIP fix address function mismatch and options promotions (#3203) * @W-19451314 - Add ShipmentId to Create Shipment Body (#3211) * [`develop` branch] Bump up the dev versions (#3208) * Bump up dev versions The previous dev versions have been "claimed", since they were accidentally published to npm. We need to use unclaimed dev versions for our local generator (create-mobify-app-dev.js) to work properly. * This e2e package is meant to be private * Update CHANGELOG.md * Update package-lock.json --------- Signed-off-by: Larnelle Ankunda <lankunda@salesforce.com> Signed-off-by: Jainam Sheth <99490559+shethj@users.noreply.github.com> Signed-off-by: jeremy-jung1 <140001271+jeremy-jung1@users.noreply.github.com> Signed-off-by: Adam Raya <adamraya@users.noreply.github.com> Co-authored-by: Jang ho Jung <jangho.jung@salesforce.com> Co-authored-by: Larnelle Ankunda <lankunda@salesforce.com> Co-authored-by: jeremy-jung1 <140001271+jeremy-jung1@users.noreply.github.com> Co-authored-by: Jainam Sheth <j.sheth@salesforce.com> Co-authored-by: Jainam Sheth <99490559+shethj@users.noreply.github.com> Co-authored-by: Alex Vuong <alex.vuong@salesforce.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Joel Uong <88680517+joeluong-sfcc@users.noreply.github.com> Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> Co-authored-by: Adam Raya <adamraya@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: shauryemahajanSF <143645277+shauryemahajanSF@users.noreply.github.com> Co-authored-by: patricksullivansf <100441292+patricksullivansf@users.noreply.github.com>
1 parent 8e9268f commit abd4446

File tree

264 files changed

+47840
-17276
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+47840
-17276
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: e2e_acquire_mrt_target
2+
description: Acquire MRT Target from pool of available targets in the MRT staging org.
3+
inputs:
4+
BRANCH:
5+
description: 'GitHub branch name from workflow invoking this action'
6+
required: false
7+
RUN_ID:
8+
description: 'GitHub workflow run ID from workflow invoking this action'
9+
required: true
10+
PR_NUMBER:
11+
description: 'GitHub PR number from workflow invoking this action'
12+
required: false
13+
MAX_RETRIES:
14+
description: 'Maximum retry attempts to acquire MRT target'
15+
required: false
16+
default: '3'
17+
RETRY_DELAY:
18+
description: 'Delay between retries in milliseconds'
19+
required: false
20+
default: '10000'
21+
22+
runs:
23+
using: composite
24+
steps:
25+
- name: Acquire MRT Target
26+
id: acquire_mrt_target
27+
shell: bash
28+
run: |-
29+
set -e
30+
cmd="node e2e/scripts/mrt-target-manager.js acquire --run-id ${{inputs.RUN_ID}} --max-retries ${{inputs.MAX_RETRIES}} --retry-delay ${{inputs.RETRY_DELAY}}"
31+
if [ -n "${{inputs.PR_NUMBER}}" ]; then
32+
cmd="$cmd --pr-number ${{inputs.PR_NUMBER}}"
33+
elif [ -n "${{inputs.BRANCH}}" ]; then
34+
cmd="$cmd --branch ${{inputs.BRANCH}}"
35+
fi
36+
eval $cmd
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: e2e_release_mrt_target
2+
description: Release MRT Target back to pool of available targets in the MRT staging org.
3+
inputs:
4+
SLUG:
5+
description: 'MRT target slug'
6+
required: true
7+
MAX_RETRIES:
8+
description: 'Maximum retry attempts to release MRT target'
9+
required: false
10+
default: '3'
11+
RETRY_DELAY:
12+
description: 'Delay between retries in milliseconds'
13+
required: false
14+
default: '10000'
15+
16+
runs:
17+
using: node20 # Only 'node12', 'node16', 'node20' or 'node24' are supported.
18+
main: dist/main.js
19+
post: dist/post.js
20+
post-if: always()
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2025, Salesforce, Inc.
3+
* All rights reserved.
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6+
*/
7+
8+
/**
9+
* @file main.js
10+
* @description Arms the post-release cleanup for MRT targets in CI.
11+
*
12+
* Intentionally empty. This file just needs to exist. Post step will read INPUT_DETAILS_FILE and perform release.
13+
*
14+
* Why:
15+
* - GitHub Actions post steps execute even when a job fails or is manually cancelled,
16+
* providing best-effort cleanup of leased resources.
17+
* - Keeping the actual release in post.js avoids releasing too early while the job
18+
* is still running and centralizes all teardown logic at job end.
19+
*
20+
* See also:
21+
* - post.js (performs the actual release using the saved inputs)
22+
*/
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright (c) 2025, Salesforce, Inc.
3+
* All rights reserved.
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6+
*/
7+
8+
/**
9+
* @file post.js
10+
* @description Performs the actual release of the MRT target back to the pool of available targets in the MRT staging org.
11+
* This step is executed even when a job fails or is manually cancelled, providing best-effort cleanup of leased resources.
12+
* This step is executed after the main step in the workflow.
13+
*/
14+
const fs = require('fs')
15+
const path = require('path')
16+
const {spawnSync} = require('child_process')
17+
const config = require('../../../../e2e/config.js')
18+
19+
;(async () => {
20+
try {
21+
const workspace = process.env.GITHUB_WORKSPACE || process.cwd()
22+
const detailsFile = config.MRT_TARGET_DETAILS_FILE
23+
const absDetails = path.resolve(workspace, detailsFile)
24+
console.log(`Reading MRT target details from ${absDetails}`)
25+
if (!fs.existsSync(absDetails)) {
26+
console.log(`No details file at ${absDetails}. Skipping release.`)
27+
return
28+
}
29+
30+
const details = JSON.parse(fs.readFileSync(absDetails, 'utf8'))
31+
console.log(`Details: ${JSON.stringify(details)}`)
32+
const slug = details && details.slug
33+
if (!slug) {
34+
console.log('No slug found in details file. Skipping release.')
35+
return
36+
}
37+
38+
const cli = path.resolve(workspace, 'e2e/scripts/mrt-target-manager.js')
39+
console.log(`Releasing MRT target: ${slug}`)
40+
const res = spawnSync('node', [cli, 'release', slug], {stdio: 'inherit', cwd: workspace})
41+
42+
if (res.status !== 0) {
43+
console.log(`Release exited with status ${res.status}.`)
44+
}
45+
} catch (e) {
46+
console.log(`Release step error: ${e.message}`)
47+
}
48+
})()

.github/actions/e2e_validate_generated_app/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ runs:
1414
steps:
1515
- name: Validate generated project
1616
run: |
17+
set -e
1718
COMMAND="node e2e/scripts/validate-generated-project.js ${{ inputs.PROJECT_KEY }}"
1819
if [[ -n "${{ inputs.TEMPLATE_VERSION }}" ]]; then
1920
COMMAND="$COMMAND --templateVersion ${{ inputs.TEMPLATE_VERSION }}"
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
name: push_to_mrt
22
inputs:
3-
CWD:
4-
description: Project directory
5-
default: ${{ github.workspace }}
6-
TARGET:
7-
description: MRT target environment
8-
FLAGS:
9-
description: The rest of the flags for the push command
10-
PROJECT:
11-
description: MRT target project
12-
default: "scaffold-pwa"
13-
MESSAGE:
14-
description: Bundle message / name
15-
default: "build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})"
16-
CLOUD_ORIGIN:
17-
description: 'MRT Cloud origin'
18-
default: 'https://cloud.mobify.com'
19-
CREDENTIALS_FILE_PATH:
20-
description: 'Path to the credentials file'
21-
default: '~/.mobify'
3+
CWD:
4+
description: Project directory
5+
default: ${{ github.workspace }}
6+
TARGET:
7+
description: MRT target environment
8+
FLAGS:
9+
description: The rest of the flags for the push command
10+
PROJECT:
11+
description: MRT target project
12+
default: 'scaffold-pwa'
13+
MESSAGE:
14+
description: Bundle message / name
15+
default: 'build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})'
16+
CLOUD_ORIGIN:
17+
description: MRT Cloud origin
18+
default: 'https://cloud.mobify.com'
19+
CREDENTIALS_FILE_PATH:
20+
description: 'Path to the credentials file'
21+
default: '~/.mobify'
2222
runs:
23-
using: composite
24-
steps:
25-
- name: Push Bundle to MRT
26-
run: |-
27-
cd ${{ inputs.CWD }}
28-
if [[ ${{ inputs.TARGET }} ]]; then
29-
npm run push -- --projectSlug ${{ inputs.PROJECT }} --message "${{ inputs.MESSAGE }}" --target ${{ inputs.TARGET }} --cloud-origin ${{ inputs.CLOUD_ORIGIN }} --credentialsFile ${{ inputs.CREDENTIALS_FILE_PATH }} ${{ inputs.FLAGS }}
30-
fi
31-
shell: bash
23+
using: composite
24+
steps:
25+
- name: Push Bundle to MRT
26+
run: |-
27+
cd ${{ inputs.CWD }}
28+
if [[ ${{ inputs.TARGET }} ]]; then
29+
npm run push -- --projectSlug ${{ inputs.PROJECT }} --message "${{ inputs.MESSAGE }}" --target ${{ inputs.TARGET }} --cloud-origin ${{ inputs.CLOUD_ORIGIN }} --credentialsFile ${{ inputs.CREDENTIALS_FILE_PATH }} ${{ inputs.FLAGS }}
30+
fi
31+
shell: bash
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: update_mrt_target
2+
description: Update a MRT target environment. This endpoint automatically re-deploys the current bundle if any of the SSR-related properties are changed.
3+
inputs:
4+
PROJECT_SLUG:
5+
description: 'MRT Project slug'
6+
required: true
7+
TARGET_SLUG:
8+
description: 'MRT Target slug'
9+
required: true
10+
MOBIFY_API_KEY:
11+
description: 'Mobify API key'
12+
required: true
13+
CLOUD_ORIGIN:
14+
description: 'MRT Cloud origin'
15+
required: false
16+
default: 'https://cloud.mobify.com'
17+
MRT_TARGET_SETTINGS_FILE_PATH:
18+
description: 'Path to .env file containing MRT target environment settings'
19+
required: false
20+
MRT_TARGET_VARS_FILE_PATH:
21+
description: 'Path to .env file containing environment variables to be set on the MRT target environment'
22+
required: false
23+
24+
runs:
25+
using: composite
26+
steps:
27+
- name: Update MRT Target Settings
28+
id: update_mrt_target_settings
29+
if: ${{ inputs.MRT_TARGET_SETTINGS_FILE_PATH != '' }}
30+
shell: bash
31+
run: |-
32+
set -e
33+
34+
# Build arguments for the Node.js script
35+
ARGS=(
36+
"--project-slug" "${{ inputs.PROJECT_SLUG }}"
37+
"--target-slug" "${{ inputs.TARGET_SLUG }}"
38+
"--mobify-api-key" "${{ inputs.MOBIFY_API_KEY }}"
39+
"--cloud-origin" "${{ inputs.CLOUD_ORIGIN }}"
40+
"--env-file" "${{ inputs.MRT_TARGET_SETTINGS_FILE_PATH }}"
41+
)
42+
43+
# Run the Node.js script
44+
node e2e/scripts/update-mrt-target.js target "${ARGS[@]}"
45+
46+
- name: Update MRT Target Environment Variables
47+
id: update_mrt_target_env_vars
48+
if: ${{ inputs.MRT_TARGET_VARS_FILE_PATH != '' }}
49+
shell: bash
50+
run: |-
51+
set -e
52+
53+
# Build arguments for the Node.js script
54+
ARGS=(
55+
"--project-slug" "${{ inputs.PROJECT_SLUG }}"
56+
"--target-slug" "${{ inputs.TARGET_SLUG }}"
57+
"--mobify-api-key" "${{ inputs.MOBIFY_API_KEY }}"
58+
"--env-file" "${{ inputs.MRT_TARGET_VARS_FILE_PATH }}"
59+
"--cloud-origin" "${{ inputs.CLOUD_ORIGIN }}"
60+
)
61+
62+
# Run the Node.js script
63+
node e2e/scripts/update-mrt-target.js env-var "${ARGS[@]}"

0 commit comments

Comments
 (0)