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-146104 Avoid setting static and final fields on extended entities #1860

Closed

Conversation

javierdearcos
Copy link

There are some problems serializing extended entities, that is, entities that extend existing DTOs adding some new fields. An example is the Structured Content return by the Headless Admin Content API.

Steps to reproduce the issue:

  1. Create some web contents and update one of them to update the version
  2. Make a request to the get structured-contents endpoint of the Headless Admin Content API to get the structured contents. You can execute the following curl command replacing the siteId with your siteId:
curl -u 'test@liferay.com:test' http://localhost:8080/o/headless-admin-content/v1.0/sites/\siteId/structured-contents -v

Expected result: The list of structured contents
Result: Internal server error response

The issue was caused by the addition of a new static final field on the DTOs in the generated code to escape the serialized JSON. More information in the ticket

The issue is solved by avoiding setting the static and final fields on extended entities.

@javierdearcos javierdearcos added the s-headless Pull requests to be reviewed by the headless squad label Jan 25, 2022
@liferay-continuous-integration
Copy link
Collaborator

CI is automatically triggering the following test suites:

  •     ci:test:relevant
  •     ci:test:sf

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:sf - 1 out of 1 jobs passed in 4 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: b9d5e3887421e2cd39eebd7194935bbbb5f453f3

Sender Branch:

Branch Name: LPS-146104
Branch GIT ID: 2314021e5bc0211d4d1975c543103195f45c0d7b

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

@liferay-continuous-integration
Copy link
Collaborator

Copy link

@LuismiBarcos LuismiBarcos left a comment

Choose a reason for hiding this comment

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

LGTM :) Nice improvement 🙂

@LuismiBarcos
Copy link

ci:forward

@liferay-continuous-integration
Copy link
Collaborator

CI is automatically triggering the following test suites:

  •     ci:test:relevant
  •     ci:test:sf

The pull request will automatically be forwarded to the user brianchandotcom if the following test suites pass:

  •     ci:test:relevant
  •     ci:test:sf
  •     ci:test:stable

@liferay-continuous-integration
Copy link
Collaborator

Skipping previously passed test suites:
ci:test:sf

@liferay-continuous-integration
Copy link
Collaborator

❌ ci:test:stable - 0 out of 23 jobs passed

❌ ci:test:relevant - 0 out of 25 jobs passed in 4 hours 59 minutes

Click here for more details.

This pull is eligible for reevaluation. When this upstream build has completed, using the following CI command will compare this pull request result against a more recent upstream result:

ci:reevaluate:1357401_598

Base Branch:

Branch Name: master
Branch GIT ID: 219db2050eff89cea827da6dc2cfa6e897c4c0df

Upstream Comparison:

Branch GIT ID: b9d5e3887421e2cd39eebd7194935bbbb5f453f3
Jenkins Build URL: Acceptance Upstream DXP (master) #2850

ci:test:stable - 0 out of 23 jobs PASSED

23 Failed Jobs:

ci:test:relevant - 0 out of 25 jobs PASSED

25 Failed Jobs:

For more details click here.

Failures unique to this pull:

  1. test-portal-acceptance-pullrequest-batch(master)/central-requirements-jdk8/0
    Job Results:

    0 Tests Passed.
    0 Tests Failed.

    Build was aborted
  2. test-portal-acceptance-pullrequest-batch(master)/empty-osgi-core-dir-jdk8/0
    Job Results:

    0 Tests Passed.
    0 Tests Failed.

    Build was aborted
  3. test-portal-acceptance-pullrequest-batch(master)/empty-temp-dir-jdk8/0
    Job Results:

    0 Tests Passed.
    0 Tests Failed.

    Build was aborted
  4. ...

For upstream results, click here.

Test bundle downloads:

@liferay-continuous-integration
Copy link
Collaborator

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:stable - 22 out of 23 jobs passed

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

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: b9d5e3887421e2cd39eebd7194935bbbb5f453f3

Upstream Comparison:

Branch GIT ID: b9d5e3887421e2cd39eebd7194935bbbb5f453f3
Jenkins Build URL: Acceptance Upstream DXP (master) #2850

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

This pull contains no unique failures.


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

    3 Tests Passed.
    2 Tests Failed.

    1. AXIS_VARIABLE=0 #238931
      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/1643168626621.log:
        !SESSION 2022-01-26 03:44:11.412 -----------------------------------------------
        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.site.initializer.extender 4 0 2022-01-26 03:44:11.412
        !MESSAGE FrameworkEvent ERROR
        !STACK 0
        org.osgi.framework.BundleException: Could not resolve module: com.liferay.site.initializer.extender [1281]
        Unresolved requirement: Import-Package: com.liferay.commerce.account.util; version="1.3.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.life...

      2. com.liferay.portal.log.assertor.PortalLogAssertorTest.testScanXMLLog
        junit.framework.AssertionFailedError:
        FrameworkEvent ERROR
        org.osgi.framework.BundleException: Could not resolve module: com.liferay.site.initializer.extender [1281]
        Unresolved requirement: Import-Package: com.liferay.commerce.account.util; version="1.3.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.asse...

Test bundle downloads:

@liferay-continuous-integration
Copy link
Collaborator

@LuismiBarcos
Copy link

ci:forward

@liferay-continuous-integration
Copy link
Collaborator

CI is automatically triggering the following test suites:

  •     ci:test:relevant
  •     ci:test:sf

The pull request will automatically be forwarded to the user brianchandotcom if the following test suites pass:

  •     ci:test:relevant
  •     ci:test:sf
  •     ci:test:stable

@liferay-continuous-integration
Copy link
Collaborator

Skipping previously passed test suites:
ci:test:relevant
ci:test:sf

@liferay-continuous-integration
Copy link
Collaborator

All required test suite(s) passed.
Forwarding pull request to brianchandotcom.
Console

@liferay-continuous-integration
Copy link
Collaborator

Pull request has been successfully forwarded to brianchandotcom#112646
Console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants