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

Invalid header causes warning, not error, and site is published with broken link. #464

Open
msgilligan opened this issue May 10, 2018 · 4 comments
Milestone

Comments

@msgilligan
Copy link

msgilligan commented May 10, 2018

I'm using JBake via Gradle and GitLab CI to auto-publish site updates. If something goes wrong with the bake Gradle task, I would like the build to fail and the site update not to be published.

Instead I get the following warning message and the site publishes with a broken link (404).

Error parsing meta data from header (missing type or status value) for file /builds/rivetz/developer-rivetz/src/jbake/content/start.adoc!
/builds/rivetz/developer-rivetz/src/jbake/content/start.adoc has an invalid header, it has been ignored!

Perhaps, for backward-compatibility reasons, there should be a config option to enable fail/abort on error.

Crawler.java could then have a configuration option to return an error or throw an exception when something goes wrong.

@ancho
Copy link
Member

ancho commented May 12, 2018

I agree. Not beeing able to parse a header should be an error and not just a warning. The bake method should indicated if the process was unsuccessful. That way the gradle task could be able to detect the problem and fail which should interrupt the ci pipeline.

The Crawler is the only class which does not collect errors and propagate them to the Oven.

@ancho
Copy link
Member

ancho commented May 13, 2018

You should be able to circumvent the error if you configure default.status and default.type.

See https://jbake.org/docs/2.6.1/#metadata_header

@jonbullock
Copy link
Member

Just to recap, if we add config option that causes content parsing warnings to throw an error instead of just being logged as a warning, and the option will be set to false for backwards compatibility. Everyone OK with this?

@rdmueller
Copy link

just to add my 2 cents:

I get a lot of config.adoc has an invalid header, it has been ignored! warnings, because many of my files are just include files which have no header and thus it is ok that they are not rendered.

I think we should distinguish between "no header" and "invalid header"

@jonbullock jonbullock added this to the v2.7.0 milestone May 6, 2021
@jonbullock jonbullock modified the milestones: v2.7.0, v2.8.0 May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants