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-146001 parallelize literals call #2187

Merged
merged 8 commits into from
Apr 26, 2024
Merged

Conversation

@npeltier npeltier added run-nala Run Nala Test Automation against PR commerce needs-verification PR requires E2E testing by a reviewer labels Apr 23, 2024
@npeltier npeltier requested a review from a team as a code owner April 23, 2024 15:25
Copy link
Contributor

aem-code-sync bot commented Apr 23, 2024

Page Scores Audits Google
/?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@@ -3,7 +3,13 @@ import {
} from '../../utils/utils.js';
import { replaceKey } from '../../features/placeholders.js';

export const PRICE_LITERALS_URL = 'https://milo.adobe.com/libs/commerce/price-literals.json';
if (!window.commerce) window.commerce = {};
Copy link
Contributor

Choose a reason for hiding this comment

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

I would like to avoid introducing a namespace like window.commerce.
here the promise can be set on the fonction similar to fetchEntitlements.promise effectively becomes a module scoped data.

Copy link
Contributor

This pull request is not passing all required checks. Please see this discussion for information on how to get all checks passing. Inconsistent checks can be manually retried. If a test absolutely can not pass for a good reason, please add a comment with an explanation to the PR.

@yesil
Copy link
Contributor

yesil commented Apr 24, 2024

@npeltier, for the record, can you add the tacocat PR in the ticket description.
your changes look good, once the unit tests are fixed, it is 👍

@afmicka
Copy link
Contributor

afmicka commented Apr 24, 2024

@npeltier these changes are failing all Nala tests. Lets please connect and check the cause

@narcis-radu
Copy link
Contributor

@npeltier - I'm seeing the extra DNS calls because the price literals are served from milo.adobe.com. I think there was a similar limitation with the Global Navigation placeholders and we managed to fix it. Would you be interested in updating the code and improve performance? cc @mokimo , @overmyheadandbody , @robert-bogos , @yesil

@mokimo
Copy link
Contributor

mokimo commented Apr 24, 2024

We moved our placeholders from the milo sharepoint, to the federal one.
Instead of https://milo.adobe.com/globalnav/placeholders.json we resolve them from
https://www.adobe.com/federal/globalnav/placeholders.json (+ consuming projects, e.g. business.adobe.com/federal/globalnav/placeholders.json)

We shouldn't make any prod requests to milo.adobe.com - instead we should use the federal project as @narcis-radu mentioned

@npeltier
Copy link
Contributor Author

npeltier commented Apr 24, 2024

@mokimo @narcis-radu is there an onboarding documentation :) ? (cc @yesil )
or i just copy the document in that project?

@npeltier
Copy link
Contributor Author

i think that is it, will do a copy & update code here :)

@narcis-radu
Copy link
Contributor

@npeltier - thanks! If you're updating the path as part of this PR, please make sure to update the JIRA ticket as well. Otherwise, I can create a new ticket for you if you want to treat it as a separate enhancement.

@mokimo
Copy link
Contributor

mokimo commented Apr 24, 2024

@npeltier I created a ticket to write some docs.

TL:DR; creating something under federal/federal will just work OOTB and then be available on those origins (reference)

// TODO when porting this to milo core, we should define this on config level
// and allow consumers to add their own origins after setting up the CDN
const allowedOrigins = [
  'https://www.adobe.com',
  'https://business.adobe.com',
  'https://blog.adobe.com',
  'https://milo.adobe.com',
];

You could use any of the origins, and/or www.adobe.com as fallback - just make sure to publish the sheet so it's available on .live

Copy link
Contributor

@mokimo mokimo left a comment

Choose a reason for hiding this comment

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

Cool, awesome to see a new home for the price literals

@npeltier
Copy link
Contributor Author

@npeltier - thanks! If you're updating the path as part of this PR, please make sure to update the JIRA ticket as well. Otherwise, I can create a new ticket for you if you want to treat it as a separate enhancement.

i added it here. We still have a more "active" file i copied there too for now, i created https://jira.corp.adobe.com/browse/MWPW-147239 for that matter.

Thanks to both of you guys! i'm just a few UT fixes away now :-]

@skumar09 skumar09 added run-nala Run Nala Test Automation against PR and removed run-nala Run Nala Test Automation against PR labels Apr 24, 2024
@afmicka afmicka added verified PR has been E2E tested by a reviewer and removed needs-verification PR requires E2E testing by a reviewer labels Apr 25, 2024
@vladen vladen merged commit dac9c7e into adobecom:stage Apr 26, 2024
14 of 15 checks passed
@vladen vladen mentioned this pull request Apr 26, 2024
vhargrave pushed a commit that referenced this pull request Apr 29, 2024
* Update code owners for feds (#2194)

Co-authored-by: Blaine Gunn <Blainegunn@gmail.com>
Co-authored-by: Robert Bogos <146744221+robert-bogos@users.noreply.github.com>

* Harden preflight link checking (#2169)

* Filter out empty `hrefs` before sending to spidy.
* Harden link check to be more robust against Spidy API.
* Update link check language.
* Better onboarding support.
  * Adds fallbacks if `.milo/config` has not been added.
* Fix for missing Word doc reference, under general tab.

Resolves: [MWPW-146695](https://jira.corp.adobe.com/browse/MWPW-146695)

Co-authored-by: Ryan Clayton <rclayton@adobe.com>

* MWPW-146755: RTL merch icon padding (#2162)

* RTL padding merch icon

* dep update

* MWPW-146001 parallelize literals call (#2187)

* MWPW-146001 parallelize literals call

* MWPW-146001 move promise to the function

* MWPW-146001 fix commerce library

* MWPW-146001 update literals endpoint

* MWPW-146001 fixing commerce ut

---------

Co-authored-by: Narcis Radu <github@narcisradu.ro>
Co-authored-by: Blaine Gunn <Blainegunn@gmail.com>
Co-authored-by: Robert Bogos <146744221+robert-bogos@users.noreply.github.com>
Co-authored-by: Ryan Clayton <rgclayton@gmail.com>
Co-authored-by: Ryan Clayton <rclayton@adobe.com>
Co-authored-by: Axel Cureno Basurto <axelcureno@gmail.com>
Co-authored-by: Nicolas Peltier <1032754+npeltier@users.noreply.github.com>
Blainegunn added a commit that referenced this pull request Apr 29, 2024
* actions scroller center & section grid center

* update scroller test to cover all code branches

* update test mock to avoid nav test

* put back sticky and center styles

* [Release] Stage to Main (#2208)

* Update code owners for feds (#2194)

Co-authored-by: Blaine Gunn <Blainegunn@gmail.com>
Co-authored-by: Robert Bogos <146744221+robert-bogos@users.noreply.github.com>

* Harden preflight link checking (#2169)

* Filter out empty `hrefs` before sending to spidy.
* Harden link check to be more robust against Spidy API.
* Update link check language.
* Better onboarding support.
  * Adds fallbacks if `.milo/config` has not been added.
* Fix for missing Word doc reference, under general tab.

Resolves: [MWPW-146695](https://jira.corp.adobe.com/browse/MWPW-146695)

Co-authored-by: Ryan Clayton <rclayton@adobe.com>

* MWPW-146755: RTL merch icon padding (#2162)

* RTL padding merch icon

* dep update

* MWPW-146001 parallelize literals call (#2187)

* MWPW-146001 parallelize literals call

* MWPW-146001 move promise to the function

* MWPW-146001 fix commerce library

* MWPW-146001 update literals endpoint

* MWPW-146001 fixing commerce ut

---------

Co-authored-by: Narcis Radu <github@narcisradu.ro>
Co-authored-by: Blaine Gunn <Blainegunn@gmail.com>
Co-authored-by: Robert Bogos <146744221+robert-bogos@users.noreply.github.com>
Co-authored-by: Ryan Clayton <rgclayton@gmail.com>
Co-authored-by: Ryan Clayton <rclayton@adobe.com>
Co-authored-by: Axel Cureno Basurto <axelcureno@gmail.com>
Co-authored-by: Nicolas Peltier <1032754+npeltier@users.noreply.github.com>

---------

Co-authored-by: Ruchika Sinha <69535463+Ruchika4@users.noreply.github.com>
Co-authored-by: Narcis Radu <github@narcisradu.ro>
Co-authored-by: Blaine Gunn <Blainegunn@gmail.com>
Co-authored-by: Robert Bogos <146744221+robert-bogos@users.noreply.github.com>
Co-authored-by: Ryan Clayton <rgclayton@gmail.com>
Co-authored-by: Ryan Clayton <rclayton@adobe.com>
Co-authored-by: Axel Cureno Basurto <axelcureno@gmail.com>
Co-authored-by: Nicolas Peltier <1032754+npeltier@users.noreply.github.com>
mokimo pushed a commit to mokimo/milo that referenced this pull request Apr 30, 2024
* actions scroller center & section grid center

* update scroller test to cover all code branches

* update test mock to avoid nav test

* put back sticky and center styles

* [Release] Stage to Main (adobecom#2208)

* Update code owners for feds (adobecom#2194)

Co-authored-by: Blaine Gunn <Blainegunn@gmail.com>
Co-authored-by: Robert Bogos <146744221+robert-bogos@users.noreply.github.com>

* Harden preflight link checking (adobecom#2169)

* Filter out empty `hrefs` before sending to spidy.
* Harden link check to be more robust against Spidy API.
* Update link check language.
* Better onboarding support.
  * Adds fallbacks if `.milo/config` has not been added.
* Fix for missing Word doc reference, under general tab.

Resolves: [MWPW-146695](https://jira.corp.adobe.com/browse/MWPW-146695)

Co-authored-by: Ryan Clayton <rclayton@adobe.com>

* MWPW-146755: RTL merch icon padding (adobecom#2162)

* RTL padding merch icon

* dep update

* MWPW-146001 parallelize literals call (adobecom#2187)

* MWPW-146001 parallelize literals call

* MWPW-146001 move promise to the function

* MWPW-146001 fix commerce library

* MWPW-146001 update literals endpoint

* MWPW-146001 fixing commerce ut

---------

Co-authored-by: Narcis Radu <github@narcisradu.ro>
Co-authored-by: Blaine Gunn <Blainegunn@gmail.com>
Co-authored-by: Robert Bogos <146744221+robert-bogos@users.noreply.github.com>
Co-authored-by: Ryan Clayton <rgclayton@gmail.com>
Co-authored-by: Ryan Clayton <rclayton@adobe.com>
Co-authored-by: Axel Cureno Basurto <axelcureno@gmail.com>
Co-authored-by: Nicolas Peltier <1032754+npeltier@users.noreply.github.com>

---------

Co-authored-by: Ruchika Sinha <69535463+Ruchika4@users.noreply.github.com>
Co-authored-by: Narcis Radu <github@narcisradu.ro>
Co-authored-by: Blaine Gunn <Blainegunn@gmail.com>
Co-authored-by: Robert Bogos <146744221+robert-bogos@users.noreply.github.com>
Co-authored-by: Ryan Clayton <rgclayton@gmail.com>
Co-authored-by: Ryan Clayton <rclayton@adobe.com>
Co-authored-by: Axel Cureno Basurto <axelcureno@gmail.com>
Co-authored-by: Nicolas Peltier <1032754+npeltier@users.noreply.github.com>
mokimo pushed a commit to mokimo/milo that referenced this pull request Apr 30, 2024
* MWPW-146001 parallelize literals call

* MWPW-146001 move promise to the function

* MWPW-146001 fix commerce library

* MWPW-146001 update literals endpoint

* MWPW-146001 fixing commerce ut
mokimo pushed a commit to mokimo/milo that referenced this pull request Apr 30, 2024
* actions scroller center & section grid center

* update scroller test to cover all code branches

* update test mock to avoid nav test

* put back sticky and center styles

* [Release] Stage to Main (adobecom#2208)

* Update code owners for feds (adobecom#2194)

Co-authored-by: Blaine Gunn <Blainegunn@gmail.com>
Co-authored-by: Robert Bogos <146744221+robert-bogos@users.noreply.github.com>

* Harden preflight link checking (adobecom#2169)

* Filter out empty `hrefs` before sending to spidy.
* Harden link check to be more robust against Spidy API.
* Update link check language.
* Better onboarding support.
  * Adds fallbacks if `.milo/config` has not been added.
* Fix for missing Word doc reference, under general tab.

Resolves: [MWPW-146695](https://jira.corp.adobe.com/browse/MWPW-146695)

Co-authored-by: Ryan Clayton <rclayton@adobe.com>

* MWPW-146755: RTL merch icon padding (adobecom#2162)

* RTL padding merch icon

* dep update

* MWPW-146001 parallelize literals call (adobecom#2187)

* MWPW-146001 parallelize literals call

* MWPW-146001 move promise to the function

* MWPW-146001 fix commerce library

* MWPW-146001 update literals endpoint

* MWPW-146001 fixing commerce ut

---------

Co-authored-by: Narcis Radu <github@narcisradu.ro>
Co-authored-by: Blaine Gunn <Blainegunn@gmail.com>
Co-authored-by: Robert Bogos <146744221+robert-bogos@users.noreply.github.com>
Co-authored-by: Ryan Clayton <rgclayton@gmail.com>
Co-authored-by: Ryan Clayton <rclayton@adobe.com>
Co-authored-by: Axel Cureno Basurto <axelcureno@gmail.com>
Co-authored-by: Nicolas Peltier <1032754+npeltier@users.noreply.github.com>

---------

Co-authored-by: Ruchika Sinha <69535463+Ruchika4@users.noreply.github.com>
Co-authored-by: Narcis Radu <github@narcisradu.ro>
Co-authored-by: Blaine Gunn <Blainegunn@gmail.com>
Co-authored-by: Robert Bogos <146744221+robert-bogos@users.noreply.github.com>
Co-authored-by: Ryan Clayton <rgclayton@gmail.com>
Co-authored-by: Ryan Clayton <rclayton@adobe.com>
Co-authored-by: Axel Cureno Basurto <axelcureno@gmail.com>
Co-authored-by: Nicolas Peltier <1032754+npeltier@users.noreply.github.com>
mokimo pushed a commit to mokimo/milo that referenced this pull request Apr 30, 2024
* actions scroller center & section grid center

* update scroller test to cover all code branches

* update test mock to avoid nav test

* put back sticky and center styles

* [Release] Stage to Main (adobecom#2208)

* Update code owners for feds (adobecom#2194)

Co-authored-by: Blaine Gunn <Blainegunn@gmail.com>
Co-authored-by: Robert Bogos <146744221+robert-bogos@users.noreply.github.com>

* Harden preflight link checking (adobecom#2169)

* Filter out empty `hrefs` before sending to spidy.
* Harden link check to be more robust against Spidy API.
* Update link check language.
* Better onboarding support.
  * Adds fallbacks if `.milo/config` has not been added.
* Fix for missing Word doc reference, under general tab.

Resolves: [MWPW-146695](https://jira.corp.adobe.com/browse/MWPW-146695)

Co-authored-by: Ryan Clayton <rclayton@adobe.com>

* MWPW-146755: RTL merch icon padding (adobecom#2162)

* RTL padding merch icon

* dep update

* MWPW-146001 parallelize literals call (adobecom#2187)

* MWPW-146001 parallelize literals call

* MWPW-146001 move promise to the function

* MWPW-146001 fix commerce library

* MWPW-146001 update literals endpoint

* MWPW-146001 fixing commerce ut

---------

Co-authored-by: Narcis Radu <github@narcisradu.ro>
Co-authored-by: Blaine Gunn <Blainegunn@gmail.com>
Co-authored-by: Robert Bogos <146744221+robert-bogos@users.noreply.github.com>
Co-authored-by: Ryan Clayton <rgclayton@gmail.com>
Co-authored-by: Ryan Clayton <rclayton@adobe.com>
Co-authored-by: Axel Cureno Basurto <axelcureno@gmail.com>
Co-authored-by: Nicolas Peltier <1032754+npeltier@users.noreply.github.com>

---------

Co-authored-by: Ruchika Sinha <69535463+Ruchika4@users.noreply.github.com>
Co-authored-by: Narcis Radu <github@narcisradu.ro>
Co-authored-by: Blaine Gunn <Blainegunn@gmail.com>
Co-authored-by: Robert Bogos <146744221+robert-bogos@users.noreply.github.com>
Co-authored-by: Ryan Clayton <rgclayton@gmail.com>
Co-authored-by: Ryan Clayton <rclayton@adobe.com>
Co-authored-by: Axel Cureno Basurto <axelcureno@gmail.com>
Co-authored-by: Nicolas Peltier <1032754+npeltier@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commerce Ready for Stage run-nala Run Nala Test Automation against PR verified PR has been E2E tested by a reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants