Skip to content

feat(scraper): add RWEB best-practices waves 1 and 2 - #163

Merged
vvatelot merged 2 commits into
mainfrom
feat/best-practices-wave1-2
Oct 7, 2026
Merged

vvatelot merged 2 commits into
mainfrom
feat/best-practices-wave1-2

Conversation

@vvatelot

@vvatelot vvatelot commented Oct 7, 2026

Copy link
Copy Markdown
Member

Static Badge

Summary

  • Enrich HAR parsing with HTTP version, cache headers, content-encoding, and cookie header size
  • Expand the default best-practices set from 4 to 14 automated checks (waves 1 and 2), aligned with GreenIT-Analysis and RWEB
  • Add datacenter rule category and register the best_practices brick in the monorepo

New rules

  • Wave 1: RWEB_0032 fonts, RWEB_0035 stylesheets, RWEB_0059 social buttons, RWEB_0099 GIFs, HTTP errors
  • Wave 2: RWEB_0075 cache headers, RWEB_0076 compression, RWEB_0081 cookie-free static domain, RWEB_0083 HTTP/2, RWEB_0112 redirects

Test plan

  • uv run pytest test/components/ecoindex/best_practices/ -q
  • Run an analysis with include_best_practices: true and confirm GET /v1/ecoindexes/{id}/best-practices returns the new rules
  • Spot-check fail/warn/ok statuses against a page with known HTTP/1, redirects, or social widgets

Made with Cursor

Enrich HAR parsing with cache/compression/HTTP version/cookie signals
and expand the default rule set from 4 to 14 automated checks aligned
with GreenIT-Analysis and the RWEB référentiel.

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

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Coverage PR 163

Branch coverage •
FileStmtsMissCoverMissing
components/ecoindex/best_practices
   har_utils.py932573%51–60, 70, 72, 122–126, 132–135, 137–139, 158
   models.py600100% 
components/ecoindex/best_practices/rules
   network.py78297%51, 201
components/ecoindex/database/models
   __init__.py870100% 
components/ecoindex/models
   scraper.py750100% 
components/ecoindex/scraper
   scrap.py1434668%97, 105, 108–109, 111, 123, 140, 143, 147–148, 159–167, 170–176, 178–180, 182, 189–190, 194, 197–198, 201–207, 210, 270–271, 273
TOTAL222761372% 

Comment thread components/ecoindex/best_practices/har_utils.py Fixed
…ring sanitization'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@vvatelot
vvatelot merged commit 5013ad6 into main Oct 7, 2026
6 checks passed
@vvatelot
vvatelot deleted the feat/best-practices-wave1-2 branch October 7, 2026 08:38
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.

2 participants