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-115484 Token definitions API and implementation #111

Closed
wants to merge 10 commits into from

Conversation

izaera
Copy link
Collaborator

@izaera izaera commented Jul 14, 2020

This PR defines the initial token definitions API and implementation. We will iterate on this PR to refine the API and maybe provide more functionality.

Initially we sent brianchandotcom#91176 to Brian, but he made some objections which led to a full rework of the PR.

The main reasons to rework the PR were:

  1. In the previous PR we assumed that every theme is deployed in a single OSGi bundle but this is something that, even if it is usually true, it is not mandatory given the Portal architecture.
  2. In the previous PR we didn't map from themeId to Bundle, thus it was incorrect.
  3. Brian asked to rename token-definition.json to theme-token-definition.json, something which is incorrect because we may define tokens for things that are not themes.

So, after reviewing the three points we came up with a model where token definitions are associated to OSGi Bundles alone, not related to themes yet (this PR).

In the future we may provide tools to map from themes to OSGi bundles. Even if the existence of a bundle that contains the theme is not enforced by the portal we can define it as a requisite if you want to use token definitions and nothing would break/become inconsistent.

Also, the current API just lists all available token definitions, but doesn't let you query by any criteria. We may add more methods to the TokenDefinitionRegistry service in the future to query token definitions as needed.


This PR doesn't modify anything in the UI nor does it execute any code (because nobody uses TokenDefinitionRegistry yet). However, I have provided units tests to cover almost all production code.

In addition, once we add the token-definition.json file in classic-theme, I will test it manually to make sure it runs in production too.

@liferay-continuous-integration
Copy link
Collaborator

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.

@izaera izaera marked this pull request as draft July 14, 2020 11:49
@izaera
Copy link
Collaborator Author

izaera commented Jul 14, 2020

Converting to draft so that we don't forward it without the Classic's token-definition.json file.

@izaera
Copy link
Collaborator Author

izaera commented Jul 14, 2020

ci:test:sf

@izaera
Copy link
Collaborator Author

izaera commented Jul 14, 2020

ci:test:relevant

@liferay-continuous-integration
Copy link
Collaborator

❌ ci:test:sf - 0 out of 1 jobs passed in 3 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 76f17290c7dd17e02dbd73c3babb438de273a272

Sender Branch:

Branch Name: LPS-115484
Branch GIT ID: a8873fe9ba2a1812f8c9380aebc34f68f89af7ea

0 out of 1jobs PASSED
For more details click here.
     [java] java.lang.Exception: Found 1 formatting issues:
     [java] 1: ./build.properties expected:<...eme,\
     [java]     #    apps/[frontend-token,\
     [java]     #    apps/]gogo-shell,\
     [java]     #  ...> but was:<...eme,\
     [java]     #    apps/[]gogo-shell,\
     [java]     #  ...>
     [java] 
     [java] 	at com.liferay.source.formatter.SourceFormatter.format(SourceFormatter.java:448)
     [java] 	at com.liferay.source.formatter.SourceFormatter.main(SourceFormatter.java:269)
[stopwatch] [run.batch.test.action: 1:09.691 sec]
     [echo] The following error occurred while executing this line:
     [echo] /opt/dev/projects/github/liferay-portal/portal-impl/build.xml:694: Java returned: 1
      [get] Getting: http://test-1-3/job/test-portal-source-format/4191//consoleText
      [get] To: /opt/dev/projects/github/liferay-portal/20200714045401793.txt
   [delete] Deleting: /opt/dev/projects/github/liferay-portal/20200714045401793.txt
  [typedef] Could not load definitions from resource org/apache/maven/artifact/ant/antlib.xml. It could not be found.
  [taskdef] Could not load definitions from resource org/jacoco/ant/antlib.xml. It could not be found.
   [delete] Deleting: /opt/dev/projects/github/liferay-portal/null204327890.properties

merge-test-results:
[mkdir] Created dir: /opt/dev/projects/github/liferay-portal/test-results
[junitreport] Processing /opt/dev/projects/github/liferay-portal/test-results/TESTS-TestSuites.xml to /tmp/null1662882026
[junitreport] Loading stylesheet jar:file:/opt/java/ant/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Transform time: 1077ms
[junitreport] Deleting: /tmp/null1662882026
[echo] A report with all the test results can be found at test-results/html/index.html.
[mkdir] Created dir: /opt/dev/projects/github/liferay-jenkins-ee/test-results
[copy] Copying 1 file to /opt/dev/projects/github/liferay-jenkins-ee/test-results
[echo] run.batch.test.tear.down.start.timestamp: 07-14-2020 04:54:07:500 PDT
[stopwatch] [run.batch.test.tear.down: 0.000 sec]
[echo]
[echo] Ant GC log:
[echo]
[echo] Java HotSpot(TM) 64-Bit Server VM (25.121-b13) for linux-amd64 JRE (1.8.0_121-b13), built on Dec 12 2016 16:36:53 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)
[echo] Memory: 4k page, physical 32902104k(2521424k free), swap 0k(0k free)

@izaera
Copy link
Collaborator Author

izaera commented Jul 14, 2020

I don't know why the SF failed... 🤷

@liferay-continuous-integration
Copy link
Collaborator

Jenkins Build:test-portal-source-format#4191
Jenkins Report:jenkins-report.html
Jenkins Suite: sf
Pull Request:liferay-frontend#111
Spira Release:/Liferay DXP 7.3/Pull Request/ci:test:sf
Spira Release Build:master - izaera > liferay-frontend - PR#111
Spira Jenkins Build:publish-spira-report#597

@liferay-continuous-integration
Copy link
Collaborator

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

✔️ ci:test:relevant - 44 out of 44 jobs passed in 1 hour 26 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 76f17290c7dd17e02dbd73c3babb438de273a272

Copied in Private Modules Branch:

Branch Name: master-private
Branch GIT ID: 2d61577aa6a76425e17132e68f5aa901f720a686

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

@izaera
Copy link
Collaborator Author

izaera commented Jul 14, 2020

ci:test:sf

@liferay-continuous-integration
Copy link
Collaborator

❌ ci:test:sf - 0 out of 1 jobs passed in 3 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 76f17290c7dd17e02dbd73c3babb438de273a272

Sender Branch:

Branch Name: LPS-115484
Branch GIT ID: a8873fe9ba2a1812f8c9380aebc34f68f89af7ea

0 out of 1jobs PASSED
For more details click here.
     [java] java.lang.Exception: Found 1 formatting issues:
     [java] 1: ./build.properties expected:<...eme,\
     [java]     #    apps/[frontend-token,\
     [java]     #    apps/]gogo-shell,\
     [java]     #  ...> but was:<...eme,\
     [java]     #    apps/[]gogo-shell,\
     [java]     #  ...>
     [java] 
     [java] 	at com.liferay.source.formatter.SourceFormatter.format(SourceFormatter.java:448)
     [java] 	at com.liferay.source.formatter.SourceFormatter.main(SourceFormatter.java:269)
[stopwatch] [run.batch.test.action: 1:09.454 sec]
     [echo] The following error occurred while executing this line:
     [echo] /opt/dev/projects/github/liferay-portal/portal-impl/build.xml:694: Java returned: 1
      [get] Getting: http://test-1-3/job/test-portal-source-format/4195//consoleText
      [get] To: /opt/dev/projects/github/liferay-portal/20200714063934955.txt
   [delete] Deleting: /opt/dev/projects/github/liferay-portal/20200714063934955.txt
  [typedef] Could not load definitions from resource org/apache/maven/artifact/ant/antlib.xml. It could not be found.
  [taskdef] Could not load definitions from resource org/jacoco/ant/antlib.xml. It could not be found.
   [delete] Deleting: /opt/dev/projects/github/liferay-portal/null1736125689.properties

merge-test-results:
[mkdir] Created dir: /opt/dev/projects/github/liferay-portal/test-results
[junitreport] Processing /opt/dev/projects/github/liferay-portal/test-results/TESTS-TestSuites.xml to /tmp/null49153550
[junitreport] Loading stylesheet jar:file:/opt/java/ant/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Transform time: 194ms
[junitreport] Deleting: /tmp/null49153550
[echo] A report with all the test results can be found at test-results/html/index.html.
[mkdir] Created dir: /opt/dev/projects/github/liferay-jenkins-ee/test-results
[copy] Copying 1 file to /opt/dev/projects/github/liferay-jenkins-ee/test-results
[echo] run.batch.test.tear.down.start.timestamp: 07-14-2020 06:39:39:400 PDT
[stopwatch] [run.batch.test.tear.down: 0.000 sec]
[echo]
[echo] Ant GC log:
[echo]
[echo] Java HotSpot(TM) 64-Bit Server VM (25.121-b13) for linux-amd64 JRE (1.8.0_121-b13), built on Dec 12 2016 16:36:53 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)
[echo] Memory: 4k page, physical 32902104k(411188k free), swap 0k(0k free)

@jbalsas
Copy link

jbalsas commented Jul 14, 2020

I don't know why the SF failed... 🤷

You better figure it out then 😂

@liferay-continuous-integration
Copy link
Collaborator

✔️ 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: 76f17290c7dd17e02dbd73c3babb438de273a272

Sender Branch:

Branch Name: LPS-115484
Branch GIT ID: 22a8281702d74493785158383631f9a351e322b3

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

@liferay-continuous-integration
Copy link
Collaborator

Jenkins Build:test-portal-source-format#3942
Jenkins Report:jenkins-report.html
Jenkins Suite: sf
Pull Request:liferay-frontend#111
Spira Release:/Liferay DXP 7.3/Pull Request/ci:test:sf
Spira Release Build:master - izaera > liferay-frontend - PR#111
Spira Jenkins Build:publish-spira-report#727

@liferay-continuous-integration
Copy link
Collaborator

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

✔️ ci:test:relevant - 46 out of 46 jobs passed in 1 hour 17 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: e67026449a8a6dae28fc7a7da27e3ff6a3f780b6

Copied in Private Modules Branch:

Branch Name: master-private
Branch GIT ID: 2d61577aa6a76425e17132e68f5aa901f720a686

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

@liferay-continuous-integration
Copy link
Collaborator

All required test suite(s) passed.
Forwarding pullrequest to brianchandotcom.

@liferay-continuous-integration
Copy link
Collaborator

Pull request has been successfully forwarded to brianchandotcom#91387

@liferay-continuous-integration
Copy link
Collaborator

@liferay-continuous-integration
Copy link
Collaborator

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

✔️ ci:test:relevant - 46 out of 46 jobs passed in 1 hour 12 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: e67026449a8a6dae28fc7a7da27e3ff6a3f780b6

Copied in Private Modules Branch:

Branch Name: master-private
Branch GIT ID: 2d61577aa6a76425e17132e68f5aa901f720a686

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

@liferay-continuous-integration
Copy link
Collaborator

All required test suite(s) passed.
Forwarding pullrequest to brianchandotcom.

@liferay-continuous-integration
Copy link
Collaborator

Closed pull request will not be forwarded.

@liferay-continuous-integration
Copy link
Collaborator

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