gtfs-validator
gtfs-validator copied to clipboard
feat: html output, web front end
Summary:
Features
- Create an html report in the same folder as the json report when run via command line.
- Add an embedded web server which can be run via a
--web_server
option.
Build
- Use spotless to check java syntax instead of com.github.sherter.google-java-format which appears to be unmaintained.
- Fix various small gradle warnings.
- Added a build.gradle task to compile js libraries, and bundle web front end assets to java source code.
Expected behavior:
-
Command line validation writes a report.html file in the output directory, the file name can be chosen by
--validation_html_report_name
. -
--web_server
will run an embedded web server on port 6888, where one can submit GTFS files for validation. -
./gradlew generateViewerAssets
will re-generate ViewerAssets.java based on source html, js, and css. There might be better ways to achieve this, I'm not very familiar with best practices for java bundling or code generation. UPDATE: I've added a dependency frombuild
to the js compilation and bundling steps. I think this is how gradle is supposed to work but I'd love a review from someone who is knowledgeable. Seemain/build.gradle
.
Please make sure these boxes are checked before submitting your pull request - thanks!
- [x] Run the unit tests with
gradle test
to make sure you didn't break anything - [x] Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
- [x] Linked all relevant issues
https://github.com/MobilityData/gtfs-validator/issues/495
- [ ] Include screenshot(s) showing how this pull request works and fixes the issue(s)
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.
:white_check_mark: ed-g
:x: lisaattrillium
You have signed the CLA already but the status is still pending? Let us recheck it.
a much needed feature to expand access to the validator beyond consuming software applications! Producers have relied on the quite stale feedvalidator.py script from the transitfeeds library of scripts and not having a human-readable out for this validator has hindered adoption.
Hello, thank you so much for this contribution @ed-g! This is indeed one of the top requested features for this tool :)
One question: what is the reason you chose Spark Java? Not sure if you were aware, we previously started to work on an Interface using Spring Boot (in PR#421).
Hello @isabelle-dr! You're very welcome :-)
My coworker and I took a look for the previous web ui, based on this comment, https://github.com/MobilityData/gtfs-validator/issues/445#issuecomment-764779942 and https://github.com/MobilityData/gtfs-validator/issues/495#issuecomment-749597294 we got the sense that 2.0 updates may have changed some internals that it relied upon?
There is no particular reason why I chose spark java over spring boot or another web framework. I think it could be ported to pretty much anything if the team has another preference.
I've added some basic Jasmine tests and merged report text and css updates.
Our current project funding ends today, please don't be shy if you have any quick requests for improvements.
Can anyone share a brief snapshot on where this is on getting merged? Are there blockers?
Closing this PR, since this will not be worked on further