Skip to content

Conversation

@jonavellecuerdo
Copy link
Contributor

@jonavellecuerdo jonavellecuerdo commented Feb 25, 2025

Purpose and background context

This PR updates the OpenCourseWare (OCW) workflow to derived formatted values from the topics property included in the source metadata files (the data.json files in OCW zip files) that get mapped to dc.subject elements in the generated DSpace metadata. Additionally, this PR includes an update to the base Workflow.create_dspace_metadata method to handle list field values.

How can a reviewer manually see the effects of these changes?

Review of the updated unit tests should be sufficient.

Includes new or updated dependencies?

NO

Changes expectations for external applications?

NO

What are the relevant tickets?

Developer

  • All new ENV is documented in README
  • All new ENV has been added to staging and production environments
  • All related Jira tickets are linked in commit message(s)
  • Stakeholder approval has been confirmed (or is not needed)

Code Reviewer(s)

  • The commit message is clear and follows our guidelines (not just this PR message)
  • There are appropriate tests covering any new functionality
  • The provided documentation is sufficient for understanding any new functionality introduced
  • Any manual tests have been performed or provided examples verified
  • New dependencies are appropriate or there were no changes

@coveralls
Copy link

coveralls commented Feb 25, 2025

Pull Request Test Coverage Report for Build 13552141628

Details

  • 13 of 13 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 94.261%

Totals Coverage Status
Change from base Build 13528657865: 0.04%
Covered Lines: 657
Relevant Lines: 697

💛 - Coveralls

@jonavellecuerdo jonavellecuerdo force-pushed the IN-1186-simplecsv-fix-item-identifiers branch from dc19443 to e0e138e Compare February 25, 2025 18:45
Base automatically changed from IN-1186-simplecsv-fix-item-identifiers to main February 25, 2025 18:48
Why these changes are being introduced:
* For OCW source metadata JSON files ('data.json', the 'topics' property
is structured as an array of arrays containing string values. For each
array of strings, the topic terms need to be concatenated to match the
expected format set by stakeholders: "<topic term> - ... - <topic term n>".
Additionally, an update to Workflow.create_dspace_metadata was implemented
to allow handling of list field values.

How this addresses that need:
* Update Workflow.create_dspace_metadata to check for and handle
list field values
* Refactor '_get_instructors_delimited_string' to return list
of formatted instructor names (instead of delimited string)
* Add '_get_topics_list' method to return list of formatted topics
* Update 123.zip fixture to include 'topics' property
* Add and update unit tests

Side effects of this change:
* None

Relevant ticket(s):
* https://mitlibraries.atlassian.net/browse/IN-1176
* https://mitlibraries.atlassian.net/browse/IN-1159
@jonavellecuerdo jonavellecuerdo force-pushed the IN-1176-opencourseware-subjects-field branch from 0d0b909 to 0e97f92 Compare February 25, 2025 18:50
@jonavellecuerdo jonavellecuerdo marked this pull request as ready for review February 25, 2025 18:52
Copy link

@ghukill ghukill left a comment

Choose a reason for hiding this comment

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

Approved! Changes make sense to me.

Offered up a possible refactoring of the Workflow.create_dspace_metadata() now that the pathways are taking shape more, but purely optional; some conciseness but potentially at the expense of readability.

@jonavellecuerdo jonavellecuerdo merged commit 207a488 into main Feb 26, 2025
2 checks passed
@jonavellecuerdo jonavellecuerdo deleted the IN-1176-opencourseware-subjects-field branch February 26, 2025 20:38
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.

4 participants