cocina-models 0.103.0 → 0.103.1
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 +4 -4
- data/.rubocop.yml +9 -0
- data/Gemfile.lock +1 -1
- data/README.md +29 -17
- data/lib/cocina/models/mapping/to_mods/title.rb +2 -0
- data/lib/cocina/models/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 439375f55b48b22cc891dde1fb31519f9b08a42b9128894cf04f643a5644a027
|
4
|
+
data.tar.gz: 7f7a68b92f272e867d6243485d4ed68c1741128c6e93785a1879b811ca0ece63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e23f7d1949ee04c1dba3bea6b64620f0ad816bde8ee02666e8af6b3c3057c86d326f586f696572e8cf0f3ba01c191444cd7501f81a8eede6fcaa45682b69fdfb
|
7
|
+
data.tar.gz: 1b215531fa86e0f049f7c38bd8819c3ae47f849d66b7217da376761e09131f1c23e60b448ae404c66ee6024f6b4f570966a07398719360739182c99e5a2649d1
|
data/.rubocop.yml
CHANGED
@@ -512,3 +512,12 @@ Style/ItAssignment: # new in 1.70
|
|
512
512
|
Enabled: true
|
513
513
|
Style/RedundantFormat: # new in 1.72
|
514
514
|
Enabled: true
|
515
|
+
|
516
|
+
Style/ComparableBetween: # new in 1.74
|
517
|
+
Enabled: true
|
518
|
+
Style/HashFetchChain: # new in 1.75
|
519
|
+
Enabled: true
|
520
|
+
Style/ItBlockParameter: # new in 1.75
|
521
|
+
Enabled: true
|
522
|
+
RSpec/IncludeExamples: # new in 3.6
|
523
|
+
Enabled: true
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -123,23 +123,28 @@ A patch change is a change that (1) does not affect the data model; (2) does not
|
|
123
123
|
|
124
124
|
A patch change can be released as part of regular dependency updates or selectively released for individual applications.
|
125
125
|
|
126
|
-
## Releasing major or minor change
|
127
|
-
|
128
|
-
NOTE: If dependency updates are about to be released, you have the option of shortening the process and stopping after Step 3. This is because Steps 4 onwards will be taken care of by the regular dependency updates process (basically the updating of cocina-models, dor-services-client and sdr-client as needed in the rest of the associated apps). You still do need to manually bump some gems and the pinned version of cocina-models in a couple apps and get those PRs approved and merged, as described in Steps 1-3 below.
|
129
|
-
|
130
|
-
IMPORTANT: If you do opt to skip steps 4 onward, you should NOT merge the cocina-models bump dor-services-app and sdr-api PRs you created in step 3 until you are ready to finish the dependency updates process. You can have them reviewed and approved, but if you merge, you will greatly increase the risk of issues if the main branch of DSA or sdr-api are deployed after steps 1-3 are complete but before the rest of the apps are updated to use the new cocina-models via regular dependency updates. The fix for this is to either roll-back DSA and sdr-api to the previous release tag, or proceed forwards with step 4-5.
|
126
|
+
## Releasing a major or minor change
|
131
127
|
|
132
128
|
Before you release a major or minor change, think about if this release will include new validations. Even if your change didn't make any changes that would affect validation, there may be other unreleased changes since the previous version of the gem was cut and released. Best practice is to scan back through the commit history until you get to the last version bump and see if there any significant changes that may affect validation.
|
133
129
|
|
134
130
|
If unsure, ask the team or ask for help to just run the validation report anyway (as described above).
|
135
131
|
|
132
|
+
### Partial release process
|
133
|
+
NOTE: If dependency updates are about to be released, you have the option of shortening the process and stopping after Step 3. This is because Steps 4 onwards will be taken care of by the regular dependency updates process (basically the updating of cocina-models, dor-services-client and sdr-client as needed in the rest of the associated apps). You still do need to manually bump some gems and the pinned version of cocina-models in the directly coupled apps and get those PRs approved and merged, as described in Steps 1-3 below.
|
134
|
+
|
135
|
+
IMPORTANT: If you do opt to skip steps 4 onward, you should NOT merge the dor-services-app and sdr-api PRs you created in step 3 until you are ready to finish the dependency updates process. You can have them reviewed and approved, but if you merge, you will greatly increase the risk of issues if the main branch of DSA or sdr-api are deployed after steps 1-3 are complete but before the rest of the apps are updated to use the new cocina-models via regular dependency updates. The fix for this is to either roll back DSA and sdr-api to the previous release tag, or proceed forwards with step 4-5.
|
136
|
+
|
136
137
|
### Step 0: Share intent to change the models
|
137
138
|
|
138
139
|
Send a note to `#dlss-infra-chg-mgmt` on Slack to let people know what is changing and when.
|
139
140
|
|
140
141
|
### Step 1: Cut the release
|
141
142
|
|
142
|
-
The release process is much like any other gem.
|
143
|
+
The release process is much like any other gem. While on main:
|
144
|
+
1. Bump the version in `lib/cocina/models/version.rb`
|
145
|
+
2. `bundle install` so that `Gemfile.lock` is updated.
|
146
|
+
3. Commit those changes.
|
147
|
+
4. Run:
|
143
148
|
```
|
144
149
|
bundle exec rake release
|
145
150
|
```
|
@@ -147,7 +152,11 @@ which pushes the gem to rubygems.org.
|
|
147
152
|
|
148
153
|
### Step 2: Update client gems coupled to the models
|
149
154
|
|
150
|
-
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/)
|
155
|
+
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/):
|
156
|
+
1. Pin the new cocina-models version in the clients' `gemspec` files.
|
157
|
+
2. Bump the version as described in each client's README release instructions.
|
158
|
+
|
159
|
+
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.
|
151
160
|
|
152
161
|
### Step 3: Update services directly coupled to the models
|
153
162
|
|
@@ -156,27 +165,31 @@ This list of services is known to include:
|
|
156
165
|
* [sul-dlss/sdr-api](https://github.com/sul-dlss/sdr-api)
|
157
166
|
* [sul-dlss/dor-services-app](https://github.com/sul-dlss/dor-services-app/)
|
158
167
|
|
159
|
-
**NOTE**: You can skip step 3A if there have not been any changes to the `cocina-models` OpenAPI spec since the prior release.
|
160
168
|
|
161
169
|
#### Step 3A: Update API specifications
|
162
170
|
|
163
|
-
|
171
|
+
**NOTE**: You can skip step 3A if there have not been any changes to the `cocina-models` OpenAPI spec since the prior release.
|
172
|
+
|
173
|
+
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 two applications includes the `openapi.yml` schema changes made in cocina-models.
|
164
174
|
|
165
|
-
|
175
|
+
Copy and paste the cocina-models schemas to each project's `openapi.yml`. By convention, these schemas are listed first, followed by the application-specific schemas.
|
166
176
|
|
167
177
|
#### Step 3B: Bump gems and create the PRs
|
168
178
|
|
169
|
-
If
|
179
|
+
If you updated the `openapi.yml` in step 3A, use the same PR for step 3B. 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.
|
170
180
|
|
171
|
-
|
181
|
+
1. Perform `bundle update --conservative cocina-models dor-services-client` in the services above and make PRs for those repos if they don't already exist. You may first need to update how these gems are pinned in the `Gemfile` in order to bump them.
|
182
|
+
2. Note that sdr-client is not currently used in these applications, but if it were, would also need to be bumped to the latest release.
|
172
183
|
|
173
184
|
#### Step 3C: Merge 'em
|
174
185
|
|
175
|
-
Get the directly coupled services PRs merged before the deploy in step 5.
|
186
|
+
Get the directly coupled services PRs merged before the deploy in step 5.
|
187
|
+
|
188
|
+
See the IMPORTANT note above about the timing of merging these PRs if you are waiting for dependency updates to make the updates to other dependent applications.
|
176
189
|
|
177
190
|
### Step 4: Update other dependent applications
|
178
191
|
|
179
|
-
|
192
|
+
All applications that use cocina-models should be updated and released at the same time. "Cocina Level 2" describes this set of updates. The applications that use cocina-models are those in [this list](https://github.com/sul-dlss/access-update-scripts/blob/master/infrastructure/projects.yml) that are NOT marked with `cocina_level2: false`.
|
180
193
|
|
181
194
|
There are scripts to help with updating other dependent applications:
|
182
195
|
|
@@ -192,14 +205,13 @@ If for some reason the above method does not work, the sul-dlss/access-update-sc
|
|
192
205
|
```
|
193
206
|
REPOS_PATH=infrastructure GH_ACCESS_TOKEN=abc123 COCINA_LEVEL2= ./merge-all.rb
|
194
207
|
```
|
195
|
-
### Step 5: Deploy
|
208
|
+
### Step 5: Deploy and test
|
196
209
|
|
210
|
+
#### Step 5A: Deploy to Stage or QA
|
197
211
|
[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).
|
198
212
|
|
199
213
|
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.
|
200
214
|
|
201
|
-
#### Step 5A: Deploy to QA and/or Stage
|
202
|
-
|
203
215
|
#### Step 5B: Run infrastructure_integration_tests
|
204
216
|
|
205
217
|
It is safest to ensure _all_ the integration tests run cleanly. However, patch releases of cocina-models may only warrant running individual tests that exercise the changes.
|
@@ -185,6 +185,8 @@ module Cocina
|
|
185
185
|
else
|
186
186
|
title_parts.each do |title_part|
|
187
187
|
title_type = tag_name_for(title_part)
|
188
|
+
raise "Unknown title type for: #{title_part.to_h}" unless title_type
|
189
|
+
|
188
190
|
title_value = title_value_for(title_part, title_type, title)
|
189
191
|
xml.public_send(title_type, title_value) if title_part.note.blank?
|
190
192
|
end
|