Skip to content

Commit b36ecbd

Browse files
authored
ci: merge main to release (ietf-tools#9398)
2 parents 67e20dc + 0c106ed commit b36ecbd

35 files changed

Lines changed: 2502 additions & 309 deletions

.github/workflows/build-base-app.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Docker Build & Push
4444
uses: docker/build-push-action@v6
4545
env:
46-
DOCKER_BUILD_NO_SUMMARY: true
46+
DOCKER_BUILD_SUMMARY: false
4747
with:
4848
context: .
4949
file: docker/base.Dockerfile

.github/workflows/build-devblobstore.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Docker Build & Push
3636
uses: docker/build-push-action@v6
3737
env:
38-
DOCKER_BUILD_NO_SUMMARY: true
38+
DOCKER_BUILD_SUMMARY: false
3939
with:
4040
context: .
4141
file: docker/devblobstore.Dockerfile

.github/workflows/build-mq-broker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- name: Docker Build & Push
4343
uses: docker/build-push-action@v6
4444
env:
45-
DOCKER_BUILD_NO_SUMMARY: true
45+
DOCKER_BUILD_SUMMARY: false
4646
with:
4747
context: .
4848
file: dev/mq/Dockerfile

.github/workflows/dev-assets-sync-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Docker Build & Push
4242
uses: docker/build-push-action@v6
4343
env:
44-
DOCKER_BUILD_NO_SUMMARY: true
44+
DOCKER_BUILD_SUMMARY: false
4545
with:
4646
context: .
4747
file: dev/shared-assets-sync/Dockerfile

dev/build/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/ietf-tools/datatracker-app-base:20250807T1514
1+
FROM ghcr.io/ietf-tools/datatracker-app-base:20250821T1359
22
LABEL maintainer="IETF Tools Team <tools-discuss@ietf.org>"
33

44
ENV DEBIAN_FRONTEND=noninteractive

dev/build/TARGET_BASE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20250807T1514
1+
20250821T1359

dev/deploy-to-container/start.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ echo "Running Datatracker checks..."
3535

3636
# Migrate, adjusting to what the current state of the underlying database might be:
3737

38+
# On production, the blobdb tables are in a separate database. Manipulate migration
39+
# history to ensure that they're created for the sandbox environment that runs it
40+
# all from a single database.
41+
echo "Ensuring blobdb relations exist..."
42+
/usr/local/bin/python ./ietf/manage.py migrate --settings=settings_local --fake blobdb zero
43+
if ! /usr/local/bin/python ./ietf/manage.py migrate --settings=settings_local blobdb; then
44+
# If we are restarting a sandbox, the migration may already have run and re-running
45+
# it will fail. Assume that happened and fake it.
46+
/usr/local/bin/python ./ietf/manage.py migrate --settings=settings_local --fake blobdb
47+
fi
48+
49+
# Now run the migrations for real
3850
echo "Running Datatracker migrations..."
3951
/usr/local/bin/python ./ietf/manage.py migrate --settings=settings_local
4052

docker/base.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ RUN apt-get update --fix-missing && apt-get install -qy --no-install-recommends
6969
nodejs \
7070
pgloader \
7171
pigz \
72-
postgresql-client-14 \
72+
postgresql-client-17 \
7373
pv \
7474
python3-ipython \
7575
ripgrep \

docker/db.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# =====================
22
# --- Builder Stage ---
33
# =====================
4-
FROM postgres:16 AS builder
4+
FROM postgres:17 AS builder
55

66
ENV POSTGRES_PASSWORD=hk2j22sfiv
77
ENV POSTGRES_USER=django
@@ -19,7 +19,7 @@ RUN ["/usr/local/bin/docker-entrypoint.sh", "postgres"]
1919
# ===================
2020
# --- Final Image ---
2121
# ===================
22-
FROM postgres:16
22+
FROM postgres:17
2323
LABEL maintainer="IETF Tools Team <tools-discuss@ietf.org>"
2424

2525
COPY --from=builder /data $PGDATA

ietf/api/__init__.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import datetime
66
import re
7+
import sys
78

89
from urllib.parse import urlencode
910

@@ -25,6 +26,9 @@
2526

2627
OMITTED_APPS_APIS = ["ietf.status"]
2728

29+
# Pre-py3.11, fromisoformat() does not handle Z or +HH tz offsets
30+
HAVE_BROKEN_FROMISOFORMAT = sys.version_info < (3, 11, 0, "", 0)
31+
2832
def populate_api_list():
2933
_module_dict = globals()
3034
for app_config in django_apps.get_app_configs():
@@ -58,6 +62,35 @@ def generate_cache_key(self, *args, **kwargs):
5862
# Use a list plus a ``.join()`` because it's faster than concatenation.
5963
return "%s:%s:%s:%s" % (self._meta.api_name, self._meta.resource_name, ':'.join(args), smooshed)
6064

65+
def _z_aware_fromisoformat(self, value):
66+
"""datetime.datetie.fromisoformat replacement that works with python < 3.11"""
67+
if HAVE_BROKEN_FROMISOFORMAT:
68+
if value.upper().endswith("Z"):
69+
value = value[:-1] + "+00:00" # Z -> UTC
70+
elif re.match(r"[+-][0-9][0-9]$", value[-3:]):
71+
value = value + ":00" # -04 -> -04:00
72+
return value
73+
74+
def filter_value_to_python(
75+
self, value, field_name, filters, filter_expr, filter_type
76+
):
77+
py_value = super().filter_value_to_python(
78+
value, field_name, filters, filter_expr, filter_type
79+
)
80+
if isinstance(
81+
self.fields[field_name], tastypie.fields.DateTimeField
82+
) and isinstance(py_value, str):
83+
# Ensure datetime values are TZ-aware, using UTC by default
84+
try:
85+
dt = self._z_aware_fromisoformat(py_value)
86+
except ValueError:
87+
pass # let tastypie deal with the original value
88+
else:
89+
if dt.tzinfo is None:
90+
dt = dt.replace(tzinfo=datetime.timezone.utc)
91+
py_value = dt.isoformat()
92+
return py_value
93+
6194

6295
TIMEDELTA_REGEX = re.compile(r'^(?P<days>\d+d)?\s?(?P<hours>\d+h)?\s?(?P<minutes>\d+m)?\s?(?P<seconds>\d+s?)$')
6396

0 commit comments

Comments
 (0)