Analyze new job labels and run tracking for regressions - #427
Conversation
WalkthroughThe CI plugin version is bumped from 0.0.37 to 0.0.38 across configuration files. The regression analysis workflow is refactored to leverage aggregated job run data from the API instead of separate fetch calls, changing matching semantics from timestamp-based to job-run-based comparison for related regressions. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 10✅ Passed checks (10 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
plugins/ci/skills/fetch-related-triages/SKILL.md (1)
108-108: Consider documenting the match_reason name retention.The
match_reasonvalue remainssame_last_failurebut the matching semantics changed to usejob_runs. This could confuse consumers expecting the name to reflect the actual matching logic. Consider either adding a note explaining this is for backward compatibility, or updating the API to use a more accurate name likesame_job_runsin a future version.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@plugins/ci/skills/fetch-related-triages/SKILL.md` at line 108, Document that match_reason "same_last_failure" is retained for backward compatibility even though matching now uses the job_runs history; update the SKILL.md entry for same_last_failure to add a brief note stating the semantics now rely on the job_runs field and suggest using a new name such as "same_job_runs" in a future API version; reference the match_reason field and the job_runs history in the note so readers can find the related logic and plan for migration.plugins/ci/skills/fetch-regression-details/fetch_regression_details.py (1)
463-476: Redundant conditional check.The
if job_runs:check on line 470 is unnecessary since we're already inside theif job_runs:block from line 465.♻️ Proposed fix
job_runs = regression.get('job_runs', []) if job_runs: lines.append(f"Job Runs ({len(job_runs)} total across regression lifetime):") high_failure_count = sum(1 for r in job_runs if r.get('test_failures', 0) > 10) if high_failure_count: lines.append(f" Runs with mass failures (>10 test failures): {high_failure_count}/{len(job_runs)}") - if job_runs: - oldest = job_runs[-1] - newest = job_runs[0] - oldest_date = oldest['start_time'].split('T')[0] if 'T' in oldest['start_time'] else oldest['start_time'] - newest_date = newest['start_time'].split('T')[0] if 'T' in newest['start_time'] else newest['start_time'] - lines.append(f" Date range: {oldest_date} to {newest_date}") + oldest = job_runs[-1] + newest = job_runs[0] + oldest_date = oldest['start_time'].split('T')[0] if 'T' in oldest['start_time'] else oldest['start_time'] + newest_date = newest['start_time'].split('T')[0] if 'T' in newest['start_time'] else newest['start_time'] + lines.append(f" Date range: {oldest_date} to {newest_date}") lines.append("")🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@plugins/ci/skills/fetch-regression-details/fetch_regression_details.py` around lines 463 - 476, Remove the redundant nested check for job_runs inside the outer if block: you are already inside the "if job_runs:" branch, so delete the inner "if job_runs:" condition and dedent its body (the assignment of oldest/newest, date parsing using oldest['start_time'] and newest['start_time'], and the lines.append for the date range) so that those statements run directly under the outer block; keep the high_failure_count logic and final blank line as-is.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@plugins/ci/skills/fetch-regression-details/fetch_regression_details.py`:
- Around line 463-476: Remove the redundant nested check for job_runs inside the
outer if block: you are already inside the "if job_runs:" branch, so delete the
inner "if job_runs:" condition and dedent its body (the assignment of
oldest/newest, date parsing using oldest['start_time'] and newest['start_time'],
and the lines.append for the date range) so that those statements run directly
under the outer block; keep the high_failure_count logic and final blank line
as-is.
In `@plugins/ci/skills/fetch-related-triages/SKILL.md`:
- Line 108: Document that match_reason "same_last_failure" is retained for
backward compatibility even though matching now uses the job_runs history;
update the SKILL.md entry for same_last_failure to add a brief note stating the
semantics now rely on the job_runs field and suggest using a new name such as
"same_job_runs" in a future API version; reference the match_reason field and
the job_runs history in the note so readers can find the related logic and plan
for migration.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c20347cc-47a7-4cff-b388-ebf5814fa64d
📒 Files selected for processing (7)
.claude-plugin/marketplace.jsondocs/data.jsonplugins/ci/.claude-plugin/plugin.jsonplugins/ci/commands/analyze-regression.mdplugins/ci/skills/fetch-regression-details/SKILL.mdplugins/ci/skills/fetch-regression-details/fetch_regression_details.pyplugins/ci/skills/fetch-related-triages/SKILL.md
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dgoodwin, stbenjam The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary by CodeRabbit
New Features
Chores