Conversation
Signed-off-by: tym83 <6355522@gmail.com>
✅ Deploy Preview for cozystack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR refactors the OSS health and telemetry data refresh infrastructure. GitHub Actions workflows now use dedicated branches ( ChangesOSS Health & Telemetry Refresh Pipeline
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the project's OSS health and telemetry data, refreshing metrics for commits, contributors, and issues across multiple JSON data files. Key changes include updating the Makefile to automate telemetry fetching, switching the OpenSSF status URL to English, and improving the parsing of the OpenSSF last updated date by stripping HTML tags. Feedback was provided to enhance the robustness of the HTML parsing logic in hack/update_oss_health.py by unescaping entities and normalizing whitespace to ensure consistent regex matching.
| plain_text = re.sub(r"<[^>]+>", " ", page_text) | ||
| match = re.search(r"last updated on\s+(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} UTC)", plain_text, re.IGNORECASE) |
There was a problem hiding this comment.
The HTML stripping and regex matching for the OpenSSF last updated date could be more robust. Normalizing whitespace after stripping tags and unescaping HTML entities (like ) ensures the regex matches correctly even if the source formatting varies or contains non-breaking spaces.
| plain_text = re.sub(r"<[^>]+>", " ", page_text) | |
| match = re.search(r"last updated on\s+(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} UTC)", plain_text, re.IGNORECASE) | |
| plain_text = " ".join(unescape(re.sub(r"<[^>]*>", " ", page_text)).split()) | |
| match = re.search(r"last updated on\s+(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} UTC)", plain_text, re.IGNORECASE) |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@hack/update_oss_health.py`:
- Around line 360-361: The regex for matching "last updated on ..." can fail
when HTML tag removal leaves extra/newline whitespace inside the timestamp;
after stripping tags into plain_text (variable plain_text produced by re.sub),
normalize whitespace (e.g., collapse all runs of whitespace to a single space
using re.sub(r"\s+", " ", plain_text)) before calling re.search so the timestamp
pattern in match reliably finds "YYYY-MM-DD HH:MM:SS UTC"; update the code
around plain_text and match to normalize whitespace prior to the re.search call.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: bc0b7d45-a905-4a29-9f55-5962e1bde124
📒 Files selected for processing (14)
.github/workflows/fetch-telemetry.yml.github/workflows/update-oss-health.yamlMakefiledata/oss-health/devstats.jsondata/oss-health/openssf.jsondata/oss-health/ossinsight.jsondata/oss-health/summary.jsonhack/fetch_telemetry.pyhack/update_oss_health.pystatic/oss-health-data/devstats.jsonstatic/oss-health-data/openssf.jsonstatic/oss-health-data/ossinsight.jsonstatic/oss-health-data/summary.jsonstatic/oss-health-data/telemetry.json
Signed-off-by: tym83 <6355522@gmail.com>
Summary
Root Cause
Verification
Summary by CodeRabbit
Chores
Bug Fixes
Documentation