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-142290: Reverting Libs Stage Updates #175

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ export const [setLibs, getLibs] = (() => {
(prodLibs, location) => {
libs = (() => {
const { hostname, search } = location || window.location;
const branch = new URLSearchParams(search).get('milolibs') || 'main';
if (branch === 'main' && hostname === 'business.stage.adobe.com') return 'https://www.stage.adobe.com/libs';
if (!(hostname.includes('.hlx.') || hostname.includes('local'))) return prodLibs;
const branch = new URLSearchParams(search).get('milolibs') || 'main';
if (branch === 'local') return 'http://localhost:6456/libs';
return branch.includes('--') ? `https://${branch}.hlx.live/libs` : `https://${branch}--milo--adobecom.hlx.live/libs`;
})();
Expand Down
18 changes: 0 additions & 18 deletions test/scripts/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,6 @@ describe('Libs', () => {
expect(libs).to.equal('https://foo--milo--adobecom.hlx.live/libs');
});

it('Supports milo stage libs with stage as host', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

adding a it.skip with a comment might be useful here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean to say to keep these tests and just skip for now or? I don't think they are needed, and the functionality that is expected already gets covered.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Going to merge this, as the stage code in our set libs is more important to remove. I can add an issue to add test skips if you think that is pertinent @Brandon32.

const location = {
hostname: 'business.stage.adobe.com',
search: '',
};
const libs = setLibs('/libs', location);
expect(libs).to.equal('https://www.stage.adobe.com/libs');
});

it('Does not support milo stage libs on non prod stage hosts', () => {
const location = {
hostname: 'stage--bacom--adobecom.hlx.live',
search: '',
};
const libs = setLibs('/libs', location);
expect(libs).to.equal('https://main--milo--adobecom.hlx.live/libs');
});

it('Supports local milolibs query param', () => {
const location = {
hostname: 'localhost',
Expand Down
Loading