cocina-models 0.95.0 → 0.96.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b9e38c26d285ece89fdd8adb1faf3cc5fd19bb4c905d7cdb7a3a338948bcd43d
4
- data.tar.gz: 27aec9cce87dff1300ae06216eed4b9b8c7d2f449e6d8e5eebf209c99a201b94
3
+ metadata.gz: da05dda48140bb467d82b84614b44beea26884fcd4cd0891a507a53e6f967e5b
4
+ data.tar.gz: 322900e86d817d5d65820389fb7a6a13c92d98e4b9d6f2150e49de4ddd34785a
5
5
  SHA512:
6
- metadata.gz: f9c71b2c8b8740baf151eb3dfe150e9a614cc9c655c03f8cbf4924f884d7ce94c2909ec9e5d9a229eac56bc694cc8b9d8142072762b120e2edba98e7fe49f137
7
- data.tar.gz: 8cd9dd1787b286a9816714bf75b5d99a246ac390a914ffc83bbd6c9e79bc0d0cca1644cb4d2c16e1bbbd687a2407b3565645693ab6ac5ef60bf9ab564c4eef59
6
+ metadata.gz: ce287a4da425257a40eb13e68f7eb7c2819fcd4658cef4d1fa81dae961d4e47df7a33ed2fe385e69a122c5542f73e42a441064e8d4f36fdafa8fdf6cc1bdaa84
7
+ data.tar.gz: cf060d2984d736229e2fbd68ba28e7b3b68efae7e4f393ca0c6bdf7d09fa6ccaa8cfc6c2c0924b37c498b2d762b5817c36a74f31953a72550cd68b748ecdd355
data/.rubocop.yml CHANGED
@@ -494,3 +494,7 @@ RSpec/SpecFilePathFormat: # new in 2.24
494
494
  Enabled: true
495
495
  RSpec/SpecFilePathSuffix: # new in 2.24
496
496
  Enabled: true
497
+ RSpec/IsExpectedSpecify: # new in 2.27
498
+ Enabled: true
499
+ RSpec/RepeatedSubjectCall: # new in 2.27
500
+ Enabled: true
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocina-models (0.95.0)
4
+ cocina-models (0.96.0)
5
5
  activesupport
6
6
  deprecation
7
7
  dry-struct (~> 1.0)
@@ -21,7 +21,7 @@ PATH
21
21
  GEM
22
22
  remote: https://rubygems.org/
23
23
  specs:
24
- activesupport (7.1.3)
24
+ activesupport (7.1.3.2)
25
25
  base64
26
26
  bigdecimal
27
27
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -34,7 +34,7 @@ GEM
34
34
  ast (2.4.2)
35
35
  attr_extras (7.1.0)
36
36
  base64 (0.2.0)
37
- bigdecimal (3.1.6)
37
+ bigdecimal (3.1.7)
38
38
  byebug (11.1.3)
39
39
  committee (5.0.0)
40
40
  json_schema (~> 0.14, >= 0.14.3)
@@ -45,10 +45,9 @@ GEM
45
45
  connection_pool (2.4.1)
46
46
  deprecation (1.1.0)
47
47
  activesupport
48
- diff-lcs (1.5.0)
48
+ diff-lcs (1.5.1)
49
49
  docile (1.4.0)
50
- drb (2.2.0)
51
- ruby2_keywords
50
+ drb (2.2.1)
52
51
  dry-core (1.0.1)
53
52
  concurrent-ruby (~> 1.0)
54
53
  zeitwerk (~> 2.6)
@@ -73,7 +72,7 @@ GEM
73
72
  activesupport (>= 3.0, < 8.0)
74
73
  equivalent-xml (0.6.0)
75
74
  nokogiri (>= 1.4.3)
76
- i18n (1.14.1)
75
+ i18n (1.14.4)
77
76
  concurrent-ruby (~> 1.0)
78
77
  ice_nine (0.11.2)
79
78
  json (2.7.1)
@@ -82,10 +81,10 @@ GEM
82
81
  multi_json
83
82
  language_server-protocol (3.17.0.3)
84
83
  mini_portile2 (2.8.5)
85
- minitest (5.21.2)
84
+ minitest (5.22.3)
86
85
  multi_json (1.15.0)
87
86
  mutex_m (0.2.0)
88
- nokogiri (1.16.0)
87
+ nokogiri (1.16.3)
89
88
  mini_portile2 (~> 2.8.2)
90
89
  racc (~> 1.4)
91
90
  openapi3_parser (0.9.2)
@@ -99,29 +98,29 @@ GEM
99
98
  patience_diff (1.2.0)
100
99
  optimist (~> 3.0)
101
100
  racc (1.7.3)
102
- rack (3.0.8)
101
+ rack (3.0.10)
103
102
  rainbow (3.1.1)
104
103
  rake (13.1.0)
105
104
  regexp_parser (2.9.0)
106
105
  rexml (3.2.6)
107
- rspec (3.12.0)
108
- rspec-core (~> 3.12.0)
109
- rspec-expectations (~> 3.12.0)
110
- rspec-mocks (~> 3.12.0)
111
- rspec-core (3.12.2)
112
- rspec-support (~> 3.12.0)
113
- rspec-expectations (3.12.3)
106
+ rspec (3.13.0)
107
+ rspec-core (~> 3.13.0)
108
+ rspec-expectations (~> 3.13.0)
109
+ rspec-mocks (~> 3.13.0)
110
+ rspec-core (3.13.0)
111
+ rspec-support (~> 3.13.0)
112
+ rspec-expectations (3.13.0)
114
113
  diff-lcs (>= 1.2.0, < 2.0)
115
- rspec-support (~> 3.12.0)
116
- rspec-mocks (3.12.6)
114
+ rspec-support (~> 3.13.0)
115
+ rspec-mocks (3.13.0)
117
116
  diff-lcs (>= 1.2.0, < 2.0)
118
- rspec-support (~> 3.12.0)
119
- rspec-support (3.12.1)
117
+ rspec-support (~> 3.13.0)
118
+ rspec-support (3.13.1)
120
119
  rspec_junit_formatter (0.6.0)
121
120
  rspec-core (>= 2, < 4, != 2.12.0)
122
121
  rss (0.3.0)
123
122
  rexml
124
- rubocop (1.60.2)
123
+ rubocop (1.62.1)
125
124
  json (~> 2.3)
126
125
  language_server-protocol (>= 3.17.0)
127
126
  parallel (~> 1.10)
@@ -129,38 +128,37 @@ GEM
129
128
  rainbow (>= 2.2.2, < 4.0)
130
129
  regexp_parser (>= 1.8, < 3.0)
131
130
  rexml (>= 3.2.5, < 4.0)
132
- rubocop-ast (>= 1.30.0, < 2.0)
131
+ rubocop-ast (>= 1.31.1, < 2.0)
133
132
  ruby-progressbar (~> 1.7)
134
133
  unicode-display_width (>= 2.4.0, < 3.0)
135
- rubocop-ast (1.30.0)
136
- parser (>= 3.2.1.0)
134
+ rubocop-ast (1.31.2)
135
+ parser (>= 3.3.0.4)
137
136
  rubocop-capybara (2.20.0)
138
137
  rubocop (~> 1.41)
139
138
  rubocop-factory_bot (2.25.1)
140
139
  rubocop (~> 1.41)
141
140
  rubocop-rake (0.6.0)
142
141
  rubocop (~> 1.0)
143
- rubocop-rspec (2.26.1)
142
+ rubocop-rspec (2.27.1)
144
143
  rubocop (~> 1.40)
145
144
  rubocop-capybara (~> 2.17)
146
145
  rubocop-factory_bot (~> 2.22)
147
146
  ruby-progressbar (1.13.0)
148
- ruby2_keywords (0.0.5)
149
147
  simplecov (0.22.0)
150
148
  docile (~> 1.1)
151
149
  simplecov-html (~> 0.11)
152
150
  simplecov_json_formatter (~> 0.1)
153
151
  simplecov-html (0.12.3)
154
152
  simplecov_json_formatter (0.1.4)
155
- super_diff (0.10.0)
153
+ super_diff (0.11.0)
156
154
  attr_extras (>= 6.2.4)
157
155
  diff-lcs
158
156
  patience_diff
159
- thor (1.3.0)
157
+ thor (1.3.1)
160
158
  tzinfo (2.0.6)
161
159
  concurrent-ruby (~> 1.0)
162
160
  unicode-display_width (2.5.0)
163
- zeitwerk (2.6.12)
161
+ zeitwerk (2.6.13)
164
162
 
165
163
  PLATFORMS
166
164
  ruby
data/README.md CHANGED
@@ -83,7 +83,7 @@ export DATABASE_HOSTNAME=$DOR_SERVICES_DB_PROD_HOST
83
83
  export DATABASE_PASSWORD=$DOR_SERVICES_DB_PROD_PWD
84
84
  ```
85
85
 
86
- 4. Run `bin/validate-cocina`:
86
+ 4. Run `bin/validate-cocina` (_NOTE:_ You likely want to run this in a screen session, as it can take many hours to complete, especially against prod):
87
87
  ```
88
88
  export RUBYOPT='-W:no-deprecated -W:no-experimental'
89
89
  RAILS_ENV=production bin/validate-cocina -p 8
@@ -143,7 +143,7 @@ which pushes the gem to rubygems.org.
143
143
 
144
144
  ### Step 2: Update client gems coupled to the models
145
145
 
146
- Release new versions of [sdr-client](https://github.com/sul-dlss/sdr-client), [dor-services-client](https://github.com/sul-dlss/dor-services-client/), and [dor_indexing](https://github.com/sul-dlss/dor_indexing/) pinned to use the new cocina-models version because applications such as [Argo](https://github.com/sul-dlss/argo) and [Dor-Services-App](https://github.com/sul-dlss/dor-services-app)depend on these gems using the same models.
146
+ Release new versions of [sdr-client](https://github.com/sul-dlss/sdr-client), [dor-services-client](https://github.com/sul-dlss/dor-services-client/), and [dor_indexing](https://github.com/sul-dlss/dor_indexing/) pinned to use the new cocina-models version because applications such as [Argo](https://github.com/sul-dlss/argo) and [Dor-Services-App](https://github.com/sul-dlss/dor-services-app) depend on these gems using the same models.
147
147
 
148
148
  ### Step 3: Update services directly coupled to the models
149
149
 
@@ -164,9 +164,9 @@ This can be accomplished by copying and pasting the cocina-models schemas to the
164
164
 
165
165
  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.
166
166
 
167
- With or without step 3A, perform `bundle update` for cocina-models, sdr-client, dor-services-client and dor_indexing* gems in the listed services and then make PRs for those repos.
167
+ With or without step 3A, perform `bundle update` for cocina-models, sdr-client, dor-services-client and dor_indexing gems in the listed services and then make PRs for those repos. You may need to update how these gems are pinned in the `Gemfile` in order to bump them.
168
168
 
169
- * dor_indexing gem is used by dor_indexing_app and dor-services-app only.
169
+ NOTE: dor_indexing gem is used by dor-services-app and dor_indexing_app only. dor_indexing_app does NOT need to be updated in this step.
170
170
 
171
171
  #### Step 3C: Merge 'em
172
172
 
@@ -182,12 +182,14 @@ There are scripts to help with updating other dependent applications:
182
182
 
183
183
  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.
184
184
 
185
- 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.
185
+ 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`](https://github.com/sul-dlss/access-update-scripts/blob/master/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.
186
186
 
187
187
  #### Step 4B: Merge the Cocina Level 2 PRs
188
188
 
189
- [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`)
190
-
189
+ [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.
190
+ ```
191
+ REPOS_PATH=infrastructure GH_ACCESS_TOKEN=abc123 COCINA_LEVEL2= ./merge-all.rb
192
+ ```
191
193
  ### Step 5: Deploy all affected applications together
192
194
 
193
195
  [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).
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
+ # A type of access for an object wherein users can see the metadata and a list of files, but the files will not have view or download access
5
6
  class CitationOnlyAccess < Struct
6
7
  # Access level.
7
8
  attribute :view, Types::Strict::String.enum('citation-only')
@@ -141,12 +141,7 @@ module Cocina
141
141
  }.tap do |attributes|
142
142
  value_language = LanguageScript.build(node: node)
143
143
  attributes[:valueLanguage] = value_language if value_language
144
- value_parts = node.content.split(' -- ')
145
- if value_parts.size == 1
146
- attributes[:value] = node.content
147
- elsif value_parts.present?
148
- attributes[:structuredValue] = value_parts.map { |value_part| { value: value_part } }
149
- end
144
+ attributes[:value] = node.content if node.content.present?
150
145
  end.compact
151
146
  end
152
147
 
@@ -9,7 +9,7 @@ module Cocina
9
9
  attribute? :who, Types::Strict::String
10
10
  # What is being released. This item or the whole collection.
11
11
  # example: self
12
- attribute? :what, Types::Strict::String.enum('self', 'collection')
12
+ attribute :what, Types::Strict::String.enum('self', 'collection')
13
13
  # When did this action happen
14
14
  attribute? :date, Types::Params::DateTime
15
15
  # What platform is it released to
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.95.0'
5
+ VERSION = '0.96.0'
6
6
  end
7
7
  end
data/lib/cocina/models.rb CHANGED
@@ -85,7 +85,7 @@ module Cocina
85
85
  when *DRO::TYPES
86
86
  has_metadata?(dyn) ? DROWithMetadata : DRO
87
87
  when *Collection::TYPES
88
- has_metadata?(dyn) ? ColectionWithMetadata : Collection
88
+ has_metadata?(dyn) ? CollectionWithMetadata : Collection
89
89
  when *AdminPolicy::TYPES
90
90
  has_metadata?(dyn) ? AdminPolicyWithMetadata : AdminPolicy
91
91
  else
data/openapi.yml CHANGED
@@ -1526,6 +1526,7 @@ components:
1526
1526
  additionalProperties: false
1527
1527
  required:
1528
1528
  - release
1529
+ - what
1529
1530
  properties:
1530
1531
  who:
1531
1532
  description: Who did this release
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.95.0
4
+ version: 0.96.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: 2024-01-31 00:00:00.000000000 Z
11
+ date: 2024-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -562,7 +562,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
562
562
  - !ruby/object:Gem::Version
563
563
  version: '0'
564
564
  requirements: []
565
- rubygems_version: 3.4.10
565
+ rubygems_version: 3.5.6
566
566
  signing_key:
567
567
  specification_version: 4
568
568
  summary: Data models for the SDR