Refactor duplicated pkg/cli outcome and stats helpers - #51948
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Consolidates duplicated evaluator, statistics, and trial-result helpers while preserving existing behavior.
Changes:
- Centralizes comment counting, close provenance, and label extraction.
- Groups shared statistics helpers and improves median sorting.
- Separates trial-result logic from trial type declarations and adds focused tests.
Show a summary per file
| File | Description |
|---|---|
pkg/cli/trial_types.go |
Retains trial type declarations only. |
pkg/cli/trial_result_helpers.go |
Houses trial aggregation, extraction, and sanitization helpers. |
pkg/cli/stats_helpers.go |
Centralizes shared statistical functions. |
pkg/cli/stats_helpers_test.go |
Tests percentage edge cases. |
pkg/cli/outcome_eval.go |
Shares label conversion and removes local median logic. |
pkg/cli/outcome_eval_test.go |
Tests consolidated outcome helpers. |
pkg/cli/outcome_eval_pr.go |
Uses shared human-comment counting. |
pkg/cli/outcome_eval_issue.go |
Uses shared comment and close-provenance helpers. |
pkg/cli/outcome_eval_helpers.go |
Defines common outcome-evaluation helpers. |
pkg/cli/outcome_eval_generic.go |
Delegates lifecycle close lookup. |
pkg/cli/outcome_eval_comment.go |
Uses shared reply counting. |
pkg/cli/forecast_montecarlo.go |
Removes relocated statistics helpers. |
pkg/cli/audit_math_helpers.go |
Removes relocated percentage calculation. |
Review details
Tip
Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 13/13 changed files
- Comments generated: 0
- Review effort level: Balanced
|
@copilot Quick triage nudge for this PR. The branch has already been refreshed for a follow-up pass. Please review the latest state, check for any unresolved review feedback or failing checks, and run the
|
Triage: Refactor duplicated pkg/cli outcome and stats helpers
Notes: CI green (all checks passing), AI reviewer left comments (unresolved). Behavior-preserving refactor with new focused tests, but touches shared eval helpers used repo-wide — warrants human review before merge, not auto-merge.
|
|
@copilot Quick triage nudge for this PR. The branch was already refreshed recently. Please review the latest state, check for any unresolved review feedback or failing checks, and run the
|
|
@copilot Quick triage nudge for this PR. A recent sous-chef nudge already exists on this PR, so this run is recording it as skipped for cooldown/duplicate handling.
|
PR Triage
|
|
🎉 This pull request is included in a new release. Release: |
pkg/clihad duplicated outcome-evaluation logic across issue, PR, and comment evaluators, plus scattered helper functions in unrelated files. This refactor consolidates those helper clusters while preserving existing evaluator behavior.Statistics helpers
stats_helpers.go.slices.Sort.Trial result helpers
trial_types.go.Focused coverage
Run: https://github.com/github/gh-aw/actions/runs/31469629212> Generated by 👨🍳 PR Sous Chef · gpt54 · 9.98 AIC · ⌖ 5.15 AIC · ⊞ 8.5K · ◷