From 45928e1ac91443f65a84bfcd691b679480151a67 Mon Sep 17 00:00:00 2001 From: mariatta Date: Tue, 20 Oct 2026 16:54:12 -0700 Subject: [PATCH] Remove Heroku leftovers miss-islington now runs on cabotage only; the Heroku app is in maintenance mode with all resources scaled to zero. - Drop runtime.txt, which only Heroku read. - Require REDIS_URL and drop the HEROKU_REDIS_MAROON_URL fallback. - Drop the CERT_NONE broker and result backend SSL settings that existed for Heroku's self-signed Redis certificate. On cabotage the rediss:// URL carries ssl_ca_certs and ssl_cert_reqs=required as query parameters. - Build the Docker image on Python 3.15 instead of 3.11, which is the next release to reach end of life. Requested by @hugovk in #729. --- Dockerfile | 2 +- miss_islington/tasks.py | 12 ++++-------- runtime.txt | 1 - tests/test_tasks.py | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 runtime.txt diff --git a/Dockerfile b/Dockerfile index 516ad1b95..674f8a4c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-slim +FROM python:3.15-slim # Logs go straight to the container log instead of being block-buffered. ENV PYTHONUNBUFFERED=1 diff --git a/miss_islington/tasks.py b/miss_islington/tasks.py index 612e7dbb5..42d45ec96 100644 --- a/miss_islington/tasks.py +++ b/miss_islington/tasks.py @@ -1,7 +1,6 @@ import asyncio import logging import os -import ssl import subprocess import aiohttp @@ -20,18 +19,15 @@ app = celery.Celery("backport_cpython") -# REDIS_URL on cabotage, HEROKU_REDIS_MAROON_URL on Heroku. Fail at import if -# neither is set rather than letting celery fall back to a local amqp broker. -REDIS_URL = os.environ.get("REDIS_URL") or os.environ["HEROKU_REDIS_MAROON_URL"] +# Fail at import if REDIS_URL is not set rather than letting celery fall back +# to a local amqp broker. TLS settings (ssl_cert_reqs, ssl_ca_certs) are +# carried as query parameters in the rediss:// URL. +REDIS_URL = os.environ["REDIS_URL"] app.conf.update( broker_url=REDIS_URL, result_backend=REDIS_URL, broker_connection_retry_on_startup=True, - # Used for Heroku's self-signed rediss:// URL. On cabotage the ssl_* query - # parameters in REDIS_URL take precedence over these settings. - broker_use_ssl={"ssl_cert_reqs": ssl.CERT_NONE}, - redis_backend_use_ssl={"ssl_cert_reqs": ssl.CERT_NONE}, ) cache = cachetools.LRUCache(maxsize=500) diff --git a/runtime.txt b/runtime.txt deleted file mode 100644 index 76b6e496e..000000000 --- a/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -python-3.11.6 diff --git a/tests/test_tasks.py b/tests/test_tasks.py index 2afbd6b70..5ebb2d845 100644 --- a/tests/test_tasks.py +++ b/tests/test_tasks.py @@ -4,7 +4,7 @@ from cherry_picker import cherry_picker -os.environ.setdefault("HEROKU_REDIS_MAROON_URL", "someurl") +os.environ.setdefault("REDIS_URL", "redis://localhost") from miss_islington import tasks