Skip to content

Waste-audit cleanup: remove debug artifacts, tighten entrypoint/CI, and harden settings#28

Merged
dendencat merged 1 commit into
mainfrom
codex-x2emn4
Jul 8, 2026
Merged

Waste-audit cleanup: remove debug artifacts, tighten entrypoint/CI, and harden settings#28
dendencat merged 1 commit into
mainfrom
codex-x2emn4

Conversation

@dendencat

Copy link
Copy Markdown
Owner

Motivation

  • Remove leftover debug artifacts and duplicated template/static files identified by the waste audit to reduce noise and accidental leaks.
  • Prevent unsafe runtime migration generation during container start and detect missing migrations in CI to improve production stability.
  • Make tests deterministic in environments without Redis and preserve CSRF behavior while keeping logging robust.
  • Consolidate and clarify duplicated/overlapping settings to reduce configuration surprises between environments.

Description

  • Removed root-level debug and temporary files (cookies.txt, captured login_response*.html, Playwright debug scripts, test_rest_api.py, static/index.html, malformed template files and templates/static/ duplicates) and added ignore patterns to .gitignore.
  • Replaced runtime makemigrations in docker/entrypoint.sh with a dry-run check (makemigrations --check --dry-run) and made application migration apply non-interactively (migrate --noinput).
  • Added a pre-test migration check step to the CI workflow (.github/workflows/docker-publish.yml) that runs python manage.py makemigrations --check --dry-run before pytest.
  • Hardened techblog_cms/settings.py by creating LOG_DIR, routing file handler to LOG_DIR, consolidating CSRF_TRUSTED_ORIGINS into an env-castable setting, avoiding disabling CSRF middleware for tests, and switching test-time cache to an in-memory LocMemCache/session backend to avoid Redis dependency.
  • Made settings_production.py insert SecurityMiddleware only if not already present.
  • Improved markdown_filter with a fallback linkifier to ensure plain URLs are linkified even if markdown.extensions.linkify is unavailable.
  • Documented repository layout and static-asset policy in README.md to reflect the consolidated structure.

Testing

  • Ran python manage.py check which succeeded with no issues.
  • Ran TESTING=True python manage.py makemigrations --check --dry-run in CI-style mode which completed successfully.
  • Ran the full test suite with python -m pytest -v, resulting in all tests passing (16 passed).
  • Attempted docker compose config but it could not be executed in this environment because Docker is not installed (docker: command not found).

Codex Task

@dendencat
dendencat merged commit dae8305 into main Jul 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant