Compare commits

...

5 Commits

Author SHA1 Message Date
Emmanuel Cazenave b986301e64 ci: use debvm (#72899)
gitea/publik-devinst/pipeline/head There was a failure building this commit Details
2024-04-22 16:54:32 +02:00
Emmanuel Cazenave 50515ea194 only patch message.py of not patched yet (#89703)
gitea/publik-devinst/pipeline/head This commit looks good Details
2024-04-18 12:05:19 +02:00
Emmanuel Cazenave a49feb8493 unpatch django's postgresql backend (#89708)
gitea/publik-devinst/pipeline/head This commit looks good Details
2024-04-18 11:52:54 +02:00
Emmanuel Cazenave d39018d652 bump django version to 3.2.19 (#89706)
gitea/publik-devinst/pipeline/head This commit looks good Details
2024-04-18 10:33:58 +02:00
Thomas NOËL af318c31ea patch Django for Python 3.13 (#89506)
gitea/publik-devinst/pipeline/head This commit looks good Details
2024-04-12 21:21:41 +02:00
6 changed files with 49 additions and 14 deletions

4
Jenkinsfile vendored
View File

@ -7,14 +7,14 @@ pipeline {
stage('Unit Tests (bullseye)') {
steps {
catchError(stageResult: 'FAILURE') {
sh 'sudo ./test-nspawn bullseye'
sh './test-debvm bookworm'
}
}
}
stage('Unit Tests (bookworm)') {
steps {
catchError(stageResult: 'FAILURE') {
sh 'sudo ./test-nspawn bookworm'
sh './test-debvm trixie'
}
}
}

View File

@ -1,6 +1,6 @@
clean_venv: false
compile_theme: true
django_version: 3.2.18
django_version: 3.2.19
delete_all_tenants: true
git_ssh: false
devinst_share: /usr/local/share/publik-devinst

View File

@ -0,0 +1,23 @@
commit b231bcd19e57267ce1fc21d42d46f0b65fdcfcf8
Author: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Date: Fri Mar 15 12:51:40 2024 +0100
Refs #34900 -- Fixed SafeMIMEText.set_payload() crash on Python 3.13.
Payloads with surrogates are passed to the set_payload() since
https://github.com/python/cpython/commit/f97f25ef5dfcdfec0d9a359fd970abd139cf3428
diff --git a/django/core/mail/message.py b/django/core/mail/message.py
index 4f8c93e9e5..205c680561 100644
--- a/django/core/mail/message.py
+++ b/django/core/mail/message.py
@@ -168,7 +168,8 @@ class SafeMIMEText(MIMEMixin, MIMEText):
def set_payload(self, payload, charset=None):
if charset == "utf-8" and not isinstance(charset, Charset.Charset):
has_long_lines = any(
- len(line.encode()) > RFC5322_EMAIL_LINE_LENGTH_LIMIT
+ len(line.encode(errors="surrogateescape"))
+ > RFC5322_EMAIL_LINE_LENGTH_LIMIT
for line in payload.splitlines()
)
# Quoted-Printable encoding has the side effect of shortening long

View File

@ -1,7 +0,0 @@
from django.utils.timezone import utc
def utc_tzinfo_factory(offset):
if offset:
raise AssertionError("database connection isn't set to UTC")
return utc

View File

@ -21,6 +21,7 @@
- memcached
- nginx
- npm
- patch
- pkg-config
- postgresql
- python3-apt
@ -69,10 +70,8 @@
set_fact:
venv_py3_site_packages: "{{ venv_py3_site_packages_cmd.stdout }}"
- name: copy patched django/db/backends/postgresql/utils.py
copy:
src: utils.py
dest: "{{venv_py3_site_packages}}/django/db/backends/postgresql/utils.py"
- name: patch django/core/mail/message.py
shell: "grep 'len(line.encode(errors=\"surrogateescape\"))' {{venv_py3_site_packages}}/django/core/mail/message.py || patch -p1 {{venv_py3_site_packages}}/django/core/mail/message.py roles/base/files/django-b231bcd19e57267ce1fc21d42d46f0b65fdcfcf8.patch"
- name: install django-debug-toolbar
pip:

20
test-debvm Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh -ex
# USAGE : ./test-debvm bookworm
if [ $1 = bookworm ] || [ $1 = trixie ]
then
SUITE=$1
debvm-create --release=$SUITE --size=10G --sshkey=$HOME/.ssh/id_rsa.pub -- --include=ca-certificates,gnupg2,linux-image-generic,locales-all,postgresql,sudo,git,ansible,make --hook-dir=/usr/share/mmdebstrap/hooks/9pmount --mode=unshare
debvm-run -g --sshport 2222 -- -daemonize -display none -virtfs "local,path=.,mount_tag=publik-devinst,security_model=none"
debvm-waitssh 2222
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 2222 root@localhost "cd /media/publik-devinst;./test-debvm run-tests"
kill `ps ax | grep "qemu-system-x86_64" | awk 'NR==1{print $1}'`
rm rootfs.ext4
elif [ $1 = 'run-tests' ]
then
adduser --disabled-password --gecos "" testuser
usermod -a -G sudo testuser
echo 'testuser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
PORT=`pg_lsclusters | tail -n1 | awk '{ print $3 }'`
su testuser -l -c 'cd /media/publik-devinst; ansible-playbook -e "postgresql_port=$PORT" -i inventory.yml install.yml'
fi