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. |
📝 WalkthroughWalkthroughPull request updates GitHub Actions workflows to automate monthly OSS health and telemetry snapshot collection, refresh, and PR creation with change detection. Build configuration invokes Python scripts via explicit ChangesOSS Health & Telemetry Refresh Pipeline
🎯 3 (Moderate) | ⏱️ ~25 minutes
🚥 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>
Signed-off-by: tym83 <6355522@gmail.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
layouts/_default/oss-health-app.html (1)
164-176: ⚡ Quick win
renderTimeseriesstill readspayload.periods[name].labelwithout a guard
renderTelemetrywas hardened by switching to staticlabels, butrenderTimeseries(unchanged) still callspayload.periods[name].labelwhile iterating the fullorderarray with no existence check. If a DevStats / OSS Insight snapshot ever omits one of the three periods, this throws aTypeErrorand leaves the view blank. Aligning it with the pattern introduced here would close that gap.♻️ Suggested defensive fix for
renderTimeseriesconst renderTimeseries = (payload) => { const order = ["month", "quarter", "year"]; + const labels = { month: "Month", quarter: "Quarter", year: "Year" }; + const available = order.filter((name) => payload.periods[name]); let active = "month"; const renderActive = () => { const period = payload.periods[active]; const controls = ` <div class="oss-health-switcher" role="tablist" aria-label="Report period"> - ${order.map((name) => ` + ${available.map((name) => ` <button class="oss-health-switcher__button${name === active ? " is-active" : ""}" data-period="${name}" role="tab" aria-selected="${name === active ? "true" : "false"}"> - ${escapeHtml(payload.periods[name].label)} + ${labels[name]} </button> `).join("")} </div> `;🤖 Prompt for 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. In `@layouts/_default/oss-health-app.html` around lines 164 - 176, renderTimeseries currently assumes payload.periods[name] exists when iterating order (["month","quarter","year"]) and calling payload.periods[name].label, which can throw if a period is missing; update renderTimeseries to first filter order to only include names present in payload.periods (e.g. const available = order.filter(n => payload.periods && payload.periods[n])) and use available for rendering and mapping, default active to available[0] when the initial "month" is absent, and when rendering labels use a safe fallback (payload.periods[name].label || payload.periods[name].fallbackLabel || name) so renderActive, the controls button generation and aria/selected logic all operate only over existing payload.periods entries.
🤖 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.
Nitpick comments:
In `@layouts/_default/oss-health-app.html`:
- Around line 164-176: renderTimeseries currently assumes payload.periods[name]
exists when iterating order (["month","quarter","year"]) and calling
payload.periods[name].label, which can throw if a period is missing; update
renderTimeseries to first filter order to only include names present in
payload.periods (e.g. const available = order.filter(n => payload.periods &&
payload.periods[n])) and use available for rendering and mapping, default active
to available[0] when the initial "month" is absent, and when rendering labels
use a safe fallback (payload.periods[name].label ||
payload.periods[name].fallbackLabel || name) so renderActive, the controls
button generation and aria/selected logic all operate only over existing
payload.periods entries.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: df77ddcf-14e8-4b98-8323-132fba9c7161
📒 Files selected for processing (4)
.github/workflows/fetch-telemetry.ymlMakefilehack/fetch_telemetry.pylayouts/_default/oss-health-app.html
✅ Files skipped from review due to trivial changes (1)
- hack/fetch_telemetry.py
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/fetch-telemetry.yml
Summary
Root Cause
Verification
Summary by CodeRabbit
Data Updates
UI Improvements
Bug Fixes