diff --git a/Gemfile b/Gemfile index 8942f9f4a..4b4347dbc 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } gem 'rails', '~> 7.1.0' # DLSS/domain-specific dependencies -gem 'cocina-models', '~> 0.97.0' +gem 'cocina-models', '~> 0.98.0' gem 'datacite', '~> 0.3.0' gem 'dor-workflow-client', '~> 7.3' gem 'druid-tools', '~> 2.2' diff --git a/Gemfile.lock b/Gemfile.lock index 26082a312..ad9775991 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -116,7 +116,7 @@ GEM capistrano-bundler (>= 1.1, < 3) capistrano-shared_configs (0.2.2) chronic (0.10.2) - cocina-models (0.97.0) + cocina-models (0.98.0) activesupport deprecation dry-struct (~> 1.0) @@ -581,7 +581,7 @@ DEPENDENCIES capistrano-passenger capistrano-rails capistrano-shared_configs - cocina-models (~> 0.97.0) + cocina-models (~> 0.98.0) committee config daemons diff --git a/app/services/publish/public_cocina_service.rb b/app/services/publish/public_cocina_service.rb index 39d9c2b4b..6074cee7b 100644 --- a/app/services/publish/public_cocina_service.rb +++ b/app/services/publish/public_cocina_service.rb @@ -33,9 +33,7 @@ def build # remove partOfProject (similar to how we remove tags from identityMetadata) # and rewrite release tags with the tags from the collection. def build_administrative - Cocina::Models::Administrative.new(cocina.administrative.to_h - .except(:partOfProject) - .merge(releaseTags: ReleaseTagService.for_public_metadata(cocina_object: cocina))) + Cocina::Models::Administrative.new(cocina.administrative.to_h.except(:partOfProject)) end def build_structural diff --git a/openapi.yml b/openapi.yml index 64aba5d9f..0b91fb714 100644 --- a/openapi.yml +++ b/openapi.yml @@ -1484,11 +1484,6 @@ components: properties: hasAdminPolicy: $ref: "#/components/schemas/Druid" - releaseTags: - description: Tags for release - type: array - items: - $ref: "#/components/schemas/ReleaseTag" required: - hasAdminPolicy AdminPolicyAccessTemplate: diff --git a/spec/fixtures/workspace/dd/116/zh/0343/dd116zh0343/metadata/cocina.json b/spec/fixtures/workspace/dd/116/zh/0343/dd116zh0343/metadata/cocina.json index 9d500999b..81781e821 100644 --- a/spec/fixtures/workspace/dd/116/zh/0343/dd116zh0343/metadata/cocina.json +++ b/spec/fixtures/workspace/dd/116/zh/0343/dd116zh0343/metadata/cocina.json @@ -9,9 +9,6 @@ "download": "world" }, "administrative": { - "hasAdminPolicy": "druid:hy787xj5878", - "releaseTags": [ - - ] + "hasAdminPolicy": "druid:hy787xj5878" } } \ No newline at end of file diff --git a/spec/requests/create_collection_spec.rb b/spec/requests/create_collection_spec.rb index 69d99eda5..1aebf6153 100644 --- a/spec/requests/create_collection_spec.rb +++ b/spec/requests/create_collection_spec.rb @@ -25,7 +25,7 @@ "cocinaVersion":"#{Cocina::Models::VERSION}", "type":"#{Cocina::Models::ObjectType.collection}", "label":"#{label}","version":1,"access":{"view":"world"}, - "administrative":{"releaseTags":[],"hasAdminPolicy":"druid:dd999df4567"}, + "administrative":{"hasAdminPolicy":"druid:dd999df4567"}, "description":{"title":[{"value":"#{title}"}]}, "identification":#{identification.to_json}} JSON @@ -97,7 +97,7 @@ "cocinaVersion":"#{Cocina::Models::VERSION}", "type":"#{Cocina::Models::ObjectType.collection}", "label":"#{label}","version":1,"access":{"view":"world"}, - "administrative":{"releaseTags":[],"hasAdminPolicy":"druid:dd999df4567","partOfProject":"Hydrus"}, + "administrative":{"hasAdminPolicy":"druid:dd999df4567","partOfProject":"Hydrus"}, "identification":{"sourceId":"hydrus:collection-456"}, "description":{"title":[{"value":"#{title}"}]} } diff --git a/spec/requests/create_object_spec.rb b/spec/requests/create_object_spec.rb index fe1a8a0a3..ffd5a5719 100644 --- a/spec/requests/create_object_spec.rb +++ b/spec/requests/create_object_spec.rb @@ -60,7 +60,7 @@ "copyright":"All rights reserved unless otherwise indicated.", "useAndReproductionStatement":"Property rights reside with the repository..." }, - "administrative":{"releaseTags":[],"hasAdminPolicy":"#{admin_policy_id}","partOfProject":"Google Books"}, + "administrative":{"hasAdminPolicy":"#{admin_policy_id}","partOfProject":"Google Books"}, "description":{"title":[{"value":"#{title}"}]}, "identification":#{identification.to_json}, "structural":#{structural.to_json}} @@ -492,7 +492,7 @@ "cocinaVersion":"#{Cocina::Models::VERSION}", "type":"#{Cocina::Models::ObjectType.image}", "label":"#{label}","version":1, - "administrative":{"releaseTags":[],"hasAdminPolicy":"#{admin_policy_id}","partOfProject":"Google Books"}, + "administrative":{"hasAdminPolicy":"#{admin_policy_id}","partOfProject":"Google Books"}, "description":{"title":[{"value":"#{title}"}]}, "identification":#{identification.to_json}, "structural":#{structural.to_json}} @@ -540,7 +540,7 @@ "cocinaVersion":"#{Cocina::Models::VERSION}", "type":"#{Cocina::Models::ObjectType.book}", "label":"#{label}","version":1,"access":{"view":"world","download":"world"}, - "administrative":{"releaseTags":[],"hasAdminPolicy":"#{admin_policy_id}"}, + "administrative":{"hasAdminPolicy":"#{admin_policy_id}"}, "description":{"title":[{"value":"#{title}"}]}, "identification":{"sourceId":"googlebooks:999999"}, "structural":{"hasMemberOrders":[{"viewingDirection":"right-to-left"}]}} @@ -692,7 +692,7 @@ "type":"#{Cocina::Models::ObjectType.book}", "label":"This is my label","version":1,"access":{"view":"stanford","download":"none","controlledDigitalLending":false, "embargo":{"view":"world","download":"world","releaseDate":"2020-02-29T07:00:00.000+00:00"}}, - "administrative":{"releaseTags":[],"hasAdminPolicy":"#{admin_policy_id}"}, + "administrative":{"hasAdminPolicy":"#{admin_policy_id}"}, "description":{"title":[{"value":"This is my title"}]}, "identification":{"sourceId":"googlebooks:999999"}, "structural":{"hasMemberOrders":[{"viewingDirection":"right-to-left"}]}} @@ -749,7 +749,7 @@ "type":"#{Cocina::Models::ObjectType.book}", "label":"This is my label","version":1, "access":{"view":"location-based","download":"location-based","location":"m&m"}, - "administrative":{"releaseTags":[],"hasAdminPolicy":"#{admin_policy_id}"}, + "administrative":{"hasAdminPolicy":"#{admin_policy_id}"}, "description":{"title":[{"value":"This is my title"}]}, "identification":{"sourceId":"googlebooks:999999"}, "structural":{"hasMemberOrders":[{"viewingDirection":"right-to-left"}]}} @@ -795,7 +795,7 @@ "type":"#{Cocina::Models::ObjectType.book}", "label":"This is my label","version":1, "access":{"view":"world","download":"none"}, - "administrative":{"releaseTags":[],"hasAdminPolicy":"#{admin_policy_id}"}, + "administrative":{"hasAdminPolicy":"#{admin_policy_id}"}, "description":{"title":[{"value":"This is my title"}]}, "identification":{"sourceId":"googlebooks:999999"}, "structural":{"hasMemberOrders":[{"viewingDirection":"right-to-left"}]}} diff --git a/spec/requests/show_object_spec.rb b/spec/requests/show_object_spec.rb index e68097c9e..782a055b7 100644 --- a/spec/requests/show_object_spec.rb +++ b/spec/requests/show_object_spec.rb @@ -30,16 +30,7 @@ useAndReproductionStatement: 'Property rights reside with the repository...' }, administrative: { - hasAdminPolicy: 'druid:df123cd4567', - releaseTags: [ - { - to: 'Searchworks', - what: 'self', - date: '2014-08-30T01:06:28.000+00:00', - who: 'petucket', - release: true - } - ] + hasAdminPolicy: 'druid:df123cd4567' }, description: { title: [ @@ -74,16 +65,7 @@ useAndReproductionStatement: 'Property rights reside with the repository...' }, administrative: { - hasAdminPolicy: 'druid:df123cd4567', - releaseTags: [ - { - to: 'Searchworks', - what: 'self', - date: '2014-08-30T01:06:28.000+00:00', - who: 'petucket', - release: true - } - ] + hasAdminPolicy: 'druid:df123cd4567' }, description: { title: [ diff --git a/spec/requests/update_metadata_spec.rb b/spec/requests/update_metadata_spec.rb index 398676672..c6ea62075 100644 --- a/spec/requests/update_metadata_spec.rb +++ b/spec/requests/update_metadata_spec.rb @@ -58,7 +58,7 @@ "copyright":"All rights reserved unless otherwise indicated.", "useAndReproductionStatement":"Property rights reside with the repository..." }, - "administrative":{"releaseTags":[],"hasAdminPolicy":"#{apo_druid}"}, + "administrative":{"hasAdminPolicy":"#{apo_druid}"}, "description":#{description.to_json}, "identification":#{identification.to_json}, "structural":{ @@ -124,7 +124,7 @@ "copyright":"All rights reserved unless otherwise indicated.", "useAndReproductionStatement":"Property rights reside with the repository..." }, - "administrative":{"releaseTags":[],"hasAdminPolicy":"druid:dd999df4567"}, + "administrative":{"hasAdminPolicy":"druid:dd999df4567"}, "description":#{description.to_json}, "identification":#{identification.to_json}, "structural":{ @@ -239,7 +239,7 @@ "copyright":"All rights reserved unless otherwise indicated.", "useAndReproductionStatement":"Property rights reside with the repository..." }, - "administrative":{"releaseTags":[],"hasAdminPolicy":"druid:dd999df4567"}, + "administrative":{"hasAdminPolicy":"druid:dd999df4567"}, "description":{ "title":[{"value":"#{title}"}], "purl":"#{purl}" @@ -433,7 +433,7 @@ "copyright":"All rights reserved unless otherwise indicated.", "useAndReproductionStatement":"Property rights reside with the repository..." }, - "administrative":{"releaseTags":[],"hasAdminPolicy":"druid:dd999df4567"}, + "administrative":{"hasAdminPolicy":"druid:dd999df4567"}, "description":{ "title":[{"value":"#{title}"}], "purl":"#{purl}" @@ -560,7 +560,7 @@ "copyright":"All rights reserved unless otherwise indicated.", "useAndReproductionStatement":"Property rights reside with the repository..." }, - "administrative":{"releaseTags":[],"hasAdminPolicy":"druid:dd999df4567"}, + "administrative":{"hasAdminPolicy":"druid:dd999df4567"}, "description":{ "title":[{"value":"#{title}"}], "purl":"#{purl}" @@ -607,7 +607,7 @@ "view":"world", "download":"world" }, - "administrative":{"releaseTags":[],"hasAdminPolicy":"druid:dd999df4567"}, + "administrative":{"hasAdminPolicy":"druid:dd999df4567"}, "description":{ "title":[{"value":"#{title}"}], "purl":"#{purl}" @@ -661,7 +661,7 @@ "label":"#{label}","version":1, "access":{}, "identification":#{identification.to_json}, - "administrative":{"releaseTags":[],"hasAdminPolicy":"druid:dd999df4567"}, + "administrative":{"hasAdminPolicy":"druid:dd999df4567"}, "description":{ "title":[{"value":"#{title}"}], "purl":"#{purl}" @@ -817,7 +817,7 @@ "access":{"view":"stanford","download":"stanford", "embargo":{"view":"world","download":"world","releaseDate":"2020-02-29T07:00:00.000+00:00"} }, - "administrative":{"releaseTags":[],"hasAdminPolicy":"#{apo_druid}"}, + "administrative":{"hasAdminPolicy":"#{apo_druid}"}, "description":{ "title":[{"value":"This is my title"}], "purl":"#{purl}" diff --git a/spec/services/cocina/serializer_spec.rb b/spec/services/cocina/serializer_spec.rb index 6372f4227..53baf68e0 100644 --- a/spec/services/cocina/serializer_spec.rb +++ b/spec/services/cocina/serializer_spec.rb @@ -90,8 +90,7 @@ license: 'https://creativecommons.org/publicdomain/zero/1.0/legalcode' }, administrative: { - hasAdminPolicy: 'druid:zw306xn5593', - releaseTags: [] + hasAdminPolicy: 'druid:zw306xn5593' }, description: { title: [{ diff --git a/spec/services/cocina/to_xml/content_metadata_generator_spec.rb b/spec/services/cocina/to_xml/content_metadata_generator_spec.rb index f2e8cddfb..76fbd8c80 100644 --- a/spec/services/cocina/to_xml/content_metadata_generator_spec.rb +++ b/spec/services/cocina/to_xml/content_metadata_generator_spec.rb @@ -159,7 +159,7 @@ <<~JSON { "type":"#{object_type}", "label":"The object label","version":1,"access":{"view":"world","download":"world"}, - "administrative":{"releaseTags":[],"hasAdminPolicy":"druid:dd999df4567"}, + "administrative":{"hasAdminPolicy":"druid:dd999df4567"}, "description":{"title":[{"status":"primary","value":"the object title"}]}, "identification":{"sourceId":"sul:9999999"}, "structural":#{structural.to_json}} @@ -688,7 +688,7 @@ { "externalIdentifier":"druid:bc123df5678", "type":"#{object_type}", "label":"The object label","version":1,"access":{"view":"world","download":"world"}, - "administrative":{"releaseTags":[],"hasAdminPolicy":"druid:dd999df4567"}, + "administrative":{"hasAdminPolicy":"druid:dd999df4567"}, "description":{ "title":[{"status":"primary","value":"the object title"}], "purl":"https://purl.stanford.edu/bc123df5678" @@ -767,7 +767,7 @@ { "externalIdentifier":"druid:bc123df5678", "type":"#{object_type}", "label":"The object label","version":1,"access":{"view":"world","download":"world"}, - "administrative":{"releaseTags":[],"hasAdminPolicy":"druid:dd999df4567"}, + "administrative":{"hasAdminPolicy":"druid:dd999df4567"}, "description":{ "title":[{"status":"primary","value":"the object title"}], "purl":"https://purl.stanford.edu/bc123df5678" diff --git a/spec/services/indexing/indexers/releasable_indexer_spec.rb b/spec/services/indexing/indexers/releasable_indexer_spec.rb index 2a80f1f37..b2a42bde5 100644 --- a/spec/services/indexing/indexers/releasable_indexer_spec.rb +++ b/spec/services/indexing/indexers/releasable_indexer_spec.rb @@ -5,8 +5,7 @@ let(:cocina) { build(:dro).new(administrative:) } let(:administrative) do { - hasAdminPolicy: apo_id, - releaseTags: release_tags + hasAdminPolicy: apo_id } end let(:apo_id) { 'druid:gf999hb9999' } @@ -86,10 +85,7 @@ context 'with a parent collection' do let(:parent_collections) { [collection] } let(:collection) do - instance_double(Cocina::Models::Collection, externalIdentifier: collection_druid, administrative: collection_administrative) - end - let(:collection_administrative) do - instance_double(Cocina::Models::Administrative, releaseTags: collection_release_tags) + instance_double(Cocina::Models::Collection, externalIdentifier: collection_druid) end let(:collection_druid) { 'druid:bc123fg4567' } let(:collection_release_tags) { [] } diff --git a/spec/services/publish/public_cocina_service_spec.rb b/spec/services/publish/public_cocina_service_spec.rb index ef0ec203f..a5e98c05a 100644 --- a/spec/services/publish/public_cocina_service_spec.rb +++ b/spec/services/publish/public_cocina_service_spec.rb @@ -157,24 +157,5 @@ expect { create }.to raise_error(RuntimeError, 'unexpected call to PublicCocinaService.build for druid:bc123df4567') end end - - context 'when there are multiple release tags per target' do - subject(:release_tags) { create.administrative.releaseTags } - - let(:cocina_object) { build(:dro) } - let(:druid) { cocina_object.externalIdentifier } - - before do - ReleaseTag.create!(druid:, who: 'petucket', what: 'self', released_to: 'Searchworks', release: true) - ReleaseTag.create!(druid:, who: 'petucket', what: 'self', released_to: 'Searchworks', release: false, created_at: 1.year.ago) - ReleaseTag.create!(druid:, who: 'petucket', what: 'self', released_to: 'PURL sitemap', release: true) - end - - it 'includes only the latest releaseData element from release tags for each target' do - expect(release_tags.size).to eq 2 - expect(release_tags.map(&:release)).to eq [true, true] - expect(release_tags.map(&:to)).to eq ['Searchworks', 'PURL sitemap'] - end - end end end diff --git a/spec/services/release_tag_service_spec.rb b/spec/services/release_tag_service_spec.rb index fbd0f21e8..d9ed60e9e 100644 --- a/spec/services/release_tag_service_spec.rb +++ b/spec/services/release_tag_service_spec.rb @@ -7,15 +7,13 @@ let(:cocina_object) do build(:dro, id: druid, collection_ids:).new( administrative: { - hasAdminPolicy: apo_id, - releaseTags: cocina_release_tags + hasAdminPolicy: apo_id } ) end let(:apo_id) { 'druid:qv648vd4392' } let(:collection_druid) { 'druid:xh235dd9059' } let(:druid) { 'druid:bb004bn8654' } - let(:cocina_release_tags) { [] } let(:collection_ids) { [] } describe '.for_public_metadata' do