Skip to content

[DT-4061] Add similar and frequently-requested-with study recommendations - #3054

Merged
otchet-broad merged 1 commit into
otchet-dt-4061-study-dar-metricsfrom
otchet-dt-4061-study-recommendations
Sep 16, 2026
Merged

otchet-broad merged 1 commit into
otchet-dt-4061-study-dar-metricsfrom
otchet-dt-4061-study-recommendations

Conversation

@otchet-broad

Copy link
Copy Markdown
Contributor

Base: branch 4 · 11 files, +447 · Migration: no · UI impact: none

Adds GET /api/metrics/study-recommendations/{studyId}/similar and GET /api/metrics/study-recommendations/{studyId}/frequently-requested-with. Both
return at most 12 publicly visible studies with their dataset counts.

"Similar" matches on a shared PI or at least one overlapping data type,
ranked by the size of the data type overlap plus a point for the PI match. A
blank pi_name is not an identity, so it never matches another blank one.

"Frequently requested with" ranks candidates by how often they appeared in
the same data access request as the source study. Only submitted,
non-archived, non-progress-report DARs score, and the reasons are worth
checking: a draft cart is not a request, an archived DAR should stop
counting, and a progress report carries its own reference_id, so counting
one would score its parent DAR more than once.

Both queries restrict candidates to public_visibility = TRUE, so a
recommendation never leaks the existence of a private study, and the source
study goes through verifyStudyVisibilityAccess.

No migration, no change to any existing response.

Depends on: branch 4 (extends MetricsService / MetricsResource).


Where this sits in the DT-4061 stack

otchet-dt-3990-study-ratings-pi-details was too large to review meaningfully
(95 files, +8168), so it was split into eight PRs. This PR targets otchet-dt-4061-study-dar-metrics,
not develop
, so its diff shows only its own work.

# Branch Base
1 otchet-dt-4061-study-visibility-authz develop
1b otchet-dt-4061-study-patch-ownership otchet-dt-4061-study-visibility-authz
2 otchet-dt-4061-study-pi-details otchet-dt-4061-study-visibility-authz
3 otchet-dt-4061-study-comments otchet-dt-4061-study-pi-details
4 otchet-dt-4061-study-dar-metrics otchet-dt-4061-study-comments
5 otchet-dt-4061-study-recommendations ← this PR otchet-dt-4061-study-dar-metrics
6 otchet-dt-4061-study-asset-fields otchet-dt-4061-study-recommendations
7 otchet-dt-4061-study-asset-endpoints otchet-dt-4061-study-asset-fields

Branch 1b is a sibling rather than a link in the chain: nothing depends on it,
so it can be held or dropped without blocking the others. Land the numbered
chain in order — merging out of order, or squash-merging, will require rebasing
the descendants.

The split is verified lossless: branch 7 plus 1b reproduces the original branch
exactly, apart from five scripts/verify-study-*.sh helper scripts that were
dropped at the author's request. ./mvnw test-compile passes on each branch
independently.

🤖 Generated with Claude Code

@otchet-broad
otchet-broad marked this pull request as ready for review September 8, 2026 20:45
@otchet-broad
otchet-broad requested review from a team, fboulnois and rushtong and removed request for a team September 8, 2026 20:45
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-dar-metrics branch from 2014320 to e31cd4a Compare September 8, 2026 21:58
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-recommendations branch from 37de009 to f7668a1 Compare September 8, 2026 21:58
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-dar-metrics branch from e31cd4a to d8cc578 Compare September 9, 2026 13:05
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-recommendations branch 2 times, most recently from a7f8085 to d41a878 Compare September 9, 2026 14:04
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-dar-metrics branch from d8cc578 to 02c3d83 Compare September 9, 2026 14:04
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-recommendations branch from d41a878 to a1c1f9e Compare September 9, 2026 14:33
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-dar-metrics branch from 02c3d83 to 911d47a Compare September 9, 2026 14:33

@kevinmarete kevinmarete left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏾

@fboulnois fboulnois left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-dar-metrics branch from 911d47a to 9d48687 Compare September 10, 2026 00:05
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-recommendations branch from a1c1f9e to 4d19126 Compare September 10, 2026 00:05
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-dar-metrics branch from 9d48687 to 89f4353 Compare September 10, 2026 00:40
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-recommendations branch from 4d19126 to 7f7d63e Compare September 10, 2026 00:40
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-dar-metrics branch from 89f4353 to 21e53e3 Compare September 10, 2026 15:32
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-recommendations branch from 7f7d63e to 086ced7 Compare September 10, 2026 15:32
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-dar-metrics branch from 21e53e3 to bb9de1b Compare September 10, 2026 20:08
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-recommendations branch from 086ced7 to af4c136 Compare September 10, 2026 20:08
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-dar-metrics branch from bb9de1b to 2d5c382 Compare September 10, 2026 20:53
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-recommendations branch from af4c136 to 6e8b06f Compare September 10, 2026 20:54
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-dar-metrics branch from 2d5c382 to 1497ca8 Compare September 10, 2026 21:53
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-recommendations branch from 6e8b06f to 76d0c15 Compare September 10, 2026 21:53
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-dar-metrics branch from 1497ca8 to 46a9c32 Compare September 14, 2026 17:55
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-recommendations branch from 76d0c15 to 5faafa5 Compare September 14, 2026 17:55
…ions

Adds GET /api/metrics/study-recommendations/{studyId}/similar and GET
/api/metrics/study-recommendations/{studyId}/frequently-requested-with.
Both return at most 12 publicly visible studies with their dataset counts.

"Similar" matches on a shared PI or at least one overlapping data type,
ranked by the size of the data type overlap plus a point for the PI match.
A blank pi_name is not an identity, so it never matches another blank one.

"Frequently requested with" ranks candidate studies by how often they
appeared in the same data access request as the source study. Only
submitted, non-archived, non-progress-report DARs score: a draft cart is
not a request, an archived DAR should stop counting, and a progress report
carries its own reference_id, so counting one would score its parent DAR
more than once.

Both queries restrict candidates to public_visibility = TRUE, so a
recommendation never leaks the existence of a private study, and the source
study itself goes through DatasetService#verifyStudyVisibilityAccess.

No migration and no change to any existing response.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-dar-metrics branch from 46a9c32 to c9fe790 Compare September 14, 2026 20:29
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-recommendations branch from 5faafa5 to 261637c Compare September 14, 2026 20:29
@otchet-broad
otchet-broad merged commit 19f2ffc into otchet-dt-4061-study-dar-metrics Sep 16, 2026
4 checks passed
@otchet-broad
otchet-broad deleted the otchet-dt-4061-study-recommendations branch September 16, 2026 15:03
otchet-broad added a commit that referenced this pull request Sep 16, 2026
…-fields

Catches this branch up to its base after #3052, #3053 and #3054 were
squash-merged into it. The squashes carry the same content as the
original commits still in this branch's history, so every registration
list - the Jersey resources, the Guice module, the OpenAPI paths and the
changelog includes - conflicted with itself. Each is resolved as the
union of both sides, deduplicated.

Verified by taking the branch the other way as well: rebasing onto the
new base and dropping the three superseded commits produces a
byte-identical tree.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants