MWPW-194951 Add auto-detect Lingo to CaaS bulk publisher#6142
MWPW-194951 Add auto-detect Lingo to CaaS bulk publisher#6142sheridansunier wants to merge 10 commits into
Conversation
|
Test mock regionalSites format doesn't match live data (utils.test.js, bulk-publish-to-caas.test.js) Live data uses leading slashes and spaces: |
|
Via: Claude I think these three items are worth consideringThe No fetch caching Tri-state return ( Some of these might be intentional or a non-issue, but worth evaluating:Four origins in Four Most non- |
Rename isLingoEnglishRegionalSite → isLingoLangFirstPath with corrected logic (positive assertion: locale is in lingo mapping AND not an English regional site). Restructure getCountryAndLang to route bulk-publisher requests through getBulkPublishLangAttr first, add IETF fallback for language-code URL prefixes, and apply per-URL LFL detection in processData for bacom repos. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add explicit opt-in checkbox (next to Dry Run) that queries the prod lingo-site-mapping to determine Language First per URL automatically. Removes the hard-coded bacom-only gate; the mapping is now the sole source of truth for all hosts. isLingoLangFirstPath returns null when an origin is absent from the mapping (unboarded data stream), which triggers non-LFL fallback when auto-detect is on. news always defers to the manual Language First checkbox regardless of auto-detect state. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…atrix isLingoLangFirstPath: 5 tests covering null (origin absent), true (LFL baseSite and regional), false (English regional), false (fetch failure). getBulkPublishLangAttr: 5 tests covering all four matrix rows — auto-detect off respects manual checkbox, news always uses manual checkbox, origin in mapping overrides languageFirst=false, origin not in mapping forces non-LFL even when languageFirst=true. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… remove duplicate mapping call Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ading slash, spaces) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… format Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…auto opacity style Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3eb460a to
aaa4287
Compare
|
This PR has not been updated recently and will be closed in 7 days if no action is taken. Please ensure all checks are passing, https://github.com/orgs/adobecom/discussions/997 provides instructions. If the PR is ready to be merged, please mark it with the "Ready for Stage" label. |
Summary
lingo-site-mapping.jsonto determine Language First Localization automatically rather than relying on the manual Language First checkbox.isLingoLangFirstPathinutils.jsto returntrue/false/null(null = origin not yet in the prod mapping), allowing safe handling of data streams that are staged but not yet onboarded to lingo.bacom-only gate; any origin present in the prod mapping is now handled automatically.newsis special-cased to always defer to the manual checkbox, since it operates outside the lingo mapping.Jira Ticket
MWPW-194951
Auto-detect behavior matrix
languageFirstcheckbox valuenewslanguageFirstcheckbox valuetrue/false)null)false(non-LFL)Key points:
newsnever touchesisLingoLangFirstPath— it always defers to the manual checkbox.lingo-site-mapping.json(e.g. a new data stream being staged before prod onboarding), the tool defaults to non-LFL rather than silently misidentifying the locale.languageFirstcheckbox remains fully functional as the primary control when auto-detect is off.Test plan
test/tools/send-to-caas/bulk-publish-to-caas.test.js)isLingoLangFirstPathreturn shapes:null(unknown origin),true(LFL baseSite/regional),false(English regional),false(fetch error) (test/blocks/caas/utils.test.js)/de/page → verify LFL lang/country in CaaSnewsURL with auto-detect on → verify manual Language First checkbox controls the result🤖 Generated with Claude Code