feat: Add seed.pgpm() adapter and pgpm integration tests #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
seed.pgpm()adapter that allows Python tests to use pgpm (PostgreSQL Package Manager) for database migrations without rewriting pgpm in Python. This implements "Option 1" from the integration discussion - treating pgpm as a CLI tool called via subprocess.Key changes:
PgpmSeedAdapterclass that callspgpm deployvia subprocess, passing database connection info through environment variablestests/fixtures/pgpm-workspace/) with a test module@pgpm/fakertest-pgpm.yml) for pgpm integration testsUpdates since last revision
packageparameter toseed.pgpm()to specify which package to deploy, avoiding interactive prompts in CI/non-interactive environments-s --log-cli-level=INFO) for better debuggingReview & Testing Checklist for Human
packageparameter usage - Thepackageparameter is required to avoid pgpm's interactive "Choose a package to deploy" prompt. Without it, pgpm may hang in non-interactive environments.cacheparameter is not implemented - The adapter accepts acacheparameter but it's not yet functional (documented in docstring).Test plan:
test_pgpm_integration.pyactually execute (not skipped)cd tests/fixtures/pgpm-workspace/packages/test-module && pgpm install @pgpm/faker, then runpoetry run pytest tests/test_pgpm_integration.py -vNotes
npm install -g pgpm)ghcr.io/constructive-io/docker/postgres-plus:17image consistent with other workflows2.7.9in the workflowLink to Devin run: https://app.devin.ai/sessions/1203eea9373240d797329ae288ab6dd7
Requested by: Dan Lynch (@pyramation)