Skip to content

Add test coverage and improve localization - #3

Merged
TrickShotMLG02 merged 14 commits into
masterfrom
development
Aug 1, 2026
Merged

Add test coverage and improve localization#3
TrickShotMLG02 merged 14 commits into
masterfrom
development

Conversation

@TrickShotMLG02

Copy link
Copy Markdown
Owner

🚀 Summary

This PR promotes the current development branch to master. It includes localization fixes, upload security hardening, importer hardening, test coverage improvements, and several release-readiness fixes.

🧩 Related Issues

N/A

🔍 What Changed?

  • Improved localization:

    • Added missing translations for recipe importer URL fields
    • Added i18n support for admin templates
    • Updated German translations, including model verbose names
    • Preserved German characters like ä, ö, ü, and ß in non-URL text
    • Normalized slugs to URL-safe ASCII form
  • Hardened recipe image handling:

    • Stripped metadata from uploaded recipe images to avoid leaking EXIF/location data
    • Added a management command to clean metadata from existing uploads
    • Rejected animated image uploads
  • Hardened recipe importers:

    • Added stricter image content-type handling
    • Avoided unsafe importer URL/domain handling
    • Improved importer registration behavior
  • Improved security/configuration:

    • Made missing SECRET_KEY fail loudly instead of silently generating a random key
    • Clarified .env setup expectations
    • Preserved existing staff permissions while keeping newly OIDC-created users non-staff by default
  • Fixed project readiness issues:

    • Fixed unit type choice handling
    • Fixed admin importer route ordering
    • Removed duplicate ingredient slug field
    • Made tag seeding non-destructive
    • Reconciled migration state
    • Ignored JetBrains module metadata
  • Improved nutrition/import behavior:

    • Added saturated fat and sugar tracking
    • Fixed OpenFoodFacts sugar imports
  • Improved testing and coverage:

    • Added custom test coverage tooling
    • Added progress output and test summaries
    • Expanded tests with edge cases and regression coverage
    • Added GitHub Actions coverage workflow
    • Added branch-aware coverage badges to the README
    • Required authenticated Codecov uploads
  • Other cleanup:

    • Removed recipe publishing status from the recipe detail view

🧪 How to Test

# Run the full test suite
uv run python manage.py test

# Run without progress output if needed
uv run python manage.py test --no-progress

# Run the project coverage command
uv run python manage.py test_coverage

# Run coverage with the standard coverage.py report
uv run coverage run manage.py test --no-progress --no-color
uv run coverage report

Manual checks worth doing before merge:

  • Import recipes through the available recipe importers.
  • Upload recipe images and verify they still display correctly.
  • Try uploading an animated image and verify it is rejected.
  • Check German UI labels for importer fields and admin pages.
  • Confirm staff/superuser permissions behave as expected for existing users.

✅ Checklist

  • Tests pass locally
  • Coverage tooling is available locally and in CI
  • Security-related upload handling was added
  • Localization files were updated
  • README/testing documentation was updated
  • Release-readiness fixes were included

📎 Additional Notes

This PR includes the accumulated development changes since the last master release and is intended as the next development-to-master promotion.

…xed openfoodfacts importer to import actual sugar values
- Keep OIDC-created users non-staff while preserving existing permissions on update
- Fix admin importer route ordering and i18n context availability
- Normalize German characters for ASCII URL slugs and remove duplicate ingredient slug field
- Make tag seeding non-destructive and reject animated recipe image uploads
- Reconcile migration state and add regression coverage
@TrickShotMLG02
TrickShotMLG02 merged commit c6abde7 into master Aug 1, 2026
4 checks passed
@codecov-commenter

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

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.

2 participants