Skip to content

fix(seed): reject prod fixtures - #522

Merged
simonvanlierde merged 2 commits into
mainfrom
seed-production-guard
Nov 15, 2026
Merged

simonvanlierde merged 2 commits into
mainfrom
seed-production-guard

Conversation

@simonvanlierde

Copy link
Copy Markdown
Contributor

Pull Request

Summary

This rejects fixture seeding in production before Alembic or Python can run. Fixes #502.

  • Reject SEED_DUMMY_DATA=true, including mixed-case values, when ENVIRONMENT=prod.
  • Reject enabled BULK_SEED_PRODUCTS with the existing numeric condition.
  • Keep nonproduction behaviour and disabled values unchanged, with stub checks for invocation order and production configuration guidance.

Tests: 305 stub checks, shell syntax, ShellCheck, shfmt and Markdown checks passed in a credential-free disposable container. The new rejection cases failed before the fix. No real database, production deployment, macOS or docs build was checked.

Type of change

  • 🚀 feat: New feature
  • 🐛 fix: Bug fix
  • 🛠️ build: Build system or dependency changes
  • 🔄 ci: CI configuration changes
  • 📚 docs: Documentation only changes
  • 🏎️ perf: Performance improvement
  • ♻️ refactor: Code refactoring (no functional changes)
  • 🎨 style: Code style/formatting changes
  • ✅ test: Adding or updating tests
  • 🔧 chore: Other maintenance work

Why

What problem does this solve?

Checklist

  • I've read the contributing guidelines
  • Code follows style guidelines and passes quality checks (just ci)
  • Unit tests added/updated and passing locally (just test)
  • Documentation updated (if applicable)
  • Database migrations created (if applicable)

Fixes #502

Signed-off-by: Simon van Lierde <90462640+simonvanlierde@users.noreply.github.com>
@codspeed

codspeed Bot commented Nov 15, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ Upgrade your CodSpeed plugin for Python 3.15

pytest-codspeed 5.0.3 is only tested on Python 3.9, 3.10, 3.11, 3.12, 3.13, and 3.14, so your Python 3.15 measurements may be inaccurate. Upgrade pytest-codspeed to 5.0.4 or later.

See affected benchmarks

✅ 7 untouched benchmarks


Comparing seed-production-guard (1e69469) with main (393bf21)

Open in CodSpeed

@simonvanlierde
simonvanlierde merged commit 93da329 into main Nov 15, 2026
26 checks passed
@simonvanlierde
simonvanlierde deleted the seed-production-guard branch November 15, 2026 18:35
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.

Refuse SEED_DUMMY_DATA=true in prod migrations entrypoint

1 participant