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

Mustache liniting: "WARNING: Problem calling HTML validator" #91

Closed
kabalin opened this issue May 1, 2019 · 4 comments
Closed

Mustache liniting: "WARNING: Problem calling HTML validator" #91

kabalin opened this issue May 1, 2019 · 4 comments

Comments

@kabalin
Copy link
Contributor

kabalin commented May 1, 2019

If your plugin ci test started reporting the error similar to:

/home/travis/moodle/theme/mytheme/templates/header.mustache - WARNING: Problem calling HTML validator - please report bug to integration team.

for every mustache file in your plugin, you are in big trouble!

Haha, joking. Have a look at build system information at the top of Travis build log, it will be something like:

Build system information
Build language: php
Build group: stable
Build dist: xenial

This mean that Travis started using Ubuntu Xenial on VM, and this is where the problem is coming from.

Before getting into more details, here is a quick fix. Unless there is a specific reason you need Xenial, just pin Travis to use Ubuntu Trusty instead (in fact if the problem came out of blue, check system information on last successful CI run, I bet Trusty was used there) by adding this line to your .travis.yml:

--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,5 @@
+dist: trusty
+
 language: php
 
 sudo: required

OK, now more details on root cause. The issue is realated to version of java, validator used in moodle-local-ci and the way how validator output is handled in moodle-local-ci. Although, we requre openjdk-8-jre-headless package in .travis.yml, it apparently has no effect for Xenial, which comes with openjdk10 and openjdk11 installed. By default java there is referring to openjdk11:

travis@travis-job-d5d214f7-f40c-4cb6-8289-5bff56fde2e8:~/build/moodleworkplace/moodle-theme_workplace$ whereis java
java: /usr/bin/java /usr/share/java /usr/local/lib/jvm/openjdk11/bin/java /usr/share/man/man1/java.1.gz

We know that mustache linting works fine with openjdk8. But there is no obvious way of swithing java version to 8 as part of build, as update-alternatives does not see openjdk10 and 11 (they are not coming from apt packages):

travis@travis-job-d5d214f7-f40c-4cb6-8289-5bff56fde2e8:~/build/moodleworkplace/moodle-theme_workplace$ update-alternatives --config java
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
Nothing to configure.

This has been acknowleged by travis already, and if you need to run Xenial with openjdk8 for some reason, you may try adding this hack to your before_install script (did not test).

What is actually happening during linting is reported to moodle-local-ci maintainers (MDLSITE-5739).

I am not sure if this requires a PR for now, or we can keep this ticket open for reference and discussion.

tomdickman referenced this issue in catalyst/moodle-local_smartmedia Aug 17, 2019
There is a known issue with travis and moodle-plugin-ci mustache, this avoids that issue.
The plugin is reliant on java openjdk-8-jre, whereas xenial and bionic ship with higher versions.
By default, java therefore refers to a higher version and mustache template linting fails.
This patch is a workaround for that behaviour until the issue with the plugin is resolved.
(See https://github.com/blackboard-open-source/moodle-plugin-ci/issues/91\)
tomdickman referenced this issue in catalyst/moodle-local_smartmedia Aug 17, 2019
There is a known issue with travis and moodle-plugin-ci mustache, this avoids that issue.
The plugin is reliant on java openjdk-8-jre, whereas xenial and bionic ship with higher versions.
By default, java therefore refers to a higher version and mustache template linting fails.
This patch is a workaround for that behaviour until the issue with the plugin is resolved.
(See https://github.com/blackboard-open-source/moodle-plugin-ci/issues/91\)
danmarsden added a commit to danmarsden/moodle-mod_attendance that referenced this issue Aug 29, 2019
@polothy polothy pinned this issue Sep 27, 2019
@polothy
Copy link
Contributor

polothy commented Sep 27, 2019

Thanks for researching this - just noticed it's failing for this project.

@polothy
Copy link
Contributor

polothy commented Sep 27, 2019

Looks like the fix is to update our version of https://github.com/moodlehq/moodle-local_ci - any idea what we do with packages?

addons:
  apt:
    packages:
      - openjdk-8-jre-headless

Looks like it was removed from the moodlehq project... that makes me a little nervous - should we at least pin it to java 11 or something?

@polothy
Copy link
Contributor

polothy commented Sep 27, 2019

This should be fixed in master now. Still blocked on releasing due to Chrome/Behat problems.

@polothy polothy closed this as completed Sep 27, 2019
@kabalin
Copy link
Contributor Author

kabalin commented Sep 27, 2019

Looks like the fix is to update our version of https://github.com/moodlehq/moodle-local_ci - any idea what we do with packages?

Correct, it has been fixed in https://tracker.moodle.org/browse/MDLSITE-5739

You don't need explicitly specify openjdk-8-jre-headless (or any other java package) if used with xenial (might be good idea to pin dist: xenial in fact)

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

2 participants