-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Travis CI build does not fail on Asciidoctor warning #1491
Comments
Well after some noodling around, I figured out that the version of Asciidoctor we're using (1.5.6.2) does not have the necessary flag From the Asciidoctor changelog for 1.5.7:
And from the 1.5.7 release summary:
So I'm going to try updating the Asciidoctor version to that version and see where that gets me. Well that was a bust, I tried some more variations on the same them, but cannot get the build to fail with the currenct rake script setup. The logging output from Asciidoctor does not make it to any part of Travis CI, or to a part of the rake script that can catch the issued warnings/errors and fail the build. I also found this issue: Processor doesn't fail when it should: asciidoctor/asciidoctor#3078 EDIT: We do not need a custom logger. As a side note: using Asciidoctor 1.5.7.1 leads to a lot of broken references in the book, but that issue was already found here: #1354 (comment).
|
There's #1373 that aims at upgrading Asciidoctor to 2.x. If/when it is merged, you can just use |
Hi @slonopotamus, thanks for responding!
I'm not sure if just using the I've tried to get the build failing on my fork at https://github.com/HonkingGoose/progit2/pull/4, when just using the Maybe you can take a look at my attempts and maybe see what I'm missing here? Or do you maybe have a working example of the option being used with Travis CI/GitHub Actions, or something similar? |
Hi @ben, I managed to get a simple proof of concept of my proposed changes working on my fork at https://github.com/HonkingGoose/progit2/pull/4. I will need to do some more work, but I wanted to show you the proof of concept and get your feedback on it. The proper full fix can only be merged when the version of Asciidoctor that we're using is 1.5.7.0 or newer, Do you want me to continue working on this issue? Would you consider a pull request from me that fixes the issue fully, merge-able? Greetings HonkingGoose |
I would absolutely consider a fully-formed PR that fixes all of our build issues. 😁 |
Cool! I'll continue on working on this then! 🎉 🚀 I really want a build that gives me more confidence that I'm not messing things up for you! Catching errors early is more helpful than afterwards. 😄 |
Executive summary/TL:DR:
The current rake script cannot fail the build on Asciidoctor warnings/errors. We cannot use the version of Asciidoctor we're currently using, because that does not have the necessary flag (
--failure-level=LEVEL
. This flag is available from Asciidoctor 1.5.7.0, but using >1.5.7.0 version without further changes to the book will break cross-reference links.Proposed way to resolve this:
@jnavilla
.Which version of the book is affected?
Problem is with the Travis CI, source code on
master
.Describe the bug:
The Travis CI build is passing, while the output of build log contains warnings from
Asciidoctor build
The Travis CI build should fail when Asciidoctor logs a warning when running
bundle exec rake book:build
.Steps to reproduce:
bundle exec rake book:build
.Expected behavior:
bundle exec rake book:build
.Additional context:
I noticed that pull #1490 is fixing something that should not have been allowed past the Travis CI build.
Example of a build which has a Asciidoctor warning but a passing Travis CI build:
https://travis-ci.org/github/progit/progit2/builds/718311991
Line 319 has the first warning (it issues the same warning 3 times):
My research into a possible fix:
I found out that Asciidoctor gained the ability to error out on a given failure level (asciidoctor/asciidoctor#2003):
From Asciidoctor manual about processing
From the Asciidoctor user manual, handle missing or undefined attributes
From the Asciidoctor user manual Appendix D: Application messages
Attempt at fixing this:
WARNINGS:
It might be possible to fix this, by letting Asciidoctor fail when the .html build of the book contains errors.
⚠️ Do not change the params variable in the rake file, as that applies to all 4 of the builds.
🐛 The asciidoctor-pdf program may not use the logger: asciidoctor/asciidoctor#2003 (comment) and may crash when using
--failure-level=WARN
.I would first try changing this line into:
and see where that gets us.
I couldn't find a
--failure-level=ERROR
in the official documentation, this was mentioned here though: asciidoctor/asciidoctor#2003 (comment). So it might exist, or it might not exist.Alternatively, you can also close this issue as wont-fix. That's also OK. I wanted to flag the issue, so that the maintainer can decide on what to do. 👍
The text was updated successfully, but these errors were encountered: