Fix critical bugs in app_urls #1

Open
matitos wants to merge 5 commits from fix-critical-bugs into main
pull from: fix-critical-bugs
5 Commits
Author SHA1 Message Date
Luciano Gervasoniandopencode c7104ad8f0 Filter out git+https dependencies in CI
Tests / test (pull_request) Successful in 7m2s
The Gitea runner can't clone github.com repos via pip.
Since the tests don't need Search-Engines-Scraper, exclude
git+ lines from requirements during CI install.

Co-Authored-By: opencode <noreply@opencode.ai>
2026-09-02 12:06:37 -03:00
Luciano Gervasoniandopencode 9323afd68f Make optional search imports lazy to avoid GitHub dependency in CI
Tests / test (pull_request) Failing after 3m29s
Wrap gnews, GoogleNews, and search_engines imports in try/except
so the module loads without those packages installed. This allows
the test suite to run on the Gitea runner without outbound GitHub
access.

Also revert requirements.txt back to the GitHub URL for the
Search-Engines-Scraper dependency.

Co-Authored-By: opencode <noreply@opencode.ai>
2026-09-02 12:00:14 -03:00
Luciano Gervasoniandopencode fa9d552873 Point Search-Engines-Scraper dependency to Gitea mirror
Tests / test (pull_request) Successful in 7m9s
The Gitea CI runner has no outbound access to github.com.
Mirror the repository on the local Gitea instance so pip install
succeeds in CI.

Co-Authored-By: opencode <noreply@opencode.ai>
2026-09-02 11:39:31 -03:00
Luciano Gervasoni d18eda2fc4 Add unit tests and Gitea CI workflow for bug fixes
Tests / test (pull_request) Failing after 3m11s
- Add fetcher/tests/ with 21 tests covering all bug fixes:
  - test_utils: get_with_protocol URL normalization (5 tests)
  - test_config: scheduled_tasks.json PK uniqueness, Celery queue
    settings (7 tests)
  - test_publish: URL routing and view for /task/publish_<id>/ (4 tests)
  - test_template_field: url_detail.html renders images_url field (2 tests)
  - test_search_postprocess: URL host filtering and param stripping (3 tests)
- Replace empty fetcher/tests.py with tests/ package
- Add .gitea/workflows/test.yml: runs on PRs and pushes to main,
  installs dependencies and runs `manage.py test fetcher.tests`
2026-09-02 09:42:07 -03:00
Luciano Gervasoni 3a33697ca3 Fix critical bugs in app_urls
- init_db.py: parameterize SQL queries to prevent SQL injection
- scheduled_tasks.json: resolve duplicate periodic task pk (4 -> 15)
- db_utils.py: use function parameter in _get_status_pattern_matching
  instead of capturing the enclosing scope variable
- url_detail.html: fix wrong field name image_urls -> images_url
- settings.py: align Celery queues (default/light/heavy) with the task
  queues and supervisord workers
- Add /task/publish_<id>/ route to fix broken publish links in templates
2026-09-01 15:08:14 -03:00