scientist-softserv / scholarworks

Cal State Hyrax
0 stars 0 forks source link

CalState Bulkrax pairing w/ Bryan #16

Closed bkiahstroud closed 1 year ago

bkiahstroud commented 1 year ago
Most of the issues I ran into have a lot to do with figuring out how to configure things but here are a few things I had to do as I debugged through it so perhaps someone can incorporate the changes in.

- browse every config needs to have date expired_on to allow add cloud files from amazon s3 bucket for import

  config/browse_everything_providers.yml

                expires_in: 10-11-2023  # add this in

- In csv_entry.rb method build_relationship_metadata needs to check for map before referencing it.

  change from

    handle_join_on_export(relationship_key, values, mapping[related_parents_parsed_mapping]['join'].present?)

         to

    is_join = mapping.key?(related_parents_parsed_mapping) ? mapping[related_parents_parsed_mapping]['join'].present ? : false

    handle_join_on_export(relationship_key, values, is_join)

- in file has_matchers.rb method field_supported?

  . should only do global string sub if it's a string.

  change from

    field = field.gsub('_attributes', '')

         to

    field = field.gsub('_attributes', '') if field.is_a? String

  . It also needs to check for factory_class not nil before reference method of it.

    change from

      return factory_class.method_defined?(field) && factory_class.properties[field].present?

           to

      return factory_class.method_defined?(field) && factory_class.properties[field].present? unless factory_class.nil

I think the factory_class is empty and as it goes through the csv entry to create a work, it parsed through it but doesn't harvest any data. I don't know if we need to configure the factory_class and I couldn't find any document on how to configure it.
bkiahstroud commented 1 year ago

Got Bryan unstuck and opened this PR in Bulkrax as a results: