Skip to content
Snippets Groups Projects
Unverified Commit cbbcf4c8 authored by John Swanson's avatar John Swanson Committed by GitHub
Browse files

Add an API to get stale dashboards and cards (#44711)


* Make an internal API for retrieving stale content

This introduces the `metabase.stale` module, which has one public
function (so far): `metabase.stale/find-candidates`. This takes a set of
`collection-ids`, a cutoff date, and pagination/sort info.

Next, we introduce an HTTP API endpoint that will figure out the appropriate
set of `collection-ids` for a given user/request, call this function,
and return the results in the shape we want.

Also: for e2e tests, we need a way to mark a card or dashboard as stale. I
think the easiest way to do this is to just create a testing endpoint
that we can call to update the `last_used_at` or `last_viewed_at` of the
card/dashboard to set it to ~7 months ago.


---------

Co-authored-by: default avatarbryan <bryan.maass@gmail.com>
parent c364cd21
Branches
Tags
No related merge requests found
Showing
with 1065 additions and 20 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment