-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add option to ignore objects that fail to build #69
base: main
Are you sure you want to change the base?
Conversation
Hi @hughrawlinson, thanks for contributing!
I would suggest using |
I think I've addressed most of the comments - I'm just stuck with testing, I'm not really sure how to write a test for this. I will use the pytest helper and mocking build_object seems like a good idea. Is there an existing test I should copy and adapt? |
Hey @hughrawlinson, https://github.com/wagtail/wagtail-bakery/blob/master/tests/integration/test_views.py#L27 is probably the closest to emulate. You want to call https://github.com/wagtail/wagtail-bakery/blob/c63597ac405c3c35bc0b3206c58d6e5d7b9be6c8/src/wagtailbakery/views.py#L84 and probably mock |
@@ -5,19 +5,19 @@ A set of helpers for baking your Django Wagtail site out as flat files. | |||
[![Build Status](https://travis-ci.org/wagtail/wagtail-bakery.svg?branch=master)](https://travis-ci.org/wagtail/wagtail-bakery) | |||
[![Coverage Status](https://coveralls.io/repos/github/wagtail/wagtail-bakery/badge.svg?branch=master)](https://coveralls.io/github/wagtail/wagtail-bakery?branch=master) | |||
|
|||
* Issues: [https://github.com/wagtail/wagtail-bakery/issues](https://github.com/wagtail/wagtail-bakery/issues) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like Prettier got me, would you like me to revert these style changes?
Hi! I was having an issue where one of my object paths contained a string that was longer than the maximum filename length on ext filesystems. Because of this one object path, my entire bakery run was failing - and in my case, I would have preferred for that single missing file to be omitted from the generated static site, rather than to have had the entire build fail. I've opened this PR to add a setting to log an error and skip the file, rather than fail. The default behaviour is the pre-existing behaviour - the new skipping is opt-in.
I've tested this on my wagtail and it works as expected. However, I would greatly appreciate any feedback or advice you have. In particular, I have the following questions:
BAKERY_IGNORE_OBJECTS_THAT_FAILED_TO_BUILD
now.The exception I was getting was an OSError number 36 - filename too long - in the
get_build_path
function. I suspect that it's better to catch a broader error in that function or in the subsequent calls toget_content
andbuild_file
- but maybe I've gone too broad in catching anything?