Skip to content

chore: cherry-pick Python 3.12 upgrade (openedx/xqueue#982, #977) - #3

Merged
naincy128 merged 1 commit into
masterfrom
cherry-pick/python-312-upgrade
Oct 6, 2026
Merged

naincy128 merged 1 commit into
masterfrom
cherry-pick/python-312-upgrade

Conversation

@naincy128

@naincy128 naincy128 commented Oct 1, 2026 •

Copy link
Copy Markdown

Description

Upgrades xqueue ( edx/xqueue) to Python 3.12 and Django 5.2, based on the upstream Open edX changes, with the fixes needed to keep CI, branch rules and production file storage working.

1. Python 3.12 (upstream cherry-pick)

Cherry-picked from openedx/xqueue#982:

  • Dropped Python 3.11; Python 3.12 only in tox.ini, ci.yml and mysql8-migrations-check.yml.
  • Regenerated all requirements files with Python 3.12 (make upgrade). Production moves from Django 4.2.23 to 5.2.17.
  • requirements/common_constraints.txt synced with the current shared edx-lint constraints.
  • Makefile: make upgrade no longer strips the Django pin from requirements/test.txt. With only one Django version under test, tox no longer needs to control it.

2. Django 5.2 storage settings

Django 5.1+ removed DEFAULT_FILE_STORAGE / STATICFILES_STORAGE and silently ignores them. Without a fix, uploaded submission files would be saved to local disk instead of S3 on Django 5.2. Based on upstream openedx/xqueue#977:

  • xqueue/settings.py: defines STORAGES with Django's default backends.
  • xqueue/production.py: maps legacy DEFAULT_FILE_STORAGE / STATICFILES_STORAGE keys from the deployment YAML into STORAGES, so no deployment config change is needed. The production config still sets XQUEUE_DEFAULT_FILE_STORAGE: S3Boto3Storage.
  • DICT_UPDATE_KEYS = ('STORAGES',): a partial STORAGES in the YAML is merged into the defaults rather than replacing them.

3. CI

  • .github/docker-compose-ci.yml: the test container moves from edxops/xqueue-dev:latest (Ubuntu 20.04, where Python 3.12 can't be installed) to ubuntu:22.04. Tests still run inside the container, as on master.
  • .github/workflows/ci.yml:
    • Adds DEBIAN_FRONTEND=noninteractive, plus the packages a plain Ubuntu image needs (build-essential pkg-config default-libmysqlclient-dev git memcached).
    • Uses /tmp/venv/bin/tox, since tox is installed in that venv.
    • The env name now resolves to py312-quality, so the quality job runs the real pep8 check instead of the tests.
  • Dropped the django42 test env from tox.ini and the CI matrix. Production pins Django 5.2, and test.txt now pins it too.

4. Checks required by the master branch ruleset

The "Main / Release" ruleset requires commitlint / commitlint, tests and version-check / version-check. Before this PR, xqueue reported only the first, so nothing could merge to master.

  • ci.yml: new aggregate tests job (needs: build, if: always()). It passes only if every build matrix job passed. if: always() makes it fail rather than be skipped when a build fails, because GitHub would treat a skipped required check as passing.
  • New .github/workflows/lockfileversion-check.yml reports version-check / version-check. It's the same check as openedx/.github lockfileversion-check-v3.yml (package-lock.json must use lockfileVersion: 3), but it passes when there is no package-lock.json. The shared workflow can't be used here because it fails when the file is missing.

Note for maintainers: version-check is an npm lockfile check and doesn't apply to this Python repo. The ruleset looks like it was copied from a frontend template; edx/xqueue-watcher has the same one. If the ruleset is corrected, lockfileversion-check.yml can be removed.

Testing

  • CI on this PR: build (py312, django52, mysql80), build (py312, quality, mysql80), check migration for MySql8, commitlint, tests and version-check all pass.
  • Locally, on Python 3.12 + Django 5.2.17 against MySQL 8.0:
    • full test suite: 41 passed, 4 skipped;
    • manage.py check: no issues;
    • makemigrations --check: no changes. Migration 0005 had already moved index_together to indexes.
  • Storage fallback: loaded xqueue.production with three deployment YAML styles:
    • legacy DEFAULT_FILE_STORAGE: S3Boto3Storage → default_storage is S3;
    • new-style STORAGES → S3;
    • neither key → local file system storage, as expected.
  • Python 3.11 compatibility: the new requirements.txt installs and imports on Python 3.11. Production runs 3.11 until the configuration change below is deployed.
  • version-check script:
    • no lockfile → pass;
    • lockfileVersion: 3 → pass;
    • lockfileVersion: 2 → fail.

Jira

Upstream references

Copilot AI balanced review requested due to automatic review settings October 1, 2026 05:17

This comment was marked as resolved.

@naincy128
naincy128 force-pushed the cherry-pick/python-312-upgrade branch 3 times, most recently from 5aff4c0 to db3b8db Compare October 1, 2026 06:44
@naincy128 naincy128 changed the title chore: cherry-pick Python 3.12 upgrade (openedx/xqueue#982) chore: cherry-pick Python 3.12 upgrade (openedx/xqueue#982, #977) Oct 1, 2026
@naincy128
naincy128 force-pushed the cherry-pick/python-312-upgrade branch from 6b31f35 to cee144e Compare October 1, 2026 09:37
@naincy128
naincy128 force-pushed the cherry-pick/python-312-upgrade branch 2 times, most recently from ecdd9af to 9577135 Compare October 5, 2026 12:39
@naincy128
naincy128 force-pushed the cherry-pick/python-312-upgrade branch from 9577135 to 7ebcced Compare October 6, 2026 04:56
@naincy128
naincy128 merged commit 6ee3b0f into master Oct 6, 2026
5 checks passed
@naincy128
naincy128 deleted the cherry-pick/python-312-upgrade branch October 6, 2026 05:05
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.

4 participants