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-6125] Implement Required Changes to Institution-Metric Summary API #10757

Conversation

Johnetordoff
Copy link
Contributor

Purpose

This will hook up the ES back-end to our JSON API allowing fields to be sorted and filtered.

Changes

  • adds NewInstitutionSummaryMetricsSerializer
  • adds _NewInstitutionSummaryMetricsList
  • adds InstitutionMonthlySummaryReport

QA Notes

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

  • Verify
  • Verify

What are the areas of risk?

Any concerns/considerations/questions that development raised?

Documentation

Side Effects

Ticket

https://openscience.atlassian.net/browse/ENG-6125

@Johnetordoff Johnetordoff force-pushed the api-for-summary-for-insti-dashboard branch 2 times, most recently from 6994fb4 to 8e220fc Compare September 20, 2024 13:48
@Johnetordoff Johnetordoff force-pushed the api-for-summary-for-insti-dashboard branch from 8e220fc to bfab32a Compare September 20, 2024 17:10
@Johnetordoff Johnetordoff marked this pull request as ready for review September 20, 2024 19:08
@Johnetordoff Johnetordoff force-pushed the api-for-summary-for-insti-dashboard branch from 138b418 to 03f201a Compare September 23, 2024 14:43
@Johnetordoff Johnetordoff force-pushed the api-for-summary-for-insti-dashboard branch from 03f201a to 53fb3d6 Compare September 23, 2024 15:30
@Johnetordoff Johnetordoff changed the title [WIP][ENG-6125] Implement Required Changes to Institution-Metric Summary API [ENG-6125] Implement Required Changes to Institution-Metric Summary API Sep 23, 2024
Copy link
Contributor

@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.

seems like it'll work, but names shouldn't lie when we can avoid it

Comment on lines 585 to 586
class _NewInstitutionSummaryMetricsList(JSONAPIBaseView, generics.RetrieveAPIView, InstitutionMixin):
'''list view for institution-summary metrics
Copy link
Contributor

Choose a reason for hiding this comment

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

either keep it an actual list view (which should be easy with ElasticsearchListView, as your copy-paste included get_default_search) or update to stop calling it a list view (both in class-name and docstring)

this sort of inconsistency is actively (tho subtly) hostile to future contributors

Comment on lines 367 to 375

Summary contains counts of
- Total users in the institution
- Total public project count for the institution
- Total private project count for the institution
- Total public registration count for the institution
- Total private registration count for the institution
- Total published preprint count for the institution

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: i'd say this kind of info is not helpful in the docstring, since it duplicates info in the fields themselves and is unlikely to be kept in sync as fields are added/removed over time (again, thinking of confusion for future contributors) -- and here it's already out of sync (missing the last four fields)

)


institution_summary_metrics_list_view = toggle_view_by_flag(
Copy link
Contributor

Choose a reason for hiding this comment

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

if you make it a list view, this is fine, but if it's a detail view (as implemented now) it shouldn't be called list_view

@Johnetordoff Johnetordoff force-pushed the api-for-summary-for-insti-dashboard branch 2 times, most recently from 927f8c0 to e319a15 Compare October 1, 2024 14:37
@Johnetordoff Johnetordoff force-pushed the api-for-summary-for-insti-dashboard branch from e319a15 to ad248ba Compare October 1, 2024 15:29
Copy link
Contributor

@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.

🏆

@aaxelb aaxelb merged commit 44dd395 into CenterForOpenScience:feature/insti-dash-improv Oct 1, 2024
6 checks passed
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.

2 participants