Skip to content

feat(api): persist RWEB best practices with catalog and result tables - #161

Merged
vvatelot merged 2 commits into
mainfrom
feat/scraper-rweb-best-practices
Oct 5, 2026
Merged

vvatelot merged 2 commits into
mainfrom
feat/scraper-rweb-best-practices

Conversation

@vvatelot

@vvatelot vvatelot commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Static Badge

Summary

  • Persist RWEB best practices analysis in two tables: catalog (apiecoindexbestpractices) synced from YAML rules, and per-analysis results (apiecoindexbestpracticeresults) with threshold snapshots
  • Wire worker persistence behind include_best_practices, and expose GET /{id}/best-practices
  • Add Alembic migration and repository/API tests

Test plan

  • Run Alembic upgrade and confirm both tables are created
  • Create an analysis with include_best_practices=true and verify catalog sync + result rows
  • Call GET /v1/ecoindexes/{id}/best-practices and check payload / 204 when not collected
  • Run test/components/ecoindex/database/test_repository_queries.py

Made with Cursor

Store best-practice definitions and per-analysis evaluation snapshots,
expose them via GET /ecoindexes/{id}/best-practices, and opt in with
include_best_practices on task creation.

Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid an explicit column equality onclause that ty types as bool.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Coverage PR 161

Branch coverage •
FileStmtsMissCoverMissing
bases/ecoindex/backend/routers
   ecoindex.py572065%78, 91, 99, 101, 122, 126–127, 131, 212, 216–217, 222, 225–226, 228, 241–242, 247–248, 254
   tasks.py885439%50–51, 56–58, 112–113, 117–118, 121, 125, 130–131, 134, 136–137, 142–144, 149, 156, 167, 184–187, 192–194, 196, 203–204, 206, 208–209, 211–212, 214, 216, 228–231, 261, 268, 286–289, 294, 296, 301–302, 304
bases/ecoindex/worker
   tasks.py714537%35–38, 49, 61, 73–77, 86, 88, 99–100, 108, 112–113, 115, 123, 125–126, 137–138, 149–150, 161–162, 164–165, 179–180, 194, 201, 214, 221, 227–229, 231–232, 240, 242–243, 248
components/ecoindex/database
   engine.py16569%26–27, 31, 36–37
components/ecoindex/database/models
   __init__.py870100% 
components/ecoindex/database/repositories
   best_practices.py351266%21–31, 62
   ecoindex.py694042%47, 57, 59, 72, 79–81, 83–87, 89, 91, 93, 99, 105, 107, 124, 129–132, 134–137, 154–159, 161, 170, 174, 176, 180, 187, 189
   worker.py27389%82–84
TOTAL205758871% 

@vvatelot vvatelot self-assigned this Oct 5, 2026
@vvatelot
vvatelot merged commit 4a12030 into main Oct 5, 2026
15 of 18 checks passed
@vvatelot
vvatelot deleted the feat/scraper-rweb-best-practices branch October 5, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant