feat(api): support stored request details for analyses - #154
Merged
Conversation
Developers can now pick sqlite, mysql, or postgres at startup through a single DB_ENGINE setting, with Docker Compose profiles and local dev containers aligned on the same configuration. Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(api): support emoji and punycode domains in analysis tasks WebPage validation stores URLs as Unicode, which breaks requests for emoji domains like xn--3s8h30f.ws. Use AnyHttpUrl for punycode conversion and pass the encoded URL to the worker queue. Fixes cnumr/EcoIndex#416 Co-authored-by: Cursor <cursoragent@cursor.com> * fix(api): include request error details when URL pre-check fails Expose SSL, timeout, and DNS errors in the unreachable URL response instead of empty parentheses. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
Use an empty default and resolve it in the model validator so type checkers accept Settings().DATABASE_URL where a str is required. Co-authored-by: Cursor <cursoragent@cursor.com>
Alembic needs projects/ecoindex_api as the working directory so it can find alembic.ini and load the local .env during init-dev-project. Co-authored-by: Cursor <cursoragent@cursor.com>
Ensure mysql/postgres containers are up before migration-upgrade and document which DB_HOST to use for local dev versus Docker Compose. Co-authored-by: Cursor <cursoragent@cursor.com>
Store per-request resource details behind an opt-in task flag so analyses can expose aggregated request breakdowns by category and domain without persisting query parameters. Co-authored-by: Cursor <cursoragent@cursor.com>
Duplicate test definitions introduced during merge caused ruff F811 failures in CI. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/{version}/ecoindexes/{id}/requestsendpoint that aggregates stored items by category and domainTest plan
PYTHONPATH=bases:components uv run pytest test/components/ecoindex/models/test_scraper.py test/components/ecoindex/database/test_repository_queries.py test/components/ecoindex/scraper/test_scraper.py test/bases/ecoindex/backend/test_tasks.py -qalembic upgrade headin a local API environmentinclude_requests_detail=trueand verifyGET /v1/ecoindexes/{id}/requestsMade with Cursor