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

Detect missing Java when validating mustache template #281

Open
paulholden opened this issue Sep 25, 2023 · 3 comments
Open

Detect missing Java when validating mustache template #281

paulholden opened this issue Sep 25, 2023 · 3 comments

Comments

@paulholden
Copy link
Member

@stronk7 points to this line https://github.com/stronk7/moodle-local_ci/blob/master/mustache_lint/mustache_lint.php#L297

Example error in moodle-plugin-ci when Java is apparently not present

$ ./bin/moodle-plugin-ci mustache --moodle=/opt/moodle/master/src /opt/moodle/master/src/mod/forum
 RUN  Mustache Lint on mod_forum
/mnt/export/moodle/master/src/mod/forum/report/summary/templates/filter_dates.mustache - WARNING: Problem calling HTML validator - please report bug to integration team.

We can

  1. Detect missing Java;
  2. Switch to online
@stronk7
Copy link
Member

stronk7 commented Sep 25, 2023

I've been thinking about this and, honestly, think that sutomatically switching to the online alternative is not a good idea. We can start flooding by default https://html5.validator.nu or any other service providing that.

So, maybe, a better alternative could be something like:

  • When the jar is passed and java is missing. Exit with error.
  • Of course, suggest to install java, how not.
  • Alternatively, suggest to use the "vnu" binary instead (AFAIK it can be installed on all OSs and includes an embedded JRE, but at all effects it's a self-contained binary).
  • Also, suggest to use a local vnu docker container and point to it (http://localhost:8888 or whatever).

And then, in moodle-plugin-ci... that always tries the vnu.jar alternative...

  • try also the vnu (binary) alternative, just in case it's installed in the system.
  • allow to specify a URL with the service running. It can be the locally running docker image or, less desirable, the public html5 validator.

The point that I want to avoid here is to start "abusing" the public html5 validator without control, that's the reason I think we only should use it if explicitly said.

How does that sound?

@paulholden
Copy link
Member Author

That sounds good to me!

@andrewnicols
Copy link
Contributor

andrewnicols commented Sep 26, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants