feat: add trend indicators to PR comments and CI summary#28
Merged
Conversation
Computes pass rate direction/delta, duration direction/delta, and test count delta from history (>=3 runs). Extracts shared buildSparkline() from perf-regression.ts; sparklines shown when >=5 runs. PR comments: trend line below stats showing arrows + deltas. CI summary: Trends section with sparklines, arrows, and deltas. All errors non-blocking via core.debug().
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds at-a-glance trend indicators to PR comments and CI summaries using cached history. When 3+ runs exist, trend arrows (↑ → ↓) and deltas appear for pass rate, duration, and test count. When 5+ runs exist, ASCII sparklines are also shown.
Changes
src/history/types.ts— addedTrendDirectiontype andTrendIndicatorsinterfacesrc/history/trends.ts(new) —computeTrends()function + sharedbuildSparkline()helpersrc/history/perf-regression.ts— refactoredbuildDurationSparkline()to use sharedbuildSparkline()src/output/pr-comment.ts— addedrenderTrendLine(), wired intorenderTestJobSection()below stats linesrc/output/summary.ts— addedrenderTrendsSection(), inserted after metrics table ingenerateSummary()src/index.ts— compute trends when ≥3 entries, non-blocking try/catch, pass to summary + PR commentPR comment format:
CI summary format (with sparklines):
Test plan
history: false