Skip to content

MWPW-190616: UI follow-up for grouped variation translation#740

Open
mirafedas wants to merge 36 commits into
mainfrom
mwpw-190616
Open

MWPW-190616: UI follow-up for grouped variation translation#740
mirafedas wants to merge 36 commits into
mainfrom
mwpw-190616

Conversation

@mirafedas
Copy link
Copy Markdown
Contributor

@mirafedas mirafedas commented Apr 3, 2026

Resolves https://jira.corp.adobe.com/browse/MWPW-190616

AC 1:

  1. Fixed dropdown chevron direction
  2. Removed grey connector lines
  3. Enabled checking the checkbox by row double-click
  4. Grouped variations now show the offer ID. If the offer ID is not set on the variation, the parent offer ID is displayed.
    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

  • C1. Cover code with Unit Tests
  • C2. Add a Nala test (double check with #fishbags if nala test is needed)
  • C3. Verify all Checks are green (unit tests, nala tests)
  • C4. PR description contains working Test Page link where the feature can be tested
  • C5: you are ready to do a demo from Test Page in PR (bonus: write a working demo script that you'll use on Thursday, you can eventually put in your PR)
  • C.6 read your Jira one more time to validate that you've addressed all AC's and nothing is missing

🧪 Nala E2E Tests

Nala tests run automatically when you open this PR.

To run Nala tests again:

  1. Add the run nala label to this PR (in the right sidebar)
  2. Tests will run automatically on the current commit
  3. Any future commits will also trigger tests as long as the label remains

To stop automatic Nala tests:

  • Remove the run nala label

Note: Tests only run on commits if the run nala label is present. Add the label whenever you need tests to run on new changes.

Test 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....w with your IMS token:

curl -s -X POST "https://14257-masstudio-mirafedas.adobeioruntime.net/api/v1/web/MerchAtScaleStudio/cleanup-variations" \
  -H "Authorization: Bearer eyJ....w" \
  -H "Content-Type: application/json" \
  -d '{"odinEndpoint": "https://author-p22655-e155390.adobeaemcloud.com", "surface": "acom", "locale": "de_DE", "dryRun": true}'

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.

@aem-code-sync
Copy link
Copy Markdown

aem-code-sync Bot commented Apr 3, 2026

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

  • Re-sync branch
Commits

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 3, 2026

Codecov Report

❌ Patch coverage is 97.49304% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.62%. Comparing base (8546301) to head (3bc96e7).

Files with missing lines Patch % Lines
io/studio/src/cleanup-variations/index.js 97.11% 7 Missing ⚠️
studio/src/translation/translation-items-loader.js 97.80% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Files with missing lines Coverage Δ
io/studio/src/common.js 92.32% <100.00%> (+0.09%) ⬆️
...o/src/translation/mas-collapsible-table-row.css.js 100.00% <100.00%> (ø)
...tudio/src/translation/mas-collapsible-table-row.js 94.48% <100.00%> (-0.55%) ⬇️
studio/src/translation/translation-items-loader.js 92.79% <97.80%> (+0.37%) ⬆️
io/studio/src/cleanup-variations/index.js 97.11% <97.11%> (ø)

... and 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8546301...3bc96e7. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

mirafedas and others added 4 commits April 20, 2026 13:22
…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;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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_ENDPOINT

The value arrives in params.odinEndpoint the same way — no read-side change needed — but the caller can no longer override it.

Comment thread io/studio/src/common.js
Copy link
Copy Markdown
Member

@Axelcureno Axelcureno left a comment

Choose a reason for hiding this comment

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

Two blockers (SSRF + unnecessary export) and one nit — see inline comments already posted.

@mirafedas mirafedas requested a review from Axelcureno May 1, 2026 14:39
Copy link
Copy Markdown
Member

@Axelcureno Axelcureno left a comment

Choose a reason for hiding this comment

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

Both blockers resolved (SSRF + PATH_TOKENS). The console.warn is minor — ship it.

Copy link
Copy Markdown
Contributor

@npeltier npeltier left a comment

Choose a reason for hiding this comment

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

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?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants