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

LPS-131777 call getStaticResourceUrl to get timestamp and perform correct redeploys to cdn's #101514

Conversation

liferay-continuous-integration
Copy link
Collaborator

Forwarded from: liferay-frontend#1028 (Took 1 ci:forward attempt in 3 hours 15 minutes)
Console

@jgarcialr
@liferay-frontend

Original pull request comment:
Hello Frontend Team,

Description of the issue:

When you use <@liferay.js file_name> or <@liferay.css file_name> macros, those imports doesn't have a timestamp.

This is causing that when you redeploy the theme, files imported with those macros, doesn't always show latest version and causes problems with some cdn's (pex dxp-cloud cdn)

Things I've tried.

Created a new theme.

Inside portal-normal.ftl import two different js files with the macro and with other mechanism provided by liferay.

  1. Using the macro:
    <@liferay.js file_name="${javascript_folder}/unav/unav72.js"/>

  2. Using portalUtil.getStaticResourceURL

<#if themeDisplay??>
 <#assign
 fundraising_carousel = htmlUtil.escape(portalUtil.getStaticResourceURL(request, "${themeDisplay.getPathThemeJavaScript()}/unav/fundraising_carousel.js"))>
 <script src="${fundraising_carousel}" type="text/javascript"></script>

For the first case, a <script tag is created. src attribute, contains the filename, without any parameters.
For the second case, the source of the script tag has a timestamp and browserId parameters.

Test plan

Deploy [my-liferay-theme](https://issues.liferay.com/secure/attachment/404645/my-liferay-theme.war) inside a portal bundle
Create a new Site Site1
Set my-liferay-theme as theme for this site
Navigate to Site Builder > Pages
Created a new Content Page
Publish the page
Navigate to the page you just published
In network panel, just second request has parameters (fundraising_carousel.js) request has parameters.

After applying this change both requests have parameters and those parameters are updated with each redeployment of the theme

✔️ ci:test:stable - 9 out of 9 jobs passed

✔️ ci:test:relevant - 21 out of 22 jobs passed in 2 hours 24 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: d57c657bd5e4815bae43c722ab39cfee7b6caac0

Upstream Comparison:

Branch GIT ID: 14a0d4956e9427b920e405c091588977e891b02d
Jenkins Build URL: Acceptance Upstream DXP (master) #1841

ci:test:stable - 9 out of 9 jobs PASSED
9 Successful Jobs:
ci:test:relevant - 20 out of 22 jobs PASSED
20 Successful Jobs:
For more details click here.

This pull contains no unique failures.


Failures in common with acceptance upstream results at 14a0d49:
  1. test-portal-acceptance-pullrequest-batch(master)/lpkg-base-jdk8/0
    Job Results:

    2 Tests Passed.
    3 Tests Failed.

    1. AXIS_VARIABLE=0,label_exp=!master #384690
      1. com.liferay.portal.log.assertor.PortalLogAssertorTest.testScanOSGiLog
        junit.framework.AssertionFailedError: 
        Portal log assert failure, OSGi log found: /opt/dev/projects/github/liferay-portal/bundles/osgi/state/1620382243840.log:
        !SESSION 2021-05-07 10:11:01.300 -----------------------------------------------
        eclipse.buildId=unknown
        java.version=1.8.0_121
        java.vendor=Oracle Corporation
        BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
        

        !ENTRY com.liferay.portal.vulcan.impl 4 0 2021-05-07 10:11:01.300
        !MESSAGE FrameworkEvent ERROR
        !STACK 0
        org.osgi.framework.BundleException: Could not resolve module: com.liferay.portal.vulcan.impl [90]
        Unresolved requirement: Import-Package: com.liferay.object.model; version="[1.0.0,2.0.0)"

        at org.eclipse.osgi.container.Module.start(Module.java:444)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1682)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1662)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1624)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1555)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
        at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
        

        !ENTRY com.liferay.click.to.ch...

      2. com.liferay.portal.log.assertor.PortalLogAssertorTest.testScanXMLLog
        junit.framework.AssertionFailedError:
        FrameworkEvent ERROR
        org.osgi.framework.BundleException: Could not resolve module: com.liferay.portal.vulcan.impl [90]
        Unresolved requirement: Import-Package: com.liferay.object.model; version="[1.0.0,2.0.0)"

        at org.eclipse.osgi.container.Module.start(Module.java:444)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1682)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1662)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1624)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1555)
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
        at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
        
        at com.liferay.portal.log.assertor.PortalLogAssertorTest.scanXMLLogFile(PortalLogAssertorTest.java:171)
        at com.liferay.portal.log.assertor.PortalLogAssertorTest$1.visitFile(PortalLogAssertorTest.java:98)
        at com.liferay.portal.log.assertor.PortalLogAssertorTest$1.visitFile(PortalLogAssertorTest.java:88)
        at java.nio.file.Files.walkFileTree(Files.java:2670)
        at java.nio.file.Files.walkFileTree(Files.java:2742)
        at com.liferay.portal.log.assertor.Porta...</code></pre></div></li><li><div><a href="https://test-1-9.liferay.com/job/test-portal-acceptance-pullrequest-batch(master)/AXIS_VARIABLE=0,label_exp=!master/384690//testReport/com.liferay.poshi.runner/PoshiRunner/test_LocalFile_PortalSmoke_Smoke_">LocalFile.PortalSmoke#Smoke</a> - <a href="https://testray.liferay.com/reports/production/logs/2021-05/test-1-15/test-portal-acceptance-pullrequest(master)/4301/lpkg-base-jdk8/0/0/LocalFile.PortalSmoke_Smoke/index.html.gz">Poshi Report</a> - <a href="https://testray.liferay.com/reports/production/logs/2021-05/test-1-15/test-portal-acceptance-pullrequest(master)/4301/lpkg-base-jdk8/0/0/LocalFile.PortalSmoke_Smoke/summary.html.gz">Poshi Summary</a> - <a href="https://testray.liferay.com/reports/production/logs/2021-05/test-1-15/test-portal-acceptance-pullrequest(master)/4301/lpkg-base-jdk8/0/0/jenkins-console.txt.gz">Console Output</a></div></li></ol></div></li></ol></div></li></ol></details></details></html><h5>Test bundle downloads:</h5><ul><li><a href="https://files.liferay.com/private/bundles/test-1-15/jobs/test-portal-acceptance-pullrequest(master)/builds/4301/liferay-portal-bundle-tomcat.tar.gz">liferay-portal-bundle-tomcat.tar.gz</a> (mirrors: <a href="http://mirrors.dlc.liferay.com/files.liferay.com/private/bundles/test-1-15/jobs/test-portal-acceptance-pullrequest(master)/builds/4301/liferay-portal-bundle-tomcat.tar.gz">dlc</a>, <a href="http://mirrors.lax.liferay.com/files.liferay.com/private/bundles/test-1-15/jobs/test-portal-acceptance-pullrequest(master)/builds/4301/liferay-portal-bundle-tomcat.tar.gz">lax</a>)</li></ul>
        

        :heavy_check_mark: ci:test:sf - 1 out of 1 jobs passed in 8 minutes

        Click here for more details.

        Base Branch:

        Branch Name: master
        Branch GIT ID: d57c657bd5e4815bae43c722ab39cfee7b6caac0

        Sender Branch:

        Branch Name: LPS-131777
        Branch GIT ID: bebb9e57cf8aa38b47f975312cf4aef4a96de6cc

        1 out of 1jobs PASSED
        1 Successful Jobs:
        For more details click here.

@liferay-continuous-integration
Copy link
Collaborator Author

To conserve resources, the PR Tester does not automatically run for forwarded pull requests.

@brianchandotcom
Copy link
Owner

Merged. Thank you.
View total diff: 76ecbb4...d6ee131

@liferay-continuous-integration liferay-continuous-integration deleted the ci-forward-LPS-131777-pr-1028-sender-jgarcialr-ts-1620383608579 branch May 15, 2021 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants