gtfs-validator icon indicating copy to clipboard operation
gtfs-validator copied to clipboard

feat: html output, web front end

Open ed-g opened this issue 3 years ago • 6 comments

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 from build 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. See main/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)

ed-g avatar Jan 26 '22 20:01 ed-g

CLA assistant check
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.

CLAassistant avatar Jan 26 '22 20:01 CLAassistant

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.

ehowington avatar Jan 28 '22 16:01 ehowington

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).

isabelle-dr avatar Jan 28 '22 17:01 isabelle-dr

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.

ed-g avatar Jan 28 '22 17:01 ed-g

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.

ed-g avatar Jan 31 '22 20:01 ed-g

Can anyone share a brief snapshot on where this is on getting merged? Are there blockers?

themightychris avatar Apr 14 '22 21:04 themightychris

Closing this PR, since this will not be worked on further

isabelle-dr avatar Sep 16 '22 13:09 isabelle-dr