- Python 66.4%
- HTML 23.2%
- CSS 7.4%
- JavaScript 2.2%
- Dockerfile 0.8%
The Forgejo Actions CI `test` job has never passed — all 24 runs show failure. Two root causes: the Forgejo `podman` runner's service container networking doesn't reliably expose the PostgreSQL hostname, and the CI pipeline doesn't provision RabbitMQ, causing `fedora_messaging.api.publish()` to raise `ConnectionException`. Since the codebase uses zero PostgreSQL-specific features, the test database backend can safely be switched to SQLite in-memory. This eliminates all external service dependencies for tests. Changes to test infrastructure: - Override `DATABASES` in `tsting.py` to use SQLite in-memory - Add Celery memory broker settings to prevent Redis connections - Add `CRISPY_ALLOWED_TEMPLATE_PACKS` for `bootstrap5` compatibility - Set dummy `ADMIN_USERNAME`/`ADMIN_PASSWORD` for FAS `AccountSystem` - Create `conftest.py` with autouse fixtures to mock `publish()`, `AccountSystem.people_query()`, and provide a stub `STATIC_ROOT` Changes to CI pipeline: - Remove `postgres:15` and `redis:7` service containers - Remove `gcc`/`libpq-dev` system dependency step Bug fixes surfaced by the new test environment: - Replace stale `import ckeditor.fields` in migration 0007 with `models.TextField` (old `django-ckeditor` removed in Phase 5) - Pass `link_rel=None` to `nh3.clean()` to fix `ValueError` when `'rel'` is in `allowed_attributes` (nh3 >= 0.2.18 API change) Closes #281. Assisted-by: Claude Opus 4.6 (1M context) Signed-off-by: Justin Wheeler <jwheel@fedoraproject.org> |
||
|---|---|---|
| .forgejo | ||
| assets | ||
| docs | ||
| happinesspacket_schema_package | ||
| happinesspackets | ||
| openshift | ||
| templates | ||
| .containerignore | ||
| .coveragerc | ||
| .env.example | ||
| .gitignore | ||
| AGENTS.md | ||
| config.toml | ||
| conftest.py | ||
| Containerfile | ||
| fas-admin-details.json.example | ||
| LICENSE | ||
| manage.py | ||
| podman-compose.yml | ||
| poetry.lock | ||
| pyproject.toml | ||
| README.md | ||
fedora-happiness-packets
Fedora Happiness Packets is a Django web application that enables Fedora community members to send anonymous appreciation messages.
It integrates with the Fedora Account System (FAS) for user lookup, Fedora OIDC for authentication, and fedora-messaging for publishing events to the Fedora message bus.
Current stack: Django 5.1, Python 3.12–3.14, Poetry, PostgreSQL, Redis, Celery, Bootstrap 5.3, CKEditor 5.
Modernization Roadmap
This project was dormant from 2021 to 2026 and is undergoing an incremental modernization effort to bring it back into production as an OpenShift-native containerized application within Fedora's infrastructure.
Completed
- Phase 0: Dead code removal and housekeeping
- Phase 1: Django 2.0 → 5.1 upgrade (four incremental LTS steps) and deprecated package replacement
- Phase 2: Pipenv → Poetry migration,
pyproject.toml, v1.0.0 release - Phase 2.5: Forgejo Actions CI pipeline (lint + test)
- Phase 3: Containerfile and Podman migration (replace Docker)
- Phase 4: Settings refactoring (12-factor env vars, eliminate config files)
- Phase 5: Frontend modernization (Bootstrap 5.3, self-hosted fonts, CKEditor 5, jQuery removed)
Upcoming
- Phase 6: OpenShift-native manifests (Kustomize, health probes, Routes)
- Phase 7: Search backend replacement (Haystack/Whoosh → PostgreSQL full-text search)
- Phase 8: Fedora integration updates (OIDC JWKS discovery, FAS/Noggin API, Redis → Valkey)
- Phase 9: Forgejo Package Registry and CI/CD (container images, RPM packaging)
- Phase 10: Production hardening (CSP, HSTS, observability, Celery tuning)
Development
Prerequisites
- Python 3.12+
- Poetry
- Podman and podman-compose (for running services locally)
Quick start
# Install dependencies
poetry install --without docs
# Copy environment template
cp .env.example .env
# Start services (PostgreSQL, Redis, Celery, RabbitMQ)
podman-compose up --build
# Run migrations (in a separate terminal)
podman-compose exec web python manage.py migrate
See .env.example for all available environment variables.
Testing and linting
# Run all tests with coverage
poetry run pytest
# Run a specific test file
poetry run pytest happinesspackets/messaging/tests/test_views.py
# Lint
poetry run ruff check .
Note: Tests that require a database will fail without a running PostgreSQL instance.
Use podman-compose or configure DB_HOST to point to an available database.
The test settings module is happinesspackets.settings.tsting (intentionally misspelled to avoid import during test discovery).
Where to find us
- Chat: Fedora Community Ops on Matrix
- Issues: Forgejo issue tracker
- Community: Fedora Community Operations
Contributing
Contributions are welcome. Please file issues and pull requests on our Forgejo repository.
See AGENTS.md for detailed architecture documentation and conventions.
Legal
This project is licensed under the Apache License 2.0.