Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an API to get stale dashboards and cards #44711

Merged
merged 23 commits into from
Jul 30, 2024
Merged

Add an API to get stale dashboards and cards #44711

merged 23 commits into from
Jul 30, 2024

Conversation

johnswanson
Copy link
Contributor

@johnswanson johnswanson commented Jun 25, 2024

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'll write 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.

@johnswanson johnswanson self-assigned this Jun 25, 2024
@johnswanson johnswanson changed the title WIP stallllllle WIP: Add an API to get stale dashboards and cards Jun 25, 2024
@metabase-bot metabase-bot bot added the .Team/AdminWebapp Admin and Webapp team label Jun 25, 2024
@johnswanson johnswanson marked this pull request as ready for review June 27, 2024 12:17
@johnswanson johnswanson requested a review from camsaul as a code owner June 27, 2024 12:17
Copy link

replay-io bot commented Jun 27, 2024

Status In Progress ↗︎ 59 / 60
Commit 749de85
Results
⚠️ 2 Flaky
2825 Passed

Copy link
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff cc6ac53...508e819.

Notify File(s)
@alxnddr frontend/src/metabase/visualizations/components/ChoroplethMap.jsx
frontend/src/metabase/visualizations/components/LeafletGridHeatMap.jsx
frontend/src/metabase/visualizations/components/LegacyChoropleth.jsx
frontend/src/metabase/visualizations/components/PinMap.jsx
frontend/src/metabase/visualizations/echarts/cartesian/model/axis.ts
frontend/src/metabase/visualizations/echarts/cartesian/scatter/option/series.ts
frontend/src/metabase/visualizations/lib/mapping.js
frontend/src/metabase/visualizations/lib/sync-settings.ts
frontend/src/metabase/visualizations/lib/timelines.js
frontend/src/metabase/visualizations/lib/utils.js
frontend/src/metabase/visualizations/shared/components/RowChart/utils/data.ts
frontend/src/metabase/visualizations/shared/components/RowChart/utils/domain.ts
frontend/src/metabase/visualizations/visualizations/CartesianChart/use-chart-events.ts
frontend/src/metabase/visualizations/visualizations/Gauge/Gauge.jsx
frontend/src/metabase/visualizations/visualizations/PieChart/PieArc.tsx
frontend/src/metabase/visualizations/visualizations/PieChart/PieChart.jsx
frontend/src/metabase/visualizations/visualizations/PieChart/utils.ts
frontend/src/metabase/visualizations/visualizations/PivotTable/PivotTable.stories.tsx
frontend/src/metabase/visualizations/visualizations/PivotTable/PivotTable.tsx
frontend/src/metabase/visualizations/visualizations/PivotTable/PivotTable.unit.spec.tsx
frontend/src/metabase/visualizations/visualizations/PivotTable/constants.ts
frontend/src/metabase/visualizations/visualizations/PivotTable/pivot-table-test-mocks.tsx
frontend/src/metabase/visualizations/visualizations/PivotTable/stories-data.ts
frontend/src/metabase/visualizations/visualizations/RowChart/RowChart.tsx
@ranquild frontend/src/metabase/lib/colors/palette.ts
frontend/src/metabase/lib/colors/scales.ts

@johnswanson johnswanson force-pushed the add-dashboard-last-viewed-at branch from cc6ac53 to ec048b7 Compare June 27, 2024 20:31
@johnswanson johnswanson changed the title WIP: Add an API to get stale dashboards and cards Add an API to get stale dashboards and cards Jun 27, 2024
@johnswanson johnswanson force-pushed the add-dashboard-last-viewed-at branch from ec048b7 to df9d374 Compare June 28, 2024 18:18
@johnswanson johnswanson force-pushed the add-dashboard-last-viewed-at branch from df9d374 to 79c58e2 Compare June 28, 2024 20:27
@escherize escherize added the no-backport Do not backport this PR to any branch label Jul 2, 2024
@johnswanson johnswanson force-pushed the add-dashboard-last-viewed-at branch from 79c58e2 to 614cc46 Compare July 8, 2024 12:37
@johnswanson johnswanson force-pushed the add-dashboard-last-viewed-at branch from 642367f to 60d9d8d Compare July 10, 2024 19:37
@github-automation-metabase github-automation-metabase requested a review from a team July 10, 2024 19:39
@johnswanson johnswanson force-pushed the add-dashboard-last-viewed-at branch 2 times, most recently from 0a718a4 to 07f058e Compare July 11, 2024 13:29
@johnswanson johnswanson force-pushed the add-dashboard-last-viewed-at branch from 07f058e to 77bf1e8 Compare July 12, 2024 15:23
@johnswanson johnswanson force-pushed the add-stale branch 2 times, most recently from ca7efbe to 5455d9c Compare July 12, 2024 17:26
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.
I forgot to commit this before.

Tests seem to be failing due to [this](#45848)
@johnswanson johnswanson force-pushed the add-stale branch 7 times, most recently from 4d6a805 to 03dae7f Compare July 29, 2024 19:45
@johnswanson johnswanson merged commit cbbcf4c into master Jul 30, 2024
118 checks passed
@johnswanson johnswanson deleted the add-stale branch July 30, 2024 16:21
@github-actions github-actions bot added this to the 0.51 milestone Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-backport Do not backport this PR to any branch .Team/AdminWebapp Admin and Webapp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants