feat: add the ship funnel stats page - #1357
Merged
Merged
Conversation
A Sankey of every shipped hour, left to right through ship review (Shipwrights, or build review for hardware), GOI, the fraud check and Airtable, split into Unified, the final-pass queue, errors and collisions by reading the submission table. It toggles between software, hardware or both and between hours and ships, and can add a devlogged column in front for hours that never reached a ship. Loops the chart can't draw are counted underneath. Cached for an hour and recomputed on demand, like the hour funnel. Admin only.
Brakeman flagged the loop counts as a possible SQL injection. The only interpolated value was an enum integer, but plain ActiveRecord queries work too, so no problem
Move the Ship Funnel from /admin/ship_funnel to /stats/ship_funnel so anyone can view it, as Max approved. Only admins see the Update button and the link back to /admin. - Rename Admin::ShipFunnel to ShipFunnel, cached for 2 hours - Add ShipFunnelRefreshJob, run hourly from recurring.yml, so viewers who aren't admins read the cached numbers instead of computing them - Show a "check back in a minute" note while the cache is empty - Merge the admin view and partial into a single page - Move the styles out of admin.scss and reset the toggle borders that public pages pick up - Pull the Sankey node padding out into a NODE_PADDING constant - Link to the page from /admin, shown to admins only
Contributor
Author
|
make it public! |
cskartikey
approved these changes
Sep 30, 2026
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.
what's this do?
adds a new public stats page, the ship funnel (
/stats/ship_funnel, linked from /admin next to Hour Funnel). it's a sankey of every shipped hour and where it is now: devlogged (optional), shipped, ship review, GOI, fraud check, airtable, and then final pass/ unified.it's self-contained: its own service, controller, policy, view, stimulus controller, job and stylesheet. a job recomputes it every hour and caches it for 2. anyone can view it, only admins see the recompute button.
some stuff will still be janky until #1355 is merged
show it works
ai?
claude code