Skip to content

[ENG-11229][fix] osfmetrics preprint count migration#11741

Open
aaxelb wants to merge 2 commits into
CenterForOpenScience:developfrom
aaxelb:fix/osfmetrics-preprint-count-migration
Open

[ENG-11229][fix] osfmetrics preprint count migration#11741
aaxelb wants to merge 2 commits into
CenterForOpenScience:developfrom
aaxelb:fix/osfmetrics-preprint-count-migration

Conversation

@aaxelb
Copy link
Copy Markdown
Collaborator

@aaxelb aaxelb commented May 15, 2026

Ticket

Purpose

osfmetrics 6to8 data migration is missing some view/download counts

Changes

  • when getting cumulative counts for a preprint osfid_v1, search for preprint_id: [“osfid_v1”, “osfid”]
  • when scheduling tasks to migrate public usage reports in migrate_osfmetrics_6to8, aggregate osfids from usage reports, usage events, preprint views, and preprint downloads (instead of just usage reports)
  • when there are no monthly usage reports for an item (but there are older views/downloads), create a “last month” usage report with cumulative counts up to that point

Side Effects

while touching this again, also...

  • change item_type to use the short name of the osfmap type, rather than full iri
  • stop calling setup at start of migrate_osfmetrics_6to8 (and remove --no-setup arg)
  • ensure consistent database_iri (a COUNTER field that's kinda mapped from osf "provider")
    //: # (Any possible side effects?)

QE Notes

CE Notes

Documentation

aaxelb added 2 commits May 15, 2026 12:13
in osfmetrics 6to8 migration, when building cumulative view/download
counts for preprints, make sure to include usage stored under the
preprint's unversioned osfid with the osfid_v1 usage reports (since
PreprintView/PreprintDownload started saving under versioned osfid)
so those older views don't get lost in migration
@aaxelb aaxelb marked this pull request as ready for review May 15, 2026 17:59
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.

1 participant