MWPW-190616: UI follow-up for grouped variation translation#740
MWPW-190616: UI follow-up for grouped variation translation#740mirafedas wants to merge 36 commits into
Conversation
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
Commits
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #740 +/- ##
==========================================
+ Coverage 87.58% 87.62% +0.04%
==========================================
Files 216 217 +1
Lines 64177 64387 +210
==========================================
+ Hits 56208 56419 +211
+ Misses 7969 7968 -1
... and 8 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
…tion references Adds a new Adobe I/O Runtime action that scans all non-en_US fragments and removes variation references that are invalid — either wrong language or out-of-region — using cursor-based folder listing and PUT for the variations field (required due to live relationships). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…try handling - 21 tests covering getValidVariationsLocales, dryRun detection, live PUT writes, 429 retry backoff, 404 skip, folder listing errors, and scope filtering - Reduce batch concurrency from 10 to 3 to avoid rate limiting - Add exponential backoff retry (up to 3x) on 429 responses for both folder listing and individual fragment fetches Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ove localeFromPath to common - Extract 315-line inlined locale data to io/studio/src/locales.json (importable by CJS and ESM) - Move localeFromPath and export PATH_TOKENS from common.js (removes duplicate regex) - Fix Prettier violations in index.test.js and cleanup-variations/index.js Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| return { statusCode: 500, body: { error: 'Missing odinEndpoint configuration' } }; | ||
| } | ||
|
|
||
| const { surface: targetSurface, locale: targetLocale, dryRun = true } = params; |
There was a problem hiding this comment.
SSRF risk — odinEndpoint should come from config, not the request body
Every other action in io/studio gets odinEndpoint from $ODIN_ENDPOINT injected via app.config.yaml inputs. Accepting it from the POST body lets any authenticated caller point this action at an arbitrary AEM host.
Fix: add to app.config.yaml under cleanup-variations:
inputs:
LOG_LEVEL: debug
odinEndpoint: $ODIN_ENDPOINTThe value arrives in params.odinEndpoint the same way — no read-side change needed — but the caller can no longer override it.
Axelcureno
left a comment
There was a problem hiding this comment.
Two blockers (SSRF + unnecessary export) and one nit — see inline comments already posted.
Axelcureno
left a comment
There was a problem hiding this comment.
Both blockers resolved (SSRF + PATH_TOKENS). The console.warn is minor — ship it.
npeltier
left a comment
There was a problem hiding this comment.
sorry Myra, but we shouldn't add io changes (esp. of that magnitude) together with other changes. Can you eventually track what looks like an improvement in a separate ticket, and leave that one with only UI changes?
Resolves https://jira.corp.adobe.com/browse/MWPW-190616
AC 1:
These changes are covered with unit and Nala tests.
AC 2: variations render properly, so no changes made.
AC 3: added a script to remove the invalid variations (occurring when we translate an en_US fragment with variations to other languages - the translated copy preserves the en_US variations from the en_US original fragment, which are useless).
QA Checklist: https://wiki.corp.adobe.com/display/adobedotcom/M@S+Engineering+QA+Use+Cases
Please do the steps below before submitting your PR for a code review or QA
🧪 Nala E2E Tests
Nala tests run automatically when you open this PR.
To run Nala tests again:
run nalalabel to this PR (in the right sidebar)To stop automatic Nala tests:
run nalalabelTest URLs:
To test the variations removal script in dry run for one locale and one surface, run the following command in the terminal, replacing the
eyJ....wwith your IMS token:If the surface is not specified, it will run the script on all surfaces, and if the locale is not specified - will run for all locales.