Skip to content

build: bump django-pglocks from 1.0.4 to 2.1.0 in /requirements - #728

Open
blaipr wants to merge 1 commit into
ctrliq:mainfrom
blaipr:build/bump-django-pglocks-2.1.0-requirements
Open

build: bump django-pglocks from 1.0.4 to 2.1.0 in /requirements#728
blaipr wants to merge 1 commit into
ctrliq:mainfrom
blaipr:build/bump-django-pglocks-2.1.0-requirements

Conversation

@blaipr

@blaipr blaipr commented Aug 23, 2026

Copy link
Copy Markdown
Contributor
SUMMARY

Bumps django-pglocks from 1.0.4 to 2.1.0 in requirements/requirements.txt. It provides the advisory locks awx/main/utils/pglock.py wraps, which the task manager and the dispatcher take to serialise work across nodes.

Two things come with it:

  • django-pgware 1.0.0, a new dependency. 2.1.0 moved its backend handling into that package, so this bump adds a line rather than only changing one.
  • licenses/django-pgware.txt, its PostgreSQL License text. Any new package needs one, or test_licenses.py::test_python_and_js_licenses fails with license for requirement django-pgware is missing.

The Python requirements are outside Dependabot's scope on purpose: #675 turned on version updates for github-actions and for npm in /awx/ui and left this file out, because it is compiled by requirements/updater.sh rather than hand-pinned. So it was produced the same way make requirements produces it:

requirements/updater.sh upgrade django-pglocks

run inside the ascender_devel image.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API
ASCENDER VERSION
25.5.1

Tests

I tested this update before opening the pull request; it is not a resolver-only change.

On a real PostgreSQL, because nothing else exercises it. awx/main/utils/pglock.py short circuits to yield True whenever connection.vendor is not postgresql, so a green SQLite suite says nothing about this library. Against a PostgreSQL 15 container, with the settings make test-postgres uses:

DJANGO_SETTINGS_MODULE=awx.main.tests.settings_for_test_pg
py.test --create-db awx/main/tests/functional/commands/test_cleanup_jobs_postgres.py
  4 passed          (same as the baseline on main)

And a direct exercise of the wrapper across two sessions, which is the behaviour that matters here:

vendor: postgresql
other session holds it -> True
acquire while held, wait=False -> False      # the lock actually blocks
acquire after release -> True

Identical on 1.0.4 and on 2.1.0, so the semantics AWX relies on are unchanged.

The rest of the suite, on a freshly created database:

py.test --create-db -n auto --dist=loadfile \
  awx/main/tests/unit awx/main/tests/functional awx/conf/tests awx/sso/tests

  1 failed, 3816 passed, 10 skipped in 8m42s
  FAILED awx/main/tests/functional/api/test_generic.py::test_proxy_ip_allowed

That failure is not this bump. test_proxy_ip_allowed patches REMOTE_HOST_HEADERS and PROXY_IP_ALLOWED_LIST on the settings singleton and intermittently sees another worker's state under -n auto; it passes solo here (7 passed), and I have now seen it fail three times today across unrelated bumps. The serial baseline for this tree is 3816 passed, 10 skipped, with nothing failing.

Before the license file was added, the same run reported test_python_and_js_licenses failing, which is what that test is for.

CI does not run on pull requests from a fork until a maintainer approves the workflow, so this is what stands behind the change until then.

@cigamit cigamit self-assigned this Aug 26, 2026
@cigamit cigamit added dependencies Pull requests that update a dependency file python Pull requests that update python code Needs triage When a Issue needs to be researched or a PR has an issue that needs fixing before merging labels Aug 26, 2026
Compiled with requirements/updater.sh upgrade django-pglocks in the
ascender_devel image. 2.1.0 moved its backend handling into a new package,
django-pgware, so the lockfile gains a dependency as well as a version, and
licenses/django-pgware.txt comes with it: test_python_and_js_licenses fails
without it.

This one is only ever exercised on PostgreSQL. awx/main/utils/pglock.py
short circuits to a no-op when connection.vendor is not postgresql, so the
SQLite suite never reaches the library at all; it was tested against a real
PostgreSQL as well.
@blaipr
blaipr force-pushed the build/bump-django-pglocks-2.1.0-requirements branch from a56a565 to f07c019 Compare August 26, 2026 11:50
@blaipr

blaipr commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main to clear the conflict. It was only positional: django-polymorphic moved to 4.11.7 in #722 on the line right after the new django-pgware entry.

The change itself is unchanged: django-pglocks 1.0.4 to 2.1.0, the new django-pgware==1.0.0 it pulls in, six losing it as a consumer, and licenses/django-pgware.txt.

@cigamit

cigamit commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

This package is deprecated and the newest version you are upgrading to is just a shim for the new django-pgware package you imported. So its best just to move to the new one.

https://github.com/Xof/django-pglocks
https://github.com/Xof/django-pglocks/releases/tag/v2.1.0
https://github.com/Xof/django-pgware

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file Needs triage When a Issue needs to be researched or a PR has an issue that needs fixing before merging python Pull requests that update python code

Development

Successfully merging this pull request may close these issues.

2 participants