cocina-models 0.84.5 → 0.85.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -2
- data/Gemfile.lock +6 -6
- data/README.md +22 -12
- data/cocina-models.gemspec +1 -1
- data/lib/cocina/models/contributor.rb +0 -1
- data/lib/cocina/models/description.rb +1 -1
- data/lib/cocina/models/mapping/to_mods/geographic.rb +3 -3
- data/lib/cocina/models/mapping/to_mods/subject.rb +1 -1
- data/lib/cocina/models/related_resource.rb +1 -1
- data/lib/cocina/models/validators/description_types_validator.rb +1 -1
- data/lib/cocina/models/version.rb +1 -1
- data/openapi.yml +1 -44
- metadata +3 -4
- data/lib/cocina/models/descriptive_parallel_contributor.rb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3e8bdc15327c32a4d90a32780285048b947d799816e30ce9c47feb328f7deaf
|
4
|
+
data.tar.gz: d3a3b4e03410cad650555b2a085dd85e429029465d0ddf5e950a2c9231e27d73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18af72ea7b0ff5ce24800694b2a29d519d975c05e99d6124660fce6a78f66f274513914ee7763ef05d60bb1beac194aa6d77db610879f829b827dfccf88ef0cd
|
7
|
+
data.tar.gz: cb1837cdb6f1b78640ef91c8efae91e0dbe9d872525bf87beb9a5b345e59fff3156f6c7d9fdb98e9e713964cfc98094ae373c897fffb2e4469faf6bde37e8a6b
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cocina-models (0.
|
4
|
+
cocina-models (0.85.0)
|
5
5
|
activesupport
|
6
6
|
deprecation
|
7
7
|
dry-struct (~> 1.0)
|
@@ -32,13 +32,13 @@ GEM
|
|
32
32
|
json_schema (~> 0.14, >= 0.14.3)
|
33
33
|
openapi_parser (>= 0.11.1, < 1.0)
|
34
34
|
rack (>= 1.5)
|
35
|
-
commonmarker (0.23.
|
35
|
+
commonmarker (0.23.6)
|
36
36
|
concurrent-ruby (1.1.10)
|
37
37
|
deprecation (1.1.0)
|
38
38
|
activesupport
|
39
39
|
diff-lcs (1.5.0)
|
40
40
|
docile (1.4.0)
|
41
|
-
dry-container (0.
|
41
|
+
dry-container (0.11.0)
|
42
42
|
concurrent-ruby (~> 1.0)
|
43
43
|
dry-core (0.8.1)
|
44
44
|
concurrent-ruby (~> 1.0)
|
@@ -100,7 +100,7 @@ GEM
|
|
100
100
|
rspec-mocks (3.11.1)
|
101
101
|
diff-lcs (>= 1.2.0, < 2.0)
|
102
102
|
rspec-support (~> 3.11.0)
|
103
|
-
rspec-support (3.11.
|
103
|
+
rspec-support (3.11.1)
|
104
104
|
rspec_junit_formatter (0.5.1)
|
105
105
|
rspec-core (>= 2, < 4, != 2.12.0)
|
106
106
|
rss (0.2.9)
|
@@ -119,7 +119,7 @@ GEM
|
|
119
119
|
parser (>= 3.1.1.0)
|
120
120
|
rubocop-rake (0.6.0)
|
121
121
|
rubocop (~> 1.0)
|
122
|
-
rubocop-rspec (2.13.
|
122
|
+
rubocop-rspec (2.13.2)
|
123
123
|
rubocop (~> 1.33)
|
124
124
|
ruby-progressbar (1.11.0)
|
125
125
|
simplecov (0.21.2)
|
@@ -135,7 +135,7 @@ GEM
|
|
135
135
|
thor (1.2.1)
|
136
136
|
tzinfo (2.0.5)
|
137
137
|
concurrent-ruby (~> 1.0)
|
138
|
-
unicode-display_width (2.
|
138
|
+
unicode-display_width (2.3.0)
|
139
139
|
zeitwerk (2.6.0)
|
140
140
|
|
141
141
|
PLATFORMS
|
data/README.md
CHANGED
@@ -136,24 +136,34 @@ which pushes the gem to rubygems.org. Next write up the release notes: https://
|
|
136
136
|
|
137
137
|
### Step 2: Update client gems coupled to the models
|
138
138
|
|
139
|
-
**NOTE**: You
|
139
|
+
**NOTE**: You may skip this step if the new release is a patch-level bump only, as the client gems are pinned to a minor release of cocina-models. However, a PR to update Gemfile.lock with the new cocina-models version is welcome ... and not a blocker.
|
140
140
|
|
141
|
-
|
141
|
+
If this is a minor or major cocina-models version change, release new versions of [sdr-client](https://github.com/sul-dlss/sdr-client) and [dor-services-client](https://github.com/sul-dlss/dor-services-client/) pinned to use the new cocina-models version because applications such as [Argo](https://github.com/sul-dlss/argo) depend on both of these gems using the same models.
|
142
142
|
|
143
|
-
### Step 3: Update
|
143
|
+
### Step 3: Update services directly coupled to the models
|
144
144
|
|
145
|
-
|
146
|
-
|
147
|
-
The cocina-models gem is used in applications that have an API specification that accepts Cocina models. Next, make sure that the `openapi.yml` for these applications include the `openapi.yml` schema changes made in cocina-models. This list of services is known to include:
|
145
|
+
This list of services is known to include:
|
148
146
|
|
149
147
|
* [sul-dlss/sdr-api](https://github.com/sul-dlss/sdr-api)
|
150
148
|
* [sul-dlss/dor-services-app](https://github.com/sul-dlss/dor-services-app/)
|
151
149
|
|
152
|
-
|
150
|
+
**NOTE**: You can skip step 3A if there have not been any changes to the `cocina-models` OpenAPI spec since the prior release.
|
151
|
+
|
152
|
+
#### Step 3A: Update API specifications
|
153
|
+
|
154
|
+
The cocina-models gem is used in applications that have an API specification that accepts Cocina models. Make sure that the `openapi.yml` for these applications include the `openapi.yml` schema changes made in cocina-models.
|
155
|
+
|
156
|
+
This can be accomplished by copying and pasting the cocina-models schemas to the openapi.yml of the associated project. By convention, these schemas are listed first in the `openapi.yml` of the associated projects, followed by the application-specific schemas.
|
157
|
+
|
158
|
+
#### Step 3B: Bump gems and create the PRs
|
159
|
+
|
160
|
+
If step 3A was needed, use the same PRs to also bump the versions of cocina-models, sdr-client, and dor-services-client in these applications/services. Why? When [dor-services-app](https://github.com/sul-dlss/dor-services-app), for example, is updated to use the new models (via the auto-update script), these clients should be updated at the same time or there is risk of models produced by dor-services-app not being acceptable to the clients.
|
161
|
+
|
162
|
+
With or without step 3A, perform `bundle update` for cocina-models, sdr-client, and dor-services-client gems in the listed services and then make PRs for those repos.
|
153
163
|
|
154
|
-
#### Step
|
164
|
+
#### Step 3C: Merge 'em
|
155
165
|
|
156
|
-
|
166
|
+
Get the directly coupled services PRs merged before the deploy in step 5.
|
157
167
|
|
158
168
|
### Step 4: Update other dependent applications
|
159
169
|
|
@@ -161,19 +171,19 @@ Once the above listed steps have been completed, all applications that use cocin
|
|
161
171
|
|
162
172
|
There are scripts to help with updating other dependent applications:
|
163
173
|
|
164
|
-
#### Step 4A: Create the PRs
|
174
|
+
#### Step 4A: Create the Cocina Level 2 PRs
|
165
175
|
|
166
176
|
There is a Jenkins CI job that you can run manually to create all the PRs you need. Head to https://sul-ci-prod.stanford.edu/job/SUL-DLSS/job/access-update-scripts/job/cocina-level2-updates/ and then click `Build Now`. Click the new build that is created and then `Console Output` to watch the build. Once it has completed, you can proceed with the next step.
|
167
177
|
|
168
178
|
If for some reason the above method does not work, the sul-dlss/access-update-scripts repo has a script for this: `cocina_level2_prs.rb`. You will need a github access token with scopes of "read:org" and "repo" (see https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) to run it, as noted in the comments at the top of that script.
|
169
179
|
|
170
|
-
#### Step 4B: Merge the PRs
|
180
|
+
#### Step 4B: Merge the Cocina Level 2 PRs
|
171
181
|
|
172
182
|
[sul-dlss/access-update-scripts](https://github.com/sul-dlss/access-update-scripts) has a switch in the `merge-all.rb` script for this, as noted in the comments at the top of that script. (`REPOS_PATH=infrastructure GH_ACCESS_TOKEN=abc123 COCINA_LEVEL2= ./merge-all.rb`)
|
173
183
|
|
174
184
|
### Step 5: Deploy all affected applications together
|
175
185
|
|
176
|
-
[sul-dlss/sdr-deploy](https://github.com/sul-dlss/sdr-deploy) has a flag in the deploy script to limit deploys to cocina dependent applications. Refer to instructions in the [sdr-deploy/README](https://github.com/sul-dlss/sdr-deploy/blob/main/README.md#only-deploy-repos-related-to-cocina-models-update).
|
186
|
+
[sul-dlss/sdr-deploy](https://github.com/sul-dlss/sdr-deploy) has a flag (-c) in the deploy script to limit deploys to cocina dependent applications. Refer to instructions in the [sdr-deploy/README](https://github.com/sul-dlss/sdr-deploy/blob/main/README.md#only-deploy-repos-related-to-cocina-models-update).
|
177
187
|
|
178
188
|
Note that running the integration tests is currently the best way we have to check for unintended effects and/or bugs when rolling out cocina-models changes.
|
179
189
|
|
data/cocina-models.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.bindir = 'exe'
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ['lib']
|
25
|
-
spec.required_ruby_version = '>=
|
25
|
+
spec.required_ruby_version = '>= 3.0'
|
26
26
|
|
27
27
|
spec.add_dependency 'activesupport'
|
28
28
|
spec.add_dependency 'deprecation'
|
@@ -14,7 +14,6 @@ module Cocina
|
|
14
14
|
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
15
15
|
# URL or other pointer to the location of the contributor information.
|
16
16
|
attribute? :valueAt, Types::Strict::String
|
17
|
-
attribute :parallelContributor, Types::Strict::Array.of(DescriptiveParallelContributor).default([].freeze)
|
18
17
|
end
|
19
18
|
end
|
20
19
|
end
|
@@ -20,7 +20,7 @@ module Cocina
|
|
20
20
|
attribute? :adminMetadata, DescriptiveAdminMetadata.optional
|
21
21
|
# URL or other pointer to the location of the resource description.
|
22
22
|
attribute? :valueAt, Types::Strict::String
|
23
|
-
# Stanford persistent URL associated with the related resource.
|
23
|
+
# Stanford persistent URL associated with the related resource.
|
24
24
|
attribute :purl, Types::Strict::String
|
25
25
|
end
|
26
26
|
end
|
@@ -6,9 +6,9 @@ module Cocina
|
|
6
6
|
module ToMods
|
7
7
|
# Maps geo extension from cocina to MODS
|
8
8
|
class Geographic # rubocop:disable Metrics/ClassLength
|
9
|
-
TYPE_REGEX = /^type
|
10
|
-
MEDIA_REGEX = /^media type
|
11
|
-
DATA_FORMAT_REGEX = /^data format
|
9
|
+
TYPE_REGEX = /^type$/
|
10
|
+
MEDIA_REGEX = /^media type$/
|
11
|
+
DATA_FORMAT_REGEX = /^data format$/
|
12
12
|
|
13
13
|
ABOUT_URI_PREFIX = 'http://purl.stanford.edu/'
|
14
14
|
|
@@ -12,7 +12,7 @@ module Cocina
|
|
12
12
|
'genre' => :genre,
|
13
13
|
'occupation' => :occupation
|
14
14
|
}.freeze
|
15
|
-
DEORDINAL_REGEX = /(?<=[0-9])(?:st|nd|rd|th)
|
15
|
+
DEORDINAL_REGEX = /(?<=[0-9])(?:st|nd|rd|th)/
|
16
16
|
|
17
17
|
# @params [Nokogiri::XML::Builder] xml
|
18
18
|
# @params [Array<Cocina::Models::DescriptiveValue>] subjects
|
@@ -19,7 +19,7 @@ module Cocina
|
|
19
19
|
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
20
20
|
attribute? :standard, Standard.optional
|
21
21
|
attribute :subject, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
22
|
-
# Stanford persistent URL associated with the related resource.
|
22
|
+
# Stanford persistent URL associated with the related resource.
|
23
23
|
attribute? :purl, Types::Strict::String
|
24
24
|
attribute? :access, DescriptiveAccessMetadata.optional
|
25
25
|
attribute :relatedResource, Types::Strict::Array.of(RelatedResource).default([].freeze)
|
@@ -71,7 +71,7 @@ module Cocina
|
|
71
71
|
# Some part of the path are ignored for the purpose of matching.
|
72
72
|
def clean_path(path)
|
73
73
|
new_path = path.reject do |part|
|
74
|
-
part.is_a?(Integer) || %i[parallelValue
|
74
|
+
part.is_a?(Integer) || %i[parallelValue parallelEvent].include?(part)
|
75
75
|
end
|
76
76
|
# This needs to happen after parallelValue is removed
|
77
77
|
# to handle structuredValue > parallelValue > structuredValue
|
data/openapi.yml
CHANGED
@@ -549,11 +549,6 @@ components:
|
|
549
549
|
valueAt:
|
550
550
|
description: URL or other pointer to the location of the contributor information.
|
551
551
|
type: string
|
552
|
-
parallelContributor:
|
553
|
-
description: For multiple representations of information about the same contributor (e.g. in different languages).
|
554
|
-
type: array
|
555
|
-
items:
|
556
|
-
$ref: "#/components/schemas/DescriptiveParallelContributor"
|
557
552
|
ControlledDigitalLendingAccess:
|
558
553
|
type: object
|
559
554
|
properties:
|
@@ -777,44 +772,6 @@ components:
|
|
777
772
|
type: array
|
778
773
|
items:
|
779
774
|
$ref: "#/components/schemas/DescriptiveValue"
|
780
|
-
DescriptiveParallelContributor:
|
781
|
-
description: Value model for multiple representations of information about the same contributor (e.g. in different languages).
|
782
|
-
deprecated: true
|
783
|
-
type: object
|
784
|
-
additionalProperties: false
|
785
|
-
properties:
|
786
|
-
name:
|
787
|
-
description: Names associated with a contributor.
|
788
|
-
type: array
|
789
|
-
items:
|
790
|
-
$ref: "#/components/schemas/DescriptiveValue"
|
791
|
-
type:
|
792
|
-
description: Entity type of the contributor (person, organization, etc.). See https://github.com/sul-dlss/cocina-models/blob/main/docs/description_types.md for valid types.
|
793
|
-
type: string
|
794
|
-
status:
|
795
|
-
description: Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
|
796
|
-
type: string
|
797
|
-
role:
|
798
|
-
description: Relationships of the contributor to the resource or to an event in its history.
|
799
|
-
type: array
|
800
|
-
items:
|
801
|
-
$ref: "#/components/schemas/DescriptiveValue"
|
802
|
-
identifier:
|
803
|
-
description: Identifiers and URIs associated with the contributor entity.
|
804
|
-
type: array
|
805
|
-
items:
|
806
|
-
$ref: "#/components/schemas/DescriptiveValue"
|
807
|
-
note:
|
808
|
-
description: Other information associated with the contributor.
|
809
|
-
type: array
|
810
|
-
items:
|
811
|
-
$ref: "#/components/schemas/DescriptiveValue"
|
812
|
-
valueAt:
|
813
|
-
description: URL or other pointer to the location of the contributor information.
|
814
|
-
type: string
|
815
|
-
valueLanguage:
|
816
|
-
# description: Language of the descriptive element value
|
817
|
-
$ref: "#/components/schemas/DescriptiveValueLanguage"
|
818
775
|
DescriptiveParallelEvent:
|
819
776
|
description: Value model for multiple representations of information about the same event (e.g. in different languages).
|
820
777
|
type: object
|
@@ -1459,7 +1416,7 @@ components:
|
|
1459
1416
|
description: Width in pixels
|
1460
1417
|
type: integer
|
1461
1418
|
Purl:
|
1462
|
-
description: Stanford persistent URL associated with the related resource.
|
1419
|
+
description: Stanford persistent URL associated with the related resource.
|
1463
1420
|
type: string
|
1464
1421
|
format: uri
|
1465
1422
|
# Canonical URI is https
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocina-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.85.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -392,7 +392,6 @@ files:
|
|
392
392
|
- lib/cocina/models/descriptive_basic_value.rb
|
393
393
|
- lib/cocina/models/descriptive_geographic_metadata.rb
|
394
394
|
- lib/cocina/models/descriptive_grouped_value.rb
|
395
|
-
- lib/cocina/models/descriptive_parallel_contributor.rb
|
396
395
|
- lib/cocina/models/descriptive_parallel_event.rb
|
397
396
|
- lib/cocina/models/descriptive_parallel_value.rb
|
398
397
|
- lib/cocina/models/descriptive_structured_value.rb
|
@@ -531,7 +530,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
531
530
|
requirements:
|
532
531
|
- - ">="
|
533
532
|
- !ruby/object:Gem::Version
|
534
|
-
version: '
|
533
|
+
version: '3.0'
|
535
534
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
536
535
|
requirements:
|
537
536
|
- - ">="
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Cocina
|
4
|
-
module Models
|
5
|
-
# DEPRECATED
|
6
|
-
# Value model for multiple representations of information about the same contributor (e.g. in different languages).
|
7
|
-
class DescriptiveParallelContributor < Struct
|
8
|
-
attribute :name, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
9
|
-
# Entity type of the contributor (person, organization, etc.). See https://github.com/sul-dlss/cocina-models/blob/main/docs/description_types.md for valid types.
|
10
|
-
attribute? :type, Types::Strict::String
|
11
|
-
# Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
|
12
|
-
attribute? :status, Types::Strict::String
|
13
|
-
attribute :role, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
14
|
-
attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
15
|
-
attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
|
16
|
-
# URL or other pointer to the location of the contributor information.
|
17
|
-
attribute? :valueAt, Types::Strict::String
|
18
|
-
attribute? :valueLanguage, DescriptiveValueLanguage.optional
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|