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

[ENG-6266][ENG-6241] send monthly usage to trove as supplementary metadata #10764

Merged

Conversation

aaxelb
Copy link
Contributor

@aaxelb aaxelb commented Oct 1, 2024

Purpose

add monthly view counts to metadata indexed for search

Changes

  • add monthly report(er) to compute views/downloads in a COUNTER-compliant way (from [ENG-6264] add monthly "item usage" report #10760)
  • support sending metadata to SHARE in multiple parts with different query params (is_supplementary and expiration_date; see [ENG-6265] supplementary metadata SHARE#825 and [ENG-6313] allow raw data to expire SHARE#826 )
  • partition each item's osfmap metadata (in osf.metadata.osf_gathering) into three parts that are handled differently:
    • OsfmapPartition.MAIN
      • the same old descriptive metadata record we know and love
      • sent to SHARE without is_supplementary nor expiration_date
    • OsfmapPartition.SUPPLEMENT
      • includes metadata less about the information content of the resource and more about how it's handled on osf (currently empty; will include stuff like addons used and osfstorage region)
      • sent to SHARE with is_supplementary but without expiration_date
    • OsfmapPartition.MONTHLY_SUPPLEMENT
      • includes monthly view/download counts
      • sent to SHARE with is_supplementary and an expiration_date two months after the reporting period

QA Notes

Please make verification statements inspired by your code and what your code touches.

  • Verify search indexing still works
  • Verify last month's view/download counts show in (dashboards powered by) the search api shortly after the monthly reporter completes

What are the areas of risk?

Any concerns/considerations/questions that development raised?

Documentation

Side Effects

Ticket

ENG-6266

@aaxelb aaxelb changed the base branch from develop to feature/insti-dash-improv October 1, 2024 17:39
@aaxelb aaxelb force-pushed the eng-6266--send-supp branch 7 times, most recently from aa78756 to 2a473ec Compare October 3, 2024 13:33
@aaxelb aaxelb marked this pull request as ready for review October 3, 2024 13:37
Copy link
Contributor Author

@aaxelb aaxelb left a comment

Choose a reason for hiding this comment

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

comments from group code review (with @mfraezz @felliott )

osf/metrics/reports.py Outdated Show resolved Hide resolved
osf/metrics/reports.py Outdated Show resolved Hide resolved
osf/metrics/reporters/public_item_usage.py Outdated Show resolved Hide resolved
Copy link
Member

@mfraezz mfraezz left a comment

Choose a reason for hiding this comment

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

In pair review, explored one rabbit-hole regarding efficiency/persistence of supplements. Once that's filled in, should be good to go 🐇

@aaxelb aaxelb force-pushed the eng-6266--send-supp branch 5 times, most recently from 3ad5b6e to 0235fe3 Compare October 18, 2024 13:18
@aaxelb aaxelb changed the title [ENG-6266] send monthly usage to trove as supplementary metadata [ENG-6266][ENG-6241] send monthly usage to trove as supplementary metadata Oct 18, 2024
@aaxelb aaxelb force-pushed the eng-6266--send-supp branch 2 times, most recently from f3135b6 to df1b9f3 Compare October 18, 2024 14:27
@cslzchen cslzchen self-requested a review October 21, 2024 20:38
(also clarify YearMonth method names and add tests)
Copy link
Collaborator

@cslzchen cslzchen left a comment

Choose a reason for hiding this comment

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

LGTM 🎆 and left a few random questions out of curiosity.

(I love the unit tests coverage though I didn't go over them as carefully as the code).

api/share/utils.py Show resolved Hide resolved
api/share/utils.py Show resolved Hide resolved
osf/metadata/gather/gatherer.py Show resolved Hide resolved
@aaxelb aaxelb merged commit 2dd6052 into CenterForOpenScience:feature/insti-dash-improv Oct 24, 2024
6 checks passed
@aaxelb aaxelb deleted the eng-6266--send-supp branch October 24, 2024 14:28
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