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

Upgraded wagtail to 2.9.3, added image rendition caching #2029

Merged
merged 1 commit into from
Dec 23, 2020
Merged

Conversation

gsidebo
Copy link
Contributor

@gsidebo gsidebo commented Dec 9, 2020

Pre-Flight checklist

  • Testing
    • Code is tested
    • Changes have been manually tested
  • Settings
    • New settings are documented and present in app.json
    • New settings have reasonable development defaults, if applicable

What are the relevant tickets?

Partially addresses #2019

What's this PR do?

Upgrades Wagtail to 2.9.3, which includes image rendition caching, and adds configuration to perform that caching

How should this be manually tested?

Since this involves a bunch of library upgrades, a good site-wide smoke test won't hurt.

To test the caching specifically:

  • Start a Django shell
  • Run this code snippet to check the contents of Redis:
    from django.conf import settings
    import redis
    client = redis.from_url(settings.WAGTAIL_CACHE_URL)
    client.execute_command("KEYS *")
  • Load a page in the web app which has CMS images (e.g.: the catalog or a product page)
  • Run the snippet above once again. There should be new keys prefixed with "wag"

Any background context you want to provide?

We are making an effort to improve caching of these images in Fastly. In an ideal world, these images wouldn't end up in the Redis cache at all. This can be considered a fallback in case the caching in Fastly falls through. If Wagtail renders an image, it will automatically be saved in the Redis cache. Subsequent requests for the image will be served from there, saving a significant amount of time/memory

@odlbot odlbot temporarily deployed to xpro-ci-pr-2029 December 9, 2020 15:48 Inactive
@odlbot odlbot temporarily deployed to xpro-ci-pr-2029 December 9, 2020 17:26 Inactive
@odlbot odlbot temporarily deployed to xpro-ci-pr-2029 December 9, 2020 20:55 Inactive
@codecov-io
Copy link

codecov-io commented Dec 9, 2020

Codecov Report

Merging #2029 (c456644) into master (7603fcc) will increase coverage by 9.14%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2029      +/-   ##
==========================================
+ Coverage   87.96%   97.10%   +9.14%     
==========================================
  Files         328      157     -171     
  Lines       14663     4912    -9751     
  Branches     1024        0    -1024     
==========================================
- Hits        12898     4770    -8128     
+ Misses       1529      142    -1387     
+ Partials      236        0     -236     
Impacted Files Coverage Δ
cms/constants.py
mail/verification_api.py
courseware/apps.py
voucher/conftest.py
users/api.py
users/apps.py
fixtures/autouse.py
cms/templatetags/image_version_url.py
courses/admin.py
cms/api.py
... and 158 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7603fcc...c456644. Read the comment docs.

@odlbot odlbot temporarily deployed to xpro-ci-pr-2029 December 9, 2020 22:32 Inactive
@odlbot odlbot temporarily deployed to xpro-ci-pr-2029 December 9, 2020 22:41 Inactive
@odlbot odlbot temporarily deployed to xpro-ci-pr-2029 December 9, 2020 22:50 Inactive
@odlbot odlbot temporarily deployed to xpro-ci-pr-2029 December 10, 2020 20:55 Inactive
@odlbot odlbot temporarily deployed to xpro-ci-pr-2029 December 10, 2020 21:04 Inactive
@umarmughal824 umarmughal824 self-assigned this Dec 11, 2020
dependencies = [("cms", "0028_course_program_index_pages")]
dependencies = [
("cms", "0028_course_program_index_pages"),
("wagtailcore", "0043_lock_fields"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any particular reason for adding this?

I am getting incosistent history error.

web_1     | django.db.migrations.exceptions.InconsistentMigrationHistory: Migration cms.0029_setup_course_program_index_pages is applied before its dependency wagtailcore.0043_lock_fields on database 'default'.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was to account for a field name change in one of the Wagtail models, but I forgot to test in cases where you're not migrating from zero. I think I need to change this so it just uses some if/else logic to refer to the model field rather than adding that migration as a dependency.

Copy link
Contributor

@umarmughal824 umarmughal824 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codewise looks good but could not test because of migrations inconsistent history.

@abeglova abeglova self-assigned this Dec 23, 2020
Copy link
Contributor

@abeglova abeglova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gsidebo gsidebo merged commit ef20750 into master Dec 23, 2020
@gsidebo gsidebo deleted the wagtail_2.9 branch December 23, 2020 18:46
@asadiqbal08 asadiqbal08 mentioned this pull request Mar 1, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants