Pin the testcontainers Postgres in the URL-fixture test to _POSTGRES_IMAGE
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- docker, postgresql, python
- Domain
- testing-qa
Research direction
Start with the bare postgres:17 literal in tests/db/test_postgres_url_fixture.py near line 197 and switch it to db_conftest._POSTGRES_IMAGE, which that module already imports. Then extend the scan in tests/guards/test_fixture_image_pins.py over tests/**/*.py for PostgresContainer( calls with bare tags. Done when the test uses the pinned constant and the guard fails once the bare tag is put back.
Written by the indexing model from the issue text.
Description
Problem
tests/db/test_postgres_url_fixture.py still starts a testcontainers Postgres from the bare tag postgres:17. #3610 / PR #3613 pinned the compose and fixture Postgres images to the digest-pinned _POSTGRES_IMAGE in tests/db/conftest.py, because an upstream re-tag of postgres:17 to 17.12 broke fresh migrations. This test was not included. It also is not pre-pulled, so it can pull a different, unpinned image from the one the rest of the suite uses.
Evidence
tests/db/test_postgres_url_fixture.py:197:with PostgresContainer("postgres:17") as container:tests/db/conftest.py:41-43:_POSTGRES_IMAGE = ("postgres:17@sha256:7958…3317" # 17), the pinned constant.tests/db/conftest.py:58uses it for the session fixture.tests/guards/test_fixture_image_pins.py:40-43: the guard checks only the_POSTGRES_IMAGE/_SEAWEEDFS_IMAGEconstants in the two conftest files, plus the compose/Helm references added by #3610. It does not scan test modules for a barePostgresContainer("postgres:...").
Expected
Every Postgres testcontainer in the tree uses the digest-pinned _POSTGRES_IMAGE, and the pin guard fails when a test starts one from a bare tag.
Proposed approach
- In
tests/db/test_postgres_url_fixture.py:197, usedb_conftest._POSTGRES_IMAGE(the module already importsdb_conftest). - Extend
tests/guards/test_fixture_image_pins.pyso it scanstests/**/*.pyforPostgresContainer(calls (andpostgres:image literals) that do not use the constant or a digest pin. Prove the guard bites by restoring the bare tag and watching it fail.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 9h 13m
- Merged PRs (30d)
- 197
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from randomparity/kdive
-
area:providers effort:S priority:P3 risk:night-watch status:ready type:docs
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
randomparity/kdive#3618 ·
Maintainers usually reply within 1 day
-
area:core-platform effort:S priority:P3 risk:night-safe status:ready type:test
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
randomparity/kdive#3603 ·
Maintainers usually reply within 1 day
-
area:providers effort:S priority:P3 risk:night-safe status:ready type:docs
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
randomparity/kdive#3593 ·
Maintainers usually reply within 1 day
-
area:providers effort:S priority:P3 risk:night-safe status:ready type:refactor
Difficulty 1/5 Under an hour Newbie friendliness 84/100
randomparity/kdive#3592 ·
Maintainers usually reply within 1 day
-
area:providers effort:S priority:P3 risk:night-safe status:ready type:docs
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
randomparity/kdive#3591 ·
Maintainers usually reply within 1 day
All issues in randomparity/kdive
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
FinanceFlash/unvibecode#760 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
google-research/google-research#3470 ·
Maintainers usually reply within 21 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
mrvautin/ha-workouts#11 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
laramies/theHarvester#2666 ·
Maintainers usually reply within 3 days