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

Allow all features to work in development #267

Draft
wants to merge 2 commits into
base: upgrade-django
Choose a base branch
from

Conversation

SteveMarshall
Copy link
Member

@SteveMarshall SteveMarshall commented Apr 2, 2024

Previously, getting search to work in development meant doing a bunch of bespoke work per environment. And our move to Docker-based development meant that we couldn't display stats graphs unless they were manually built with a mounted working directory after building the container.

This moves our search index out of the working directory and falls back to the pre-built, out-of-working-directory stats graphs, so that both now work as expected in development by default.

@SteveMarshall SteveMarshall changed the base branch from main to upgrade-django April 2, 2024 08:02
@SteveMarshall SteveMarshall marked this pull request as draft April 2, 2024 08:02
@SteveMarshall
Copy link
Member Author

Marking this as draft until #266, on which it depends, is merged.

Previously, we were building our Xapian database in our working
directory which meant that, when we mount our working directory over
the one in the container, we're left with no search index.

To allow the search index to persist even with a mounted working
directory, this moves the search index outside the working directory
(using the new SEARCHDB_PATH environment variable).

It also makes the search Make targets more explicit, and moves all the
search connection creation into `backend.util` so that we can change
everything at once in future.
In development, we mount our working directory over the one in the
container, meaning that generated assets (like the stats graphs) aren't
accessible. Rather than rebuild them into our working directory, this
adds the version collected during the container build as a last-resort
place to serve them from.

We're only setting this in development mode to avoid having
`collectstatic` (which we run in `live` mode) try to collect assets
from its own target directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant