Skip to content

Commit c05ce46

Browse files
sf-kyle-wrightvcua-mobifyshethjjeremy-jung1bendvc
authored
@W-19560496 sync feature with develop (#3257)
* Modify user not found responses from SLAS * Update MRT API secret * Remove stringify from fetch body * remove unnecessary change * Fix json formatting for payload * Handle bash escaping * Fix command * FIx args * Make the mcp server indipendent * User not found returns 200 * Handling for responses with no body * CI performance workflow: fix the deploy step (@W-19170135@) (#3091) * CI perf workflow: fix the deploy step Override the location of the .mobify credential file * More robust fix * Refactor the flags * Add whitespace * 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 * Update agent_checkout_rebase_action.yml Signed-off-by: Nishant Sethunath <nsethunath+@salesforce.com> * Update agent_checkout_rebase_action.yml Signed-off-by: Nishant Sethunath <nsethunath+@salesforce.com> * Fix how 403s are sent now that selfHandleResponse is true * Add test * Remove unused message * Changelog updates * Update translations * Remove test case that is no longer needed * Update agent_checkout_rebase_action.yml Signed-off-by: Nishant Sethunath <nsethunath+@salesforce.com> * Minor Cleanup * CI perf workflow: fix the deploy step.. take two (@W-19345469@) (#3115) * CI perf workflow: fix the deploy step Override the location of the .mobify credential file * More robust fix * Refactor the flags * Add whitespace * Update credentials * Add Slack notification * make actions description clearer * Use overwrite for env vars * Apply feedback * lint * Fix duration issue * Remove changelog from retail app * Modify changelog * Lockdown chakra-ui version to 2.6.0 * Update changelog * Pin v2.7.0 * Bump vendor bundle size * @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 * Skip deleting dwsid on login for if hybrid auth is enabled * Update changelog * Fix whitespace linting * Update implementation and add unit tests * Remove redundant tests * Update test description * Update hbs templates to include hybridAuthEnabled * CI trigger * CI trigger * 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 * @W-19265242@ Configurable base paths for /mobify routes (PWA Kit 3.12 version) (#2892) * Initial restore of base path PR * Rename path functions * Update commerce-sdk-react callbacks and slas private proxy endpoint * Big update * Replace getAppOrigin calls with useAppOrigin * WIP - Filter the base path from all incoming requests to the server * Remove base path from proxied requests + cleanup * Use functions for proxy pathRewrite * A bit of PR cleanup * Lint cleanup * More cleanup * Fix tests * Fix issues found by CI * Lint for override asset * Turn off slas private proxy * Cleanup comments * Update changelog entries * Fix config * Limit base path removal to /mobify or express route * Adjust express filter * Lint * Fix dependency in generated apps * Comment cleanup * use envBasePath as a feature toggle for enabling the base path middleware * Enable basepath removal middlware to handle express routes defined as regexes * Apply suggestions * Adjust app config template * Use pathToRegexp rather than having manual regex interpretation * escape the base path to not allow regex * refactor * Remove ?* from callback url * Handle ? characters in express route * Cache express regexes * Handle properly formatted ()? express groups * Comment cleanup * Apply suggestions to reduce use of regex * Add base path to social login redirectUri * Lint * Update comments and test * Update test with more realistic scenario * Remove path-to-regexp * Refine convertExpressRouteToRegex further * Move express route to regex logic to separate file * Adjust logger and lock file * Revert package-lock changes --------- Signed-off-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> * 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 * docs: Add missing period to JSDoc comment in page-designer utils * Pin package version for @testing-library/user-event * Set retail-react-app-test-project to be non-extensible * Update changelog * Update changelog * Generate project outside the monorepo * @W-19442561 - Fix Incorrectly Disabled Continue to Shipping Method Button for Multiship (#3199) * W-19330454 - Release PWA Kit 3.12.0-preview.2 (#3193) * bump versions and update changelogs * Add breaking label to multi-ship changelog entry * snyc to -preview.2 * 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) * Update CWD paths for generated tests * CHeck test files * [`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 * Enable e2e-PR workflow * Check retail app home * Log retail_app_home * Print MRT target json * skip browser installs * Fix retail app home * Move setting retail app home to run tests step * Remove node_modules from checks * Set retail app home to process.env not GITHUB_ENV * Enable tests * Remove logging the json * Uncomment the test run * Temp reduce retries * skip telemetry and a11y tests * Add fallback to validate script * Rewrite script to propagate errors * Fix guest shopper checkout * Fix linting * Update labels on checkout page * Restore retry * Move snapshots to slas client specific dir * Split a11y snapshots for public/private clients * Update e2e workflow a11y command * Fix button label for payment info * Fix validation script falirue * Update package lock files * Make sure that the generated-projects folder is created * @W-19349040 MULTISHIP fix form default delivery option selection (#3217) * Further refactoring * Fix count_deps action so it knows where the generated project is * Looks like on windows, we can run bash shell with front slashes * @ W-19450629 feat: remove quantity selector from shipping methods preview cart in multi-ship (#3216) * remove quantity selector from shipping methods preview cart in multi ship * update change log --------- Signed-off-by: sf-henry-semaganda <henry.semaganda@salesforce.com> * Fix non-extensible template to use correct passwordless login callback uri (#3222) * Debug validation * Debug validation * Debug validation * Remove console.logs * Flip generator response options * Update hover link test * skip failing test * Lint fix * Document test skip * Remove process.exit * Throw err * Remove debug step * Check if monorepo is a dev version before publishing to npm (#3210) * Check if monorepo is a dev version before publishing to npm * Check env.IS_DEV_VERSION * test step * test * Apply suggestion * More test * test * test * test * use if block * test * test * use quiet mode * test * test * test * test * test * test * test * Try this regex that's perhaps more compatible * Re-enable other steps and clean up verification step --------- Co-authored-by: Vincent Marta <vmarta@salesforce.com> * Fix usage for Object.hasOwn * Fix linting * update the mcp tool name and readme * Fix: Don't pass `code_challenge` if its undefined in `getPasswordResetToken` (#3228) * add fix * make code challenge optional * lint --------- Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> * resize the images * update CHANGELOG.md * @W-19364221 - Handle Removal of Last Address for Registered (#3231) * @W-19327219: Update in isolation tests in MRT reference app (#3172) * updated isolation API * updated isolation testcases * Cleanup of tool * Added tests * updated tool * Gracefully handle when some config.app.* properties are missing (@W-19453183@) (#3230) * Don't assume that config.app.* properties exist * Don't assume that config.app.* properties exist * Add todos * Use the default config for Commerce Agent when necessary * Debugging * Move utils file to somewhere more upgradable and extensible * No longer need these .hbs files * Sync the corresponding .hbs files * Fix import path * Fix require path so it can work inside monorepo * Refactor to make it easier to get commerce agent config * Fix module error Turns out that I can't mix both esm and commonjs ways. * Sync the eslint comments * Remove commented out code * Update CHANGELOG.md --------- Signed-off-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> * @W-19364130 feat: fix shipping costs summary mode pricing (#3240) * fix shipping costs sumary mode * update change log * add clear annotation * add test coverage * update basket too * update * Handle OS specific filepaths in tests * @W-19330454@ - Release PWA Kit 3.12.0-preview.3 (#3229) * bump versions and update changelogs * Add breaking label to multi-ship changelog entry * snyc to -preview.2 * @W-19442561 - Fix Incorrectly Disabled Continue to Shipping Method Button for Multiship (#3199) * @W-19443375,@W-19350149 MULTISHIP fix address function mismatch and options promotions (#3203) * @W-19451314 - Add ShipmentId to Create Shipment Body (#3211) * @W-19349040 MULTISHIP fix form default delivery option selection (#3217) * @ W-19450629 feat: remove quantity selector from shipping methods preview cart in multi-ship (#3216) * remove quantity selector from shipping methods preview cart in multi ship * update change log --------- Signed-off-by: sf-henry-semaganda <henry.semaganda@salesforce.com> * Fix non-extensible template to use correct passwordless login callback uri (#3222) * Check if monorepo is a dev version before publishing to npm (#3210) * Check if monorepo is a dev version before publishing to npm * Check env.IS_DEV_VERSION * test step * test * Apply suggestion * More test * test * test * test * use if block * test * test * use quiet mode * test * test * test * test * test * test * test * Try this regex that's perhaps more compatible * Re-enable other steps and clean up verification step --------- Co-authored-by: Vincent Marta <vmarta@salesforce.com> * Merge pull request #3204 from SalesforceCommerceCloud/bugfix/pin-testing-library-version @W-19443536 - [Bugfix] Fix unit test failures in generated projects * Fix: Don't pass `code_challenge` if its undefined in `getPasswordResetToken` (#3228) * add fix * make code challenge optional * lint --------- Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> * @W-19364221 - Handle Removal of Last Address for Registered (#3231) * Gracefully handle when some config.app.* properties are missing (@W-19453183@) (#3230) * Don't assume that config.app.* properties exist * Don't assume that config.app.* properties exist * Add todos * Use the default config for Commerce Agent when necessary * Debugging * Move utils file to somewhere more upgradable and extensible * No longer need these .hbs files * Sync the corresponding .hbs files * Fix import path * Fix require path so it can work inside monorepo * Refactor to make it easier to get commerce agent config * Fix module error Turns out that I can't mix both esm and commonjs ways. * Sync the eslint comments * Remove commented out code * Update CHANGELOG.md --------- Signed-off-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> * @W-19364130 feat: fix shipping costs summary mode pricing (#3240) * fix shipping costs sumary mode * update change log * add clear annotation * add test coverage * update basket too * update * bump versions to -preview.3 * Merge pull request #3214 from SalesforceCommerceCloud/restore-per-pr-e2e Restore e2e-PR workflow * Fix e2e-pr after incorrect merge resolution * preview.3 not preview-3 --------- Signed-off-by: sf-henry-semaganda <henry.semaganda@salesforce.com> Signed-off-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> Co-authored-by: sf-henry-semaganda <henry.semaganda@salesforce.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Jainam Sheth <99490559+shethj@users.noreply.github.com> Co-authored-by: Joel Uong <88680517+joeluong-sfcc@users.noreply.github.com> * Enable OTEL test * Bump up to final/stable versions * Update package-lock.json * Update changelog files * Sync the mcp package with develop branch * Remove this warning message (#3244) It's not as helpful because it can confuse other people and cause false alarm. One use of this function is to parse an optional environment variable. So if it is not set, it'll constantly prints out the warning message. * Bump up to the next dev versions * Update changelog files * @W-19560496 merge develop to search feature * @W-19560496 merge develop to search feature * @W-19560496 merge develop to search feature --------- Signed-off-by: Nishant Sethunath <nsethunath+@salesforce.com> Signed-off-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.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> Signed-off-by: sf-henry-semaganda <henry.semaganda@salesforce.com> Signed-off-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: vcua-mobify <vcua@salesforce.com> Co-authored-by: Jainam Sheth <j.sheth@salesforce.com> Co-authored-by: Jang ho Jung <jangho.jung@salesforce.com> Co-authored-by: Ben Chypak <bchypak@salesforce.com> Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: Nishant Sethunath <nsethunath+@salesforce.com> Co-authored-by: snilakandan <snilakandan@salesforce.com> Co-authored-by: snilakandan13 <119348013+snilakandan13@users.noreply.github.com> Co-authored-by: Jainam Sheth <99490559+shethj@users.noreply.github.com> Co-authored-by: jeremy-jung1 <140001271+jeremy-jung1@users.noreply.github.com> Co-authored-by: Larnelle Ankunda <lankunda@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: shauryemahajanSF <143645277+shauryemahajanSF@users.noreply.github.com> Co-authored-by: patricksullivansf <100441292+patricksullivansf@users.noreply.github.com> Co-authored-by: sf-xingquan-jin <xingquan.jin@salesforce.com> Co-authored-by: sf-henry-semaganda <henry.semaganda@salesforce.com> Co-authored-by: wei-liu <wei.liu@salesforce.com> Co-authored-by: Rahul Kumawat <rahulkkumawat2002@gmail.com>
1 parent 55126ad commit c05ce46

File tree

351 files changed

+49074
-16423
lines changed

Some content is hidden

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

351 files changed

+49074
-16423
lines changed

.github/actions/count_deps/action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
name: count_deps
2+
inputs:
3+
project_dir:
4+
description: 'Path to the project directory'
5+
required: true
26
runs:
37
using: composite
48
steps:
59
- name: Count Generated Project Dependencies
610
# TODO: Can TOTAL_PACKAGES be exported in a cleaner way?
711
run: |-
812
MAX_PACKAGES="2260"
9-
total=$(./scripts/count-dependencies.js generated-${{ matrix.template }})
13+
total=$(./scripts/count-dependencies.js "${{ inputs.project_dir }}")
1014
echo "TOTAL_PACKAGES=${total}" >> $GITHUB_ENV
1115
1216
if [ "$total" -gt "$MAX_PACKAGES" ]; then
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: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,21 @@ runs:
1414
steps:
1515
- name: Validate generated project
1616
run: |
17-
COMMAND="node e2e/scripts/validate-generated-project.js ${{ inputs.PROJECT_KEY }}"
17+
set -euo pipefail
18+
19+
COMMAND=(node e2e/scripts/validate-generated-project.js "${{ inputs.PROJECT_KEY }}")
20+
1821
if [[ -n "${{ inputs.TEMPLATE_VERSION }}" ]]; then
19-
COMMAND="$COMMAND --templateVersion ${{ inputs.TEMPLATE_VERSION }}"
22+
COMMAND+=(--templateVersion "${{ inputs.TEMPLATE_VERSION }}")
2023
fi
21-
$COMMAND
24+
25+
echo "Executing command: ${COMMAND[*]}"
26+
27+
if ! "${COMMAND[@]}"; then
28+
echo "❌ Node.js validation script failed with exit code $?"
29+
echo "::error::Validation of generated project failed"
30+
exit 1
31+
fi
32+
33+
echo "✅ Project validation completed successfully"
2234
shell: bash
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)