Skip to content

major upgrade - #215

Merged
alee merged 8 commits into
mainfrom
upgrade-deps
Aug 30, 2026
Merged

alee merged 8 commits into
mainfrom
upgrade-deps

Conversation

@alee

@alee alee commented Aug 28, 2026

Copy link
Copy Markdown
Member

upgrade to citation 1.0.0 and all other major django deps

alee added 8 commits August 28, 2026 09:17
Both catalog and citation now resolve dependencies via pyproject.toml +
uv.lock (Django~=5.2.17, Python 3.12 baseline). requirements.txt is kept
as an intentionally-empty tombstone since some tooling still probes for
its presence, but no longer feeds the build. Bumps the citation submodule
to its 1.0.0 release commit. Also ignores build-generated *.egg-info/
directories.
… to Gunicorn

- deploy/images/django.Dockerfile: Python 3.12-slim base, uv-locked
  dependency install (uv sync --locked), Gunicorn as the production WSGI
  runtime.
- deploy/docker/{dev,prod,test}.sh: sync dev dependency group on
  container start, launch Gunicorn instead of uWSGI.
- nginx configs and deploy/uwsgi/catalog.ini: proxy to the Gunicorn unix
  socket over plain HTTP instead of the uwsgi protocol; retired
  uwsgi_params/catalog.ini are kept only as documented tombstones until
  staging.yml's config sources are updated.
- tasks.py: add check_migrations/migrate invoke tasks, turn
  reload_uwsgi into a documented no-op.
- CI: build via ./compose/./build.sh, add a makemigrations --check gate
  before running tests.
- catalog/core/urls.py: django.conf.urls.url() -> path()/re_path()
  (removed in Django 4+).
- catalog/core/views.py: is_safe_url -> url_has_allowed_host_and_scheme,
  ugettext_lazy -> gettext_lazy (both removed in Django 4+); drop the
  elasticsearch_dsl 7.x-only include_meta/skip_empty kwargs from
  Hit.to_dict() for the ES8 client.
- catalog/core/tests/test_views.py: assertEquals -> assertEqual
  (removed from unittest in Python 3.12).
…g, raven with sentry-sdk

- django-cas-client is abandoned and incompatible with Django 5.2;
  switch to django-cas-ng (settings, urls.py, middleware/backends,
  CAS_* settings mapped to their django-cas-ng equivalents).
- raven (legacy Sentry client) is abandoned; switch to sentry_sdk.init(),
  initialized at settings import when SENTRY_DSN is configured. Existing
  RAVEN_PRIVATE_DSN/RAVEN_PUBLIC_DSN secret keys are read as-is so no
  deployment secret changes are required.
- Expose sentry_public_dsn/release_version to templates via a new
  context processor, replacing the old raven.js browser include across
  base/login/index/network-graph templates.
- Also updates the settings docstring's Django doc links to 5.2, the
  DB engine alias (postgresql_psycopg2 -> postgresql), and sets
  DEFAULT_AUTO_FIELD = BigAutoField (citation's CitationConfig already
  opts in; catalog.core defines no models, so no new migrations).
…olr/ES6

Adds an elasticsearch8 service (base.yml, dev.yml) and its cluster config
(deploy/elasticsearch.conf.d/elasticsearch8.yml) alongside the existing
Solr/ES6 stack, plus:
- catalog/core/apps.py, search_indexes.py, forms.py: ES8 client wiring
  and index document definitions.
- catalog/core/management/commands/rebuild_es_index.py: rebuild/validate
  the ES8 public index with an atomic alias swap, distinct from the
  Solr/Haystack index which remains the live search backend.
- Tests for the rebuild command and search index document mapping.

This is additive: the app continues to search against Solr/Haystack;
ES8 is populated and validated ahead of a future gated cutover (see the
deploy-management changeset for the cutover/rollback mechanics).
- staging.yml/prod.yml: django image must be an immutable tag/digest
  (${CATALOG_IMAGE}), never :latest; ELASTICSEARCH_HOST is an explicit
  per-release env var (defaults to the ES6 elasticsearch service) so a
  release opts into ES8 deliberately.
- deploy.sh: validate image refs and ES host, record the previous
  {image, ES host} pair as service labels and a deploy history log
  before rolling over, so a rollback redeploys the exact previous pair
  rather than drifting to :latest or a mismatched ES endpoint.
- docs/deployment-runbook.md: documents the build/stage/validate/cutover/
  rollback procedure referenced by the compose files and deploy.sh.
@alee
alee merged commit 8b2e951 into main Aug 30, 2026
2 checks passed
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.

1 participant