-
Notifications
You must be signed in to change notification settings - Fork 101
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
feat: Packaged Executable #1125
Conversation
…uava ClassPath. Guava's ClassPath scanning has issues when run against Java Modules and its own source code advises you to use ClassGraph instead: https://github.com/google/guava/blob/master/guava/src/com/google/common/reflect/ClassPath.java This change will better support running the validator as a Java Module in a packaged runtime. modified: core/build.gradle modified: core/src/main/java/org/mobilitydata/gtfsvalidator/notice/NoticeSchemaGenerator.java modified: core/src/main/java/org/mobilitydata/gtfsvalidator/table/GtfsFeedLoader.java modified: core/src/main/java/org/mobilitydata/gtfsvalidator/validator/ValidatorLoader.java
…tive application on Windows and Mac OS. Right now, it's just a simple wrapper around the CLI app.
|
@bdferris FYI, we recently implemented the acceptance tests that runs this validator on all the datasets we have on the Mobility Database and flags if we had previously valid datasets that become invalid with the PR. |
I believe I have a workaround for #1094 that I'll comment on shortly. |
After #1102 is merged and then the main branch is merged into this PR, then the acceptance tests should pass. |
…nsole, for easier debugging when running the app in non command-line mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bdferris-v2, this looks good!
Some thoughts in-line.
app/gui/src/main/java/org/mobilitydata/gtfsvalidator/app/gui/Main.java
Outdated
Show resolved
Hide resolved
app/gui/src/main/java/org/mobilitydata/gtfsvalidator/app/gui/Main.java
Outdated
Show resolved
Hide resolved
Also, looks like the Javadoc generation GitHub Action is failing:
|
@barbeau the aggregate javadoc issue is actually slightly tricky. Javadoc generation appears to get tripped up for the :app:pkg sub-project because of the previously discussed tricks I used to get Java Modules working (shadow jar wrapped as a single module). Specifically, Javadoc appears to be adding the the shadow jar its classpath along with all the other project dependencies, which is causing a bunch of duplicate class warnings. There seem to be two options for fixing this:
The trick with option # 2 is that we are using the As an alternative, there are newer Gradle plugins that support javadoc aggregation. Specifically, I just tried the aggregateJavadocs => aggregateJavadoc (the s is dropped) So I'd need to update the workflow as well. I wanted to get a thumbs up from someone before I swapped out the plugin, in case anyone has any concerns. |
I noticed the Netflix plugin hadn't been updated in a while too, so I'm 👍 for changing to io.freefair.aggregate-javadoc-jar. |
Specifically, switch the project to use the io.freefair.aggregate-javadoc-jar plugin and disable Javadoc generation for the :app:pkg sub-project. Javadoc generation appears to get tripped up for the :app:pkg sub-project because of the previously discussed tricks I used to get Java Modules working (shadow jar wrapped as a single module). Specifically, Javadoc appears to be adding the the shadow jar its classpath along with all the other project dependencies, which is causing a bunch of duplicate class warnings. There seem to be two options for fixing this: 1) We try to fully modularize the entire project. I'm wary of going down this road for now. 2) We try to exclude the :app:pkg project from Javadoc generation. It only has a single dummy class anyway, so we're not missing much there. The trick with option # 2 is that we are using the nebula-aggregate-javadocs plugin from Netflix for project-wide javadoc aggregation. This plugin doesn't appear to have a way of excluding a project (I've looked at the source). This plugin also hasn't been updated in five years? As an alternative, there are newer Gradle plugins that support javadoc aggregation. Specifically, I just tried the io.freefair.aggregate-javadoc-jar, which is currently being actively maintained. Per the source, it's possible to exclude particular projects with a "javadoc { enabled = false }" clause in a sub-project. I've verified this behavior on own project. It seems to generate aggregated javadoc in build/docs/javadoc/ like the old plugin, though the target name has changed: aggregateJavadocs => aggregateJavadoc (the s is dropped)
I tested |
I took the liberty of replacing the existing static architecture diagram with a Mermaid diagram that can be edited directly in Markdown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bdferris-v2, this is great :)
I think the module naming is ok. After reading the documentation I think it's obvious, although I'm not sure it would be obvious to someone coming to the project fresh without reading the docs. But I can't think of better naming myself, so I'd say let's go with it :).
After reviewing everything, I agree with this. I think the architecture you provided is the best possible for now. I don't have anything else to add that Sean hasn't already mentioned.
Ok, at this point, I think this PR is ready for full review (hopefully we've already done most of the work). Acknowledged that I've punted a number of implementation details into follow-up work tracked in #1134 and #1135. However, I think the PR is in a usable state and worth committing before we move onto subsequent iterations. |
@bdferris-v2 Could you add the prerequisites and:
...that are in the first PR comment in BUILD.md as well? The prerequisites in the PR comment say "A Java SDK that includes jlink and jpackage". Can you expand on how one would get ahold of such an SDK? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good @bdferris-v2! A few minor comments.
![architecture schema](https://user-images.githubusercontent.com/35747326/101182386-610e9400-3624-11eb-84b9-ec935e44aa2b.png) | ||
`gtfs-validator` is composed from a number modules, as shown in the following dependency diagram: | ||
|
||
```mermaid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍 Didn't know you could do this in Markdown! Very cool!
@barbeau @maximearmstrong I think we might be getting close here. Any additional concerns? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, we are very close. One thing, I think we need a section in the README.md
on how to use the installable application. I also added a comment related to that in my review.
I almost commented saying something similar, but after more thought I would wait on this, because it's going to change significantly when the UI is added in an upcoming PR. I think the existing note saying that it's under active development in the build section is probably enough for now as it's not ready to be user-facing yet. |
I agree. I was about to say the same now that the note have been added. |
@bdferris-v2 I approved this PR. Thank you for this contribution! 🚀 |
@bdferris-v2 It seems that we are only missing the signature of the license/cla to be able to merge. |
@maximearmstrong I did sign the CLA, like two weeks ago :) When I go to https://cla-assistant.io/MobilityData/gtfs-validator, I see the following: Is there something else I need to do? Anything you want to check on your end? |
@maximearmstrong I think my permissions on the MobilityData org changed at some point and I can no longer see the list of signed CLAs for MobilityData: I also can't see the current hooks/3rd party tools integrations on this repo settings either. IIRC I'm the one that set this up originally. Could you try going to https://cla-assistant.io/ and see if you can see @bdferris-v2's CLA there? I'm wondering if something is wrong with the CLA bot, although it looks like a 3rd party contributor was recognized as having signed the CLA by the bot in Feb: I'm not sure if something re: permissions would have changed since then that could have broken it. Maybe related to MobilityData/gtfs-realtime-validator#150? |
@bdferris-v2 Oh, it seems the issue is that your other account @bdferris is also a committer on the project. Since you got locked out of that account and signed the CLA with your new account, I think we can merge without any problem. |
Yeah, I'm sure that's going to cause continued confusion. The original account is still associated with my primary email, so it tends to get picked up by default despite my best efforts. Either way, I'm going to go ahead and merge. Thanks! |
No worries. I have reconfigured the CLA assistant using my account, so we'll see. You may need to sign it again on your next PR. Thanks again for your contribution! |
Summary:
Introduces functionality to package the GTFS Validator as an installable application, including a bundled JRE, to make it easier for users to run the validator. As discussed in issue #1112, https://bit.ly/gtfs-validator-packaged-exe, and #1124.
Note: This is an initial draft review to get agreement on package structure before additional follow-up work.
Expected behavior:
Prerequisites:
jlink
andjpackage
To package:
./gradlew jpackage
Expected:
app/pkg/build/jpackage
directory.The current application is just a simple wrapper around the existing CLI. On Windows, you can run the validator by dragging a GTFS zip file onto the application shortcut. On Mac OS, you still have to run it from the command-line while we wait on some simple GUI support (e.g.
GTFS\ Validator.app/Contents/MacOS/GTFS\ Validator path/to/your/gtfs.zip
).Future work will include:
main
sub-project to separate table+validation code from the cli code