Skip to content

Break up DynamicWhiteNoise code#10648

Closed
dylanmccall wants to merge 1 commit into
learningequality:developfrom
endlessm:dynamic-whitenoise-subclassing
Closed

Break up DynamicWhiteNoise code#10648
dylanmccall wants to merge 1 commit into
learningequality:developfrom
endlessm:dynamic-whitenoise-subclassing

Conversation

@dylanmccall
Copy link
Copy Markdown
Contributor

@dylanmccall dylanmccall commented May 5, 2023

Instead of generating everything in the initializer, we will use some more specific functions. This makes it easier to create a subclass of DynamicWhiteNoise, for example to support platforms that require special libraries for file access.

Summary

This patch was really helpful to support Android file access in endlessm/kolibri-installer-android#116. Previously, we had to clone all of kolibri_whitenoise.py into the Android app code, and with this change we're able to do something much more maintainable. There is still some evil involved to actually get the existing WSGI server to use our subclassed DynamicWhiteNoise, but it's much closer, and in general I think this can be classified as an innocent cleanup :)

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

Instead of generating everything in the initializer, we will use some
more specific functions. This makes it easier to create a subclass of
DynamicWhiteNoise, for example to support platforms that require special
libraries for file access.
@github-actions github-actions Bot added DEV: backend Python, databases, networking, filesystem... SIZE: small labels May 5, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2023

@rtibbles
Copy link
Copy Markdown
Member

I think I'd prefer to handle this a slightly different way that explicitly sets up the backend for handling different storage needs. As this doesn't seem to be pressing for anyone right now, I'm going to close this.

@rtibbles rtibbles closed this Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DEV: backend Python, databases, networking, filesystem... SIZE: small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants