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

Make more formats resilient #300

Merged
merged 4 commits into from Mar 20, 2017
Merged

Make more formats resilient #300

merged 4 commits into from Mar 20, 2017

Conversation

@fofr
Copy link
Contributor

@fofr fofr commented Mar 15, 2017

This tests 4 further formats against random content.

How should we report bad content?

Frontend principles:

  1. Attempt to give the users what they need by rendering anything that's provided by the content-store
  2. Report back to us when crucial data is missing so it can be fixed (ie not masking errors)

This PR only does part 1, ie the frontend will not fall over and users will see content, but we won't know that it's broken. When this happens how should we be reporting it? Send to Errbit while still rendering content? This mostly applies to HTML publications and their relationship with other content (organisations, parent).


  1. HTML Publications
  • Protect against parent document type not existing
  • Protect against no organisations
  • Protect against organisations with no logo
  1. Topical event about pages
  • Protect against parent in breadcrumb not existing
  • Protect against missing end date

Also adds tests against random content for working groups and case studies

fofr added 4 commits Mar 10, 2017
* Protect against parent document type not existing
* Protect against no organisations
* Protect against organisations with no logo
* Test 10 randomly generated but valid HTML publications
* Protect against parent in breadcrumb not existing
* Protect against missing end date
Check for resilience
@boffbowsh boffbowsh temporarily deployed to government-frontend-pr-300 Mar 15, 2017 Inactive
@nickcolley
Copy link
Contributor

@nickcolley nickcolley commented Mar 15, 2017

We almost need a way to say we're expecting this data but do not fail if it does not exist, and then log that.

@@ -28,7 +29,8 @@ def organisation_brand_class(organisation = default_organisation)
private

def default_organisation
content_item["links"]["organisations"].first
orgs = content_item["links"]["organisations"] || []

This comment has been minimized.

@tijmenb

tijmenb Mar 15, 2017
Contributor

You could also do content_item.dig("links", "organisations", 0) here

@nickcolley nickcolley merged commit 06bb1ed into master Mar 20, 2017
2 checks passed
2 checks passed
continuous-integration/jenkins/branch This commit looks good
Details
security/snyk No new vulnerabilities
Details
@nickcolley nickcolley deleted the resilience branch Mar 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.