Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MWPW-136766, MWPW-136143: Milo not supporting sending to CaaS all locales & Autodetect not working #1324

Merged
merged 8 commits into from
Oct 17, 2023

Conversation

sanrai
Copy link
Contributor

@sanrai sanrai commented Sep 21, 2023

This PR fixes issues with both the send to caas button and the bulk publisher as well as all the autodetect.

When using the send to caas button, the following locales were mapped incorrectly and would send the wrong data to CaaS.

ae_ar, ae_en, africa, cr, ec, eg_ar, el, gr_el, gt, id_en, id_id, il_he, in_hi, kw_ar, mena_ar, mena_en, my_ms, ph_en, qa_ar, sa_ar, sa_en, th_en, th_th, vn_vi

For example: this page, https://milo.adobe.com/qa_ar/drafts/sanrai/mwpw-136065, it'll return the wrong value, ar, which then sends the wrong lang/country combination to CaaS (ar_US instead of ar_QA)

This is because the API the code was previously using, document.documentElement.lang was incorrect.

Here is it failing for my_ms:
image

See this bug for more information:
https://jira.corp.adobe.com/browse/MWPW-136832

When trying sending content from the following set of locales

cr, ec, el, gt, pr, langstore, eg_ar, eg_en, gr_el, il_he, kw_ar, kw_en, ng, qa_ar, qa_en, za

to CaaS using the bulk publisher (or the Send to CaaS button), because these locales were undefined, these locales would wrongly be sent into en_US to CaaS.

Here is an example of it failing for qa_ar:
image

See https://jira.corp.adobe.com/browse/MWPW-136766 for more information on the latter issue.

Resolves:
https://jira.corp.adobe.com/browse/MWPW-136766,
https://jira.corp.adobe.com/browse/MWPW-136832

Test URLs:

When using autoDetect (where Milo dynamically tries to figure out the correct country/lang to send to CaaS) it turns out it fails for every locale for CaaS.

The idea for this was to prevent authors from having to manually author the country/lang for every collection.

But the way this currently works in production is either:

image
  • For ones that aren't manually set, autoDetect sends a nonsense lang. Luckily CaaS's backend is able to a generate some search results for this BUT it gives us undefined behavior like a mix of English and translated content
image

The way this is fixed is I added a map in the caas block with all the milo regions as keys and their values being the actual correct locales that should be sent to CaaS.

This map:

  • Is in sync with the one milo uses AND also maps to every locale that is used when someone sends to CaaS
  • Is only loaded when a CaaS block is loaded on the page. I was originally going to put it in scripts.js but realized that would load unnecessary data for pages that aren't using CaaS.

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

Test URLs:

@aem-code-sync
Copy link
Contributor

aem-code-sync bot commented Sep 21, 2023

Hello, I'm Franklin Bot and I will run some test suites that validate the page speed.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-run PSI Checks

@sanrai sanrai added the do not merge PR should not be merged yet label Sep 21, 2023
@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Merging #1324 (8eeac91) into main (b22e933) will decrease coverage by 1.00%.
The diff coverage is 96.15%.

@@            Coverage Diff             @@
##             main    #1324      +/-   ##
==========================================
- Coverage   96.32%   95.32%   -1.00%     
==========================================
  Files         144      145       +1     
  Lines       34414    35055     +641     
==========================================
+ Hits        33148    33415     +267     
- Misses       1266     1640     +374     
Files Coverage Δ
libs/blocks/caas/utils.js 95.33% <100.00%> (-0.60%) ⬇️
tools/send-to-caas/send-utils.js 41.66% <94.44%> (ø)

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sanrai sanrai changed the title MWPW-136143: Adds all missing locales MWPW-136766: Adds all missing locales Sep 21, 2023
@sanrai sanrai changed the title MWPW-136766: Adds all missing locales MWPW-136766: Milo not supporting sending to caas all locales Sep 21, 2023
Copy link
Contributor

@overmyheadandbody overmyheadandbody left a comment

Choose a reason for hiding this comment

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

Same PR pollution comment 🙂

@sanrai sanrai added the needs-verification PR requires E2E testing by a reviewer label Sep 21, 2023
mena_en: { ietf: 'en-mena' },
mena_ar: { ietf: 'ar-mena' },
mena_fr: { ietf: 'fr-mena' },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deleted as mena_fr isn't supported when rolled out and to keep parity with the 93 values supported by Milo's getLocale() api

@aem-code-sync
Copy link
Contributor

aem-code-sync bot commented Sep 22, 2023

Page Scores Audits Google
/drafts/sanrai/ Lighthouse returned error: ERRORED_DOCUMENT_REQUEST. Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 404) PSI
/drafts/sanrai/testing-bulk-publish?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@aem-code-sync
Copy link
Contributor

aem-code-sync bot commented Sep 22, 2023

Page Scores Audits Google
/drafts/sanrai/testing-bulk-publish?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@aem-code-sync
Copy link
Contributor

aem-code-sync bot commented Sep 22, 2023

Page Scores Audits Google
/drafts/sanrai/testing-bulk-publish?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@sanrai sanrai removed the do not merge PR should not be merged yet label Sep 22, 2023
@aem-code-sync
Copy link
Contributor

aem-code-sync bot commented Sep 23, 2023

Page Scores Audits Google
/drafts/sanrai/testing-bulk-publish?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@aem-code-sync
Copy link
Contributor

aem-code-sync bot commented Sep 23, 2023

Page Scores Audits Google
/drafts/sanrai/testing-bulk-publish?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@sanrai sanrai changed the title MWPW-136766: Milo not supporting sending to caas all locales MWPW-136766, MWPW-136143: Milo not supporting sending to caas all locales & Sep 23, 2023
@sanrai sanrai changed the title MWPW-136766, MWPW-136143: Milo not supporting sending to caas all locales & MWPW-136766, MWPW-136143: Milo not supporting sending to caas all locales & Autodetect not working, Milo not sending correct lang to CaaS Sep 23, 2023
@sanrai sanrai changed the title MWPW-136766, MWPW-136143: Milo not supporting sending to caas all locales & Autodetect not working, Milo not sending correct lang to CaaS MWPW-136766, MWPW-136143: Milo not supporting sending to caas all locales & Autodetect not working Sep 23, 2023
@sanrai sanrai changed the title MWPW-136766, MWPW-136143: Milo not supporting sending to caas all locales & Autodetect not working MWPW-136766, MWPW-136143: Milo not supporting sending to CaaS all locales & Autodetect not working Sep 23, 2023
@aem-code-sync
Copy link
Contributor

aem-code-sync bot commented Oct 17, 2023

Hello, I'm the AEM Code Sync Bot and I will run some test suites that validate the page speed.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-run PSI Checks

@aem-code-sync
Copy link
Contributor

aem-code-sync bot commented Oct 17, 2023

Page Scores Audits Google
/drafts/sanrai/testing-bulk-publish?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@sanrai sanrai added verified PR has been E2E tested by a reviewer and removed needs-verification PR requires E2E testing by a reviewer labels Oct 17, 2023
@sanrai sanrai merged commit ef0d26a into main Oct 17, 2023
@sanrai sanrai deleted the MWPW-136143-2 branch October 17, 2023 21:40
sanrai added a commit that referenced this pull request Oct 17, 2023
… all locales & Autodetect not working (#1324)"

This reverts commit ef0d26a.
auniverseaway pushed a commit that referenced this pull request Oct 17, 2023
#1427)

Revert "MWPW-136766, MWPW-136143: Milo not supporting sending to CaaS all locales & Autodetect not working (#1324)"

This reverts commit ef0d26a.
sanrai added a commit that referenced this pull request Oct 17, 2023
…ales & Autodetect not working (#1324)

* Adds all missing locales

* Update to more correct locales after thorough testing

* Missing one locale

* More updates

* Removing unused mena fields

* Fixing locale issues with send to caas button

* Taking changes from PR:1323 and merging into here (as requested)
sanrai added a commit that referenced this pull request Oct 18, 2023
… all locales & Autodetect not working (#1324)"

This reverts commit ef0d26a.
suhjainadobe pushed a commit to suhjainadobe/milo that referenced this pull request Oct 21, 2023
…ales & Autodetect not working (adobecom#1324)

* Adds all missing locales

* Update to more correct locales after thorough testing

* Missing one locale

* More updates

* Removing unused mena fields

* Fixing locale issues with send to caas button

* Taking changes from PR:1323 and merging into here (as requested)
suhjainadobe pushed a commit to suhjainadobe/milo that referenced this pull request Oct 21, 2023
adobecom#1427)

Revert "MWPW-136766, MWPW-136143: Milo not supporting sending to CaaS all locales & Autodetect not working (adobecom#1324)"

This reverts commit ef0d26a.
Axelcureno pushed a commit to Axelcureno/milo that referenced this pull request Oct 25, 2023
…ales & Autodetect not working (adobecom#1324)

* Adds all missing locales

* Update to more correct locales after thorough testing

* Missing one locale

* More updates

* Removing unused mena fields

* Fixing locale issues with send to caas button

* Taking changes from PR:1323 and merging into here (as requested)
Axelcureno pushed a commit to Axelcureno/milo that referenced this pull request Oct 25, 2023
adobecom#1427)

Revert "MWPW-136766, MWPW-136143: Milo not supporting sending to CaaS all locales & Autodetect not working (adobecom#1324)"

This reverts commit ef0d26a.
sanrai added a commit that referenced this pull request Oct 27, 2023
…ales & Autodetect not working (#1428)

* MWPW-136766, MWPW-136143: Milo not supporting sending to CaaS all locales & Autodetect not working (#1324)

* Adds all missing locales

* Update to more correct locales after thorough testing

* Missing one locale

* More updates

* Removing unused mena fields

* Fixing locale issues with send to caas button

* Taking changes from PR:1323 and merging into here (as requested)

* Making local copy of Locales

* Update libs/blocks/caas/utils.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Importing in tools from libs since that should be allowed

* Revert "Importing in tools from libs since that should be allowed"

This reverts commit 5565692.

* Second attempt at refactoring

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Axelcureno pushed a commit to Axelcureno/milo that referenced this pull request Oct 31, 2023
…ales & Autodetect not working (adobecom#1428)

* MWPW-136766, MWPW-136143: Milo not supporting sending to CaaS all locales & Autodetect not working (adobecom#1324)

* Adds all missing locales

* Update to more correct locales after thorough testing

* Missing one locale

* More updates

* Removing unused mena fields

* Fixing locale issues with send to caas button

* Taking changes from PR:1323 and merging into here (as requested)

* Making local copy of Locales

* Update libs/blocks/caas/utils.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Importing in tools from libs since that should be allowed

* Revert "Importing in tools from libs since that should be allowed"

This reverts commit 5565692.

* Second attempt at refactoring

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
vgoodric pushed a commit to vgoodric/bootcamp-milo that referenced this pull request Feb 1, 2024
…ales & Autodetect not working (adobecom#1324)

* Adds all missing locales

* Update to more correct locales after thorough testing

* Missing one locale

* More updates

* Removing unused mena fields

* Fixing locale issues with send to caas button

* Taking changes from PR:1323 and merging into here (as requested)
vgoodric pushed a commit to vgoodric/bootcamp-milo that referenced this pull request Feb 1, 2024
adobecom#1427)

Revert "MWPW-136766, MWPW-136143: Milo not supporting sending to CaaS all locales & Autodetect not working (adobecom#1324)"

This reverts commit ef0d26a.
vgoodric pushed a commit to vgoodric/bootcamp-milo that referenced this pull request Feb 1, 2024
…ales & Autodetect not working (adobecom#1428)

* MWPW-136766, MWPW-136143: Milo not supporting sending to CaaS all locales & Autodetect not working (adobecom#1324)

* Adds all missing locales

* Update to more correct locales after thorough testing

* Missing one locale

* More updates

* Removing unused mena fields

* Fixing locale issues with send to caas button

* Taking changes from PR:1323 and merging into here (as requested)

* Making local copy of Locales

* Update libs/blocks/caas/utils.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Importing in tools from libs since that should be allowed

* Revert "Importing in tools from libs since that should be allowed"

This reverts commit 5565692.

* Second attempt at refactoring

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
verified PR has been E2E tested by a reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants