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

[TS] LPS-155811 Incorrect assets shown for collections when combined segments enabled and user belongs to segments without personalized variations #2532

Closed

Conversation

ricardocousolr
Copy link

Hi @liferay-tango!

This is a solution to LPS-155811 as agreed in PTR-3103.

In master the only issue to fix is making sure that we return the array [0] when none of the segments the user belongs to have an associated personalized variation.

(For older versions it will be necessary to backport the filtering by Objects::nonNull to discard particular segments without personalized variations.)

As explained in the LPS-155811, this issue can only be tested (in master) for manual collections, because for dynamic collections it's masked by another problem. Nevertheless, the fix in this pr should work for both collection types.

Please let me know if you have any questions.

Thanks!

@liferay-continuous-integration

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

If your code changes were already tested in another pull, reference that pull in this pull so the test results can be analyzed.

If your pull was never tested, comment "ci:test" to run the PR Tester for this pull.

@ricardocousolr
Copy link
Author

Hi @liferay-tango,

Please let me know if you need further information to move this pr along.

Thanks!

@liferay-tango
Copy link
Owner

ci:test:sf

@liferay-tango
Copy link
Owner

ci:test:relevant

@liferay-tango
Copy link
Owner

ci:test:tango

@liferay-continuous-integration

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

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 3b33e0a69dbd6e3502bbe0dd7a11e4946ee84b52

Sender Branch:

Branch Name: LPS-155811
Branch GIT ID: d48984f216c54c25742e6d936aea9c62d00f01fb

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

@liferay-continuous-integration

@liferay-continuous-integration

❌ ci:test:tango - 161 out of 174 jobs passed in 3 hours

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:127null_3653

Base Branch:

Branch Name: master
Branch GIT ID: 3b33e0a69dbd6e3502bbe0dd7a11e4946ee84b52

Upstream Comparison:

Branch GIT ID: 0db712ca5b7d8828d3db40f3921fd12c368af4f3
Jenkins Build URL: Acceptance Upstream DXP (master) #3404

ci:test:tango - 161 out of 174 jobs PASSED
161 Successful Jobs:
For more details click here.

Failures unique to this pull:

  1. functional-tomcat90-mysql57-jdk8/0/3
    stop-docker-containers:
         [exec] Stopping container [ID: '5617d02babcd', name: 'test-1-32-3.lax.liferay.com_mysql']'
         [exec] test-1-32-3.lax.liferay.com_mysql
         [exec] test-1-32-3.lax.liferay.com_mysql
       [delete] Deleting: /opt/dev/projects/github/liferay-portal/docker_stop.sh
    [stopwatch] [run.batch.test.action: 18:49.148 sec]
         [echo] 
          [get] Getting: http://test-1-32/job/test-portal-acceptance-pullrequest-downstream(master)/64288//consoleText
          [get] To: /opt/dev/projects/github/liferay-portal/20220615031235587.txt
       [delete] Deleting: /opt/dev/projects/github/liferay-portal/20220615031235587.txt
       [delete] Deleting: /opt/dev/projects/github/liferay-portal/null1401056695.properties
  2. functional-tomcat90-mysql57-jdk8/6/10
        at hudson.FilePath.act(FilePath.java:1159)
        at org.jenkinsci.plugins.envinject.service.EnvironmentVariablesNodeLoader.gatherEnvVarsForNode(EnvironmentVariablesNodeLoader.java:64)
        at org.jenkinsci.plugins.envinject.EnvInjectListener.loadEnvironmentVariablesNode(EnvInjectListener.java:80)
        at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironment(EnvInjectListener.java:44)
        at hudson.model.AbstractBuild\$AbstractBuildExecution.createLauncher(AbstractBuild.java:542)
        at hudson.model.AbstractBuild\$AbstractBuildExecution.run(AbstractBuild.java:462)
        at hudson.model.Run.execute(Run.java:1816)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:97)
        at hudson.model.Executor.run(Executor.java:429)
    Caused: hudson.remoting.RequestAbortedException
      at hudson.remoting.Request.abort(Request.java:340)
      at hudson.remoting.Channel.terminate(Channel.java:1040)
      at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer.onReadClosed(ChannelApplicationLayer.java:209)
      at org.jenkinsci.remoting.protocol.ApplicationLayer.onRecvClosed(ApplicationLayer.java:222)
      at org.jenkinsci.remoting.protocol.ProtocolStack\$Ptr.onRecvClosed(ProtocolStack.java:816)
      at org.jenkinsci.remoting.protocol.FilterLayer.onRecvClosed(FilterLayer.java:287)
      at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.onRecvClosed(SSLEngineFilterLayer.java:172)
      at org.jenkinsci.remoting.protocol.ProtocolStack\$Ptr.onRecvClosed(ProtocolStack.java:816)
      at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
      at org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:179)
      at org.jenkinsci.remoting.protocol.IOHub\$OnReady.run(IOHub.java:795)
      at jenkins.util.ContextResettingExecutorService\$1.run(ContextResettingExecutorService.java:28)
      at jenkins.security.ImpersonatingExecutorService\$1.run(ImpersonatingExecutorService.java:59)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor\$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
    ERROR: Step ???Publish JUnit test result report??? failed: no workspace for test-portal-acceptance-pullrequest-downstream(master) #60498
    ERROR: Build step failed with exception
    java.lang.NullPointerException
    Build step 'Execute Scripts' marked build as failure
    Finished: FAILURE
  3. ...

@liferay-continuous-integration

@liferay-continuous-integration

✔️ ci:test:stable - 26 out of 27 jobs passed

✔️ ci:test:relevant - 123 out of 130 jobs passed in 3 hours 21 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 3b33e0a69dbd6e3502bbe0dd7a11e4946ee84b52

Upstream Comparison:

Branch GIT ID: d8ad49e8b7f162a4882b5054b9ea4ddcae3289db
Jenkins Build URL: Acceptance Upstream DXP (master) #3405

ci:test:stable - 26 out of 27 jobs PASSED

1 Failed Jobs:

26 Successful Jobs:
ci:test:relevant - 122 out of 130 jobs PASSED
122 Successful Jobs:
For more details click here.

This pull contains no unique failures.


Failures in common with acceptance upstream results at d8ad49e:
  1. modules-integration-mysql57-jdk8/0/2
    1. com.liferay.asset.publisher.util.test.AssetPublisherHelperTest.testGetAssetEntries
      java.lang.NullPointerException
        at com.liferay.asset.publisher.util.test.AssetPublisherHelperTest.testGetAssetEntries(AssetPublisherHelperTest.java:355)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable$3.evaluate(TestExecutorRunnable.java:353)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
        at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
        at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
        at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
        at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
        at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
        at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
        at org.junit.rules.RunRules.evaluate(RunRules.java:20)
        at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable$1.evaluate(TestExecutorRunnable.java:237)
        at org.junit.inter...
    2. com.liferay.asset.publisher.web.internal.display.context.test.AssetPublisherDisplayContextTest.testGetAssetEntries
      java.lang.NullPointerException
        at com.liferay.asset.publisher.web.internal.display.context.test.AssetPublisherDisplayContextTest.testGetAssetEntries(AssetPublisherDisplayContextTest.java:122)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable$3.evaluate(TestExecutorRunnable.java:353)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
        at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
        at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
        at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
        at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
        at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
        at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
        at org.junit.rules.RunRules.evaluate(RunRules.java:20)
        at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable$1.evaluate(TestExecut...
    3. com.liferay.portal.log.assertor.PortalLogAssertorTest.testScanXMLLog
      junit.framework.AssertionFailedError: 
      Unable to register portal instance {"mvccVersion": 1, "companyId": 20098, "userId": 0, "userName": "", "createDate": "Wed Jun 15 10:07:55 GMT 2022", "modifiedDate": "Wed Jun 15 10:07:55 GMT 2022", "webId": "liferay.com", "mx": "liferay.com", "homeURL": "", "logoId": 0, "system": false, "maxUsers": 0, "active": true, "name": "Liferay", "legalName": "", "legalId": "", "legalType": "", "sicCode": "", "tickerSymbol": "", "industry": "", "type": "", "size": ""}
      com.liferay.portal.kernel.repository.UndeployedExternalRepositoryException: Unable to load external repository class com.liferay.portal.repository.liferayrepository.LiferayRepository because its plugin is not deployed
        at com.liferay.portal.repository.RepositoryFactoryImpl.getRepositoryFactory(RepositoryFactoryImpl.java:72)
        at com.liferay.portal.repository.RepositoryFactoryImpl.createLocalRepository(RepositoryFactoryImpl.java:39)
        at com.liferay.portal.repository.RepositoryProviderImpl.getLocalRepository(RepositoryProviderImpl.java:268)
        at com.liferay.portlet.documentlibrary.service.impl.DLAppLocalServiceImpl.getLocalRepository(DLAppLocalServiceImpl.java:1487)
        at com.liferay.portlet.documentlibrary.service.impl.DLAppLocalServiceImpl.fetchFileEntryByExternalReferenceCode(DLAppLocalServiceImpl.java:572)
        at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66)
        at com.sun.proxy.$Proxy925.fetchFileEntryByExternalReferenceCode(Unknown Source)
        a...
  2. modules-integration-mysql57-jdk8/0/12
    1. com.liferay.portal.log.assertor.PortalLogAssertorTest.testScanXMLLog
      junit.framework.AssertionFailedError: 
      null
      com.liferay.document.library.kernel.exception.NoSuchFileException: {companyId=20098, repositoryId=47536, fileName=420, cause=java.io.FileNotFoundException: /opt/dev/projects/github/liferay-portal/bundles/data/document_library/20098/47536/420/1.0 (No such file or directory)}
        at com.liferay.portal.store.file.system.FileSystemStore.getFileAsStream(FileSystemStore.java:140)
        at com.liferay.portal.store.file.system.safe.file.name.SafeFileNameStore.getFileAsStream(SafeFileNameStore.java:93)
        at com.liferay.change.tracking.store.internal.CTStore.getFileAsStream(CTStore.java:139)
        at com.liferay.portlet.documentlibrary.store.DLStoreImpl.getFileAsStream(DLStoreImpl.java:373)
        at com.liferay.document.library.kernel.store.DLStoreUtil.getFileAsStream(DLStoreUtil.java:339)
        at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.getFileAsStream(DLFileEntryLocalServiceImpl.java:1130)
        at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.getFileAsStream(DLFileEntryLocalServiceImpl.java:1105)
        at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66)
        at com.sun.proxy.$Proxy961.getFileAsStream(Unknown Source)
        at com.liferay.document.library.kernel.service.DLFileEntryLocalServiceWrapper.getFileAsStream(DLFileEntryLocalServiceWrapper.java:675)
        at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66)
        at com.sun.proxy.$...
  3. modules-integration-mysql57-jdk8/0/15
    1. com.liferay.portal.log.assertor.PortalLogAssertorTest.testScanXMLLog
      junit.framework.AssertionFailedError: 
      null
      com.liferay.portal.kernel.exception.PortalException: Unable to search with filter ((customField/_43226_nwXPIUpO eq 'NqHi5lxg')) and (classPK eq '20126')
        at com.liferay.segments.internal.odata.search.ODataSearchAdapterImpl.searchCount(ODataSearchAdapterImpl.java:109)
        at com.liferay.segments.internal.odata.retriever.UserODataRetriever.getResultsCount(UserODataRetriever.java:69)
        at com.liferay.segments.internal.provider.BaseSegmentsEntryProvider.isMember(BaseSegmentsEntryProvider.java:293)
        at com.liferay.segments.internal.provider.BaseSegmentsEntryProvider.lambda$getSegmentsEntryIds$2(BaseSegmentsEntryProvider.java:160)
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:545)
        at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
        at java.util.stream.LongPipeline.toArray(LongPipeline.java:484)
        at com.liferay.segments.internal.provider.BaseSegmentsEntryProvider.getSegmentsEntryIds(BaseSegmentsEntryProvider.java:164)
        at com.liferay.segments.internal.provider.SegmentsEntryProviderRegistryImpl.getS...
  4. modules-integration-mysql57-jdk8/0/16
    1. com.liferay.portal.log.assertor.PortalLogAssertorTest.testScanXMLLog
      junit.framework.AssertionFailedError: 
      null
        at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:178)
        at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:2484)
        at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:2461)
        at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:2184)
        at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:2137)
        at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:2105)
        at org.elasticsearch.client.RestHighLevelClient.search(RestHighLevelClient.java:1367)
        at com.liferay.portal.search.elasticsearch7.internal.search.engine.adapter.search.SearchSearchRequestExecutorImpl.getSearchResponse(SearchSearchRequestExecutorImpl.java:95)
        at com.liferay.portal.search.elasticsearch7.internal.search.engine.adapter.search.SearchSearchRequestExecutorImpl.execute(SearchSearchRequestExecutorImpl.java:66)
        at com.liferay.portal.search.elasticsearch7.internal.search.engine.adapter.search.ElasticsearchSearchRequestExecutor.executeSearchRequest(ElasticsearchSearchRequestExecutor.java:59)
        at com.liferay.portal.search.engine.adapter.search.SearchSearchRequest.accept(SearchSearchRequest.java:45)
        at com.liferay.portal.search.engine.adapter.search.SearchSearchRequest.accept(SearchSearchRequest.java:34)
        at com.liferay.portal.search.elasti...
  5. ...

@liferay-continuous-integration

@ricardocousolr
Copy link
Author

Hi @liferay-tango,

Is it necessary to launch the tango tests again since some have failed?

@cgoncas
Copy link
Collaborator

cgoncas commented Jun 16, 2022

Hey @ricardocousolr !!

The errors look unrelated, I am going to forward this PR.

Thanks!!

@cgoncas
Copy link
Collaborator

cgoncas commented Jun 16, 2022

ci:forward

@liferay-continuous-integration

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

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

@liferay-continuous-integration

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

@liferay-continuous-integration

Pull request has been successfully forwarded to brianchandotcom#118981
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.

4 participants