• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Unleash / unleash / 11739780691

08 Nov 2024 09:45AM UTC coverage: 87.751% (-0.03%) from 87.777%
11739780691

push

github

web-flow
feat: Add lifecycle summary info read model + average time spent in lifecycle query (#8691)

This PR adds a project lifecycle read model file along with the most
important (and most complicated) query that runs with it: calculating
the average time spent in each stage.

The calculation relies on the following:
- when calculating the average of a stage, only flags who have gone into
a following stage are taken into account.
- we'll count "next stage" as the next row for the same feature where
the `created_at` timestamp is higher than the current row
- if you skip a stage (go straight to live or archived, for instance),
that doesn't matter, because we don't look at that.

The UI only shows the time spent in days, so I decided to go with
rounding to days directly in the query.

## Discussion point:

This one uses a subquery, but I'm not sure it's possible to do without
it. However, if it's too expensive, we can probably also cache the value
somehow, so it's not calculated more than every so often.

2751 of 3574 branches covered (76.97%)

10 of 14 new or added lines in 1 file covered. (71.43%)

2 existing lines in 2 files now uncovered.

14213 of 16197 relevant lines covered (87.75%)

706.98 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

71.43
/src/lib/features/project-status/project-lifecycle-summary-read-model.ts


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc