0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-11 02:59:07 +08:00
discourse/plugins/discourse-data-explorer/lib
Rafael dos Santos Silva 7b025265d2
FEATURE: Add 25 default data explorer queries for traffic, health, moderation and audits (#41571)
Previously, the data explorer shipped only 19 default queries, mostly
focused on user engagement curiosities, leaving the most common admin
needs — traffic reporting, community health trends, moderation
reporting, and permission/promotion audits — to be rediscovered over and
over in Meta support topics.

This change adds 25 curated default queries (ids `-20` to `-44`)
covering those areas, sourced from Meta's saved query library and
staff-authored answers in support topics, with stale hardcoded values
generalized into parameters and known bugs fixed (overlapping histogram
buckets, admin-only staff filters, row-multiplying joins replaced with
`reviewable_scores`-based logic). Queries that depend on optional
features (locale detection, browser pageview collection) carry an
explicit warning in their description naming the required setting.

Beyond being directly useful, the set is deliberately written as a
learning corpus for the AI agent that helps admins create new queries
(and for humans modifying them): together they demonstrate nearly every
parameter type and the common patterns — relative time windows, gapless
`generate_series` series, `FILTER` aggregates, anti-joins, window
functions, nullable optional filters — with inline comments decoding
non-obvious internals such as `user_histories` action codes and bot
account id conventions.

All 25 queries are verified to execute against a live database, and the
rebuilt flag reports were smoke-tested with real flag data.

---------

Co-authored-by: Natalie Tay <1555215+nattsw@users.noreply.github.com>
2026-07-09 12:58:39 -03:00
..
discourse_data_explorer FEATURE: Add 25 default data explorer queries for traffic, health, moderation and audits (#41571) 2026-07-09 12:58:39 -03:00
tasks FIX: Enforce max limit for data explorer queries (#38320) 2026-03-06 14:43:43 +08:00