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

Schema 4.5 - Initial release #1042

Merged
merged 47 commits into from
Dec 4, 2023
Merged

Schema 4.5 - Initial release #1042

merged 47 commits into from
Dec 4, 2023

Conversation

svogt0511
Copy link
Contributor

@svogt0511 svogt0511 commented Nov 13, 2023

Purpose

Implement a first set of changes necessary to support Schema 4.5, in particular, lupo support of the additional sub-properties to the publisher attribute.

closes: #1011, #1010, #1009, #1038, #1012, #1043

related to: Bolognese PR: datacite/bolognese#166, and #1005 (Only elastic search mods left to close this task.)

Relevant documents:

Approach

Use an upgraded bolognese gem for schema 4.5 support, update the DB and the lupo API to support the new schema 4.5 elements. Ultimately, in the next release, update elasticsearch indices appropriately and add search to include the new properties.

This initial release is done as a coordinated release of lupo and bolognese (datacite/bolognese#166) to support the new schema elements, as follows:

  • Run the DB migration to add publisher_obj (done)
  • Merge 4.5 bolognese changes (see the bolognese PR)
  • Release new version of bolognese
  • Update lupo 4.5-r2 Gemfile to match the new bolognese version
  • Merge lupo 4.5-r2 to staging
  • Release new version of lupo

We have added a publisher_obj field to the database, to replace the current publisher field. It will contain json with all of the publisher sub-properties, and will be be updated with each new DOI when the publisher property is set. The publisher accessor is changed to look at both publisher and publisher_obj fields, and return the new publisher obj with all properties. Appropriate validation has been added to the model.

Rake tasks have been added that will populate the publisher_obj field of DOIs that already exist. This will be run in the background after this release to ensure that the publisher_obj is updated for all DOIs.

The datacite_doi controller endpoints return publisher as a string in the response to maintain backwards compatibility, but accept publisher=true in the query and return the publisher object with all sub-properties. The endpoints also accept the the publisher string, or will accept the new publisher_obj if supplied on DOI create and update.

The activities controller has been updated to accept the publisher=true flag and to and support of the publisher sub-properties for audit and the dois/undo endpoint.

The validate endpoint has been modified to accept the publisher=true flag.

The serializers have been modified to supply the appropriate json responses.

Rspec tests and appropriate fixtures have been modified to add appropriate testing.

FUTURE RELEASES WILL INCLUDE:

Support for Elastic Search indexing of the new sub-properties and searches via the Elastic Search query strings. This will include a re-index of the datacite_dois and other_dois indices.

Cleanup - including removal of code that refers to the the old publisher field along with removal of the DB field itself.

Open Questions and Pre-Merge TODOs

  • Before merging this PR, modify the lupo Gemfile to use the new bolognese, v1.11.6 from master (instead of the branch), retest lupo, then merge and release to staging.

Learning

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

  • New feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

Reviewer, please remember our guidelines:

  • Be humble in the language and feedback you give, ask don't tell.
  • Consider using positive language as opposed to neutral when offering feedback. This is to avoid the negative bias that can occur with neutral language appearing negative.
  • Offer suggestions on how to improve code e.g. simplification or expanding clarity.
  • Ensure you give reasons for the changes you are proposing.

svogt0511 and others added 30 commits October 4, 2023 14:32
…an branch name in Gemfile. Mod for publisher_obj.
…=true query parameter. Updated bolognese branch.
…ent to publisher handling in Doi model and controller
…lognese changes with Schema 4.5 and affiliation fixes (4a29b935017fa27545f21be877b8fb18d0f31dcc)
…odeled after migration scripts for affiliations.
Copy link
Contributor

@ashwinisukale ashwinisukale left a comment

Choose a reason for hiding this comment

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

Hi there :)

First off, great work on the code changes! I appreciate the effort you've put into this. The changes look good to me, but I have a few refactoring suggestions. Please feel free to review and incorporate them if they align with the context. And of course, if you have any questions or concerns about the suggestions, let's discuss!

Thanks again for your hard work!

Gemfile Outdated Show resolved Hide resolved
app/graphql/types/doi_item.rb Show resolved Hide resolved
app/models/doi.rb Show resolved Hide resolved
app/models/doi.rb Outdated Show resolved Hide resolved
app/models/doi.rb Outdated Show resolved Hide resolved
app/graphql/types/doi_item.rb Outdated Show resolved Hide resolved
app/models/doi.rb Show resolved Hide resolved
app/models/doi.rb Show resolved Hide resolved
app/serializers/datacite_doi_serializer.rb Show resolved Hide resolved
app/serializers/activity_serializer.rb Show resolved Hide resolved
Copy link
Contributor

@ashwinisukale ashwinisukale left a comment

Choose a reason for hiding this comment

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

Thank you for addressing the review comments, Changes looks good to me.

Copy link
Contributor

@codycooperross codycooperross left a comment

Choose a reason for hiding this comment

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

Thank you for making that last change in app/graphql/types/doi_item.rb—looks great!

@svogt0511 svogt0511 merged commit 5c802b8 into master Dec 4, 2023
12 of 13 checks passed
@svogt0511 svogt0511 deleted the schema-4.5-r2 branch December 4, 2023 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metadata 4.5 - Get DOI in lupo
4 participants