Repository navigation
feat(adoption-insights): add estimated time saved insights for Scaffolder runs - #5426
djanickova wants to merge 9 commits into
Conversation
Signed-off-by: Diana Janickova <djanicko@redhat.com>
Signed-off-by: Diana Janickova <djanicko@redhat.com>
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5426 +/- ##
==========================================
+ Coverage 65.35% 65.39% +0.04%
==========================================
Files 2758 2758
Lines 110579 110678 +99
Branches 31085 31109 +24
==========================================
+ Hits 72264 72373 +109
+ Misses 37739 37729 -10
Partials 576 576
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 3:33 PM UTC · Completed 4:00 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $8.59 |
|
Risk Assessment: moderate (2/5) DetailsFeature addition across 16 files with a large blast radius and 911 lines of change, but limited to a single low-churn plugin workspace with one recent author, solid test coverage (38%), no security-sensitive paths, and no regression history — composite 1.68 rounds to moderate (2). Previous runRisk Assessment: moderate (2/5) DetailsA moderate-sized feature addition (13 files, ~400 lines) confined to the adoption-insights workspace with no protected paths, no security-sensitive changes, a reasonable test ratio (0.38), and negligible recent churn on the affected files. |
ReviewFindingsLow
Next steps:
Previous runReviewFindingsMedium
Low
Next steps:
|
Signed-off-by: Diana Janickova <djanicko@redhat.com>
Signed-off-by: Diana Janickova <djanicko@redhat.com>
Signed-off-by: Diana Janickova <djanicko@redhat.com>
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 3:19 PM UTC · Completed 3:46 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $7.84 |
Signed-off-by: Diana Janickova <djanicko@redhat.com>
Signed-off-by: Diana Janickova <djanicko@redhat.com>
|
Seems like the sonarqube check did not run on the latest commit? The two new issues are outdated |
PR Summary by QodoAdd catalog-backed time-saved insights for Scaffolder runs
AI Description
Diagram
High-Level Assessment
Files changed (16)
|
|
Important The |
Signed-off-by: Diana Janickova <djanicko@redhat.com>
|
Just addressed the high and medium points from Qodo's review. I hardened
Note: validation is now all-or-nothing per batch (previously valid events before the first invalid one could be partially persisted). Documented in the README/changeset and covered by new tests. |
Signed-off-by: Diana Janickova <djanicko@redhat.com>
|



Hey, I just made a Pull Request!
RHIDP-15190
This adds estimated time saved to the Adoption Insights backend. For each newly created Scaffolder task, the backend reads the template’s
backstage.io/time-savedannotation from the catalog and stores the estimate in minutes with the analytics event. The estimate is taken from the catalog, not from the value submitted by the browser. New events are associated with the signed-in Backstage user.GET /api/adoption-insights/events?type=time_savedquery returns totals for the requested date range:minutes: sum of available estimatesruns: Scaffolder tasks createdruns_with_estimate: tasks created from templates with a valid estimateA missing or invalid estimate still counts as a run, but adds no minutes. Runs are counted when Scaffolder creates a task, before it completes; a task that later fails or is cancelled still contributes its estimate.
The existing
type=top_templatesresponse also includesrunsandminutesfor each template. Its existingcountandlast_usedfields retain their meaning: clicks on the wizard’s final Create button, which occur before the task creation request. A failed submission can therefore increasecountwithout increasingruns.Top Templates still ranks by those clicks by default. The optional
sort_by=runsranks by created task runs instead;limitapplies to the selected ranking. Stored minutes preserve the estimate from each run, so editing an annotation does not recalculate earlier savings.How to test
yarn start./createand submit the template.Expected behavior:
PT15M, one created task adds 15 tominutes, 1 toruns, and 1 toruns_with_estimate. Its Top Templates row gains 1runand 15minutes; with the default button label,countalso increases by 1.runsbut does not increaseminutesorruns_with_estimate.PT1H30M, a created task adds 90 minutes. WithPT0M, it adds zerominutesbut increasesruns_with_estimate.PT15MtoPT30M, one submission at each value totals 45 minutes. The earlier event retains its recorded estimate.sort_by=clicksgives the same ordering as omittingsort_by;sort_by=runsorders templates by created tasks. Normal successful submissions may produce the same ordering in both modes. To observe a difference, a final Create click whose task creation request fails increasescount but notruns.For a single
PT15Mrun in an otherwise empty range,type=time_savedreturns:{ "data": [ { "minutes": 15, "runs": 1, "runs_with_estimate": 1 } ] }✔️ Checklist