valkyrie 1.5.0.RC1 → 1.5.0.RC2
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 +5 -5
- data/CHANGELOG.md +11 -0
- data/README.md +55 -48
- data/lib/valkyrie/persistence/solr/orm_converter.rb +1 -1
- data/lib/valkyrie/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a34c6f01c77ee732d90f66322562160085e37800237dc332b11f7e2746988061
|
4
|
+
data.tar.gz: 5ac4dd5720a759fd1f9ce09591ad8010e9696ea4fda96dc20d6121cd72c37b8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23775f00829a543946ef3bcdd506ae9445bbf790b4e3dbc1da2e4a879ce013ef21d91b6c974f7a8a5f5db29f252148431ea19324339815a79180ea43b72ed4dc
|
7
|
+
data.tar.gz: 3cc9e68db536cb2a2f88de674b00a810884fc7dce58b3abc90c34405cc3a5e7792484e43e530e1155713799512366747f36b719f1963137de57092320f4914dc
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
# v1.5.0 RC2 2018-02-01
|
2
|
+
|
3
|
+
## Changes since last release
|
4
|
+
|
5
|
+
* Fix solr casting when an updated_at key isn't present in the solr document.
|
6
|
+
[tpendragon](https://github.com/tpendragon)
|
7
|
+
|
8
|
+
Additional thanks to the following for code review:
|
9
|
+
|
10
|
+
[mjgiarlo](https://github.com/mjgiarlo)
|
11
|
+
|
1
12
|
# v1.5.0 RC1 2018-02-01
|
2
13
|
|
3
14
|
## Changes since last release
|
data/README.md
CHANGED
@@ -18,11 +18,9 @@ Jump in: [](http://slack.samv
|
|
18
18
|
## Primary Contacts
|
19
19
|
|
20
20
|
### Product Owner
|
21
|
-
|
22
21
|
[Carolyn Cole](https://github.com/cam156)
|
23
22
|
|
24
23
|
### Technical Lead
|
25
|
-
|
26
24
|
[Trey Pendragon](https://github.com/tpendragon)
|
27
25
|
|
28
26
|
## Help
|
@@ -47,7 +45,6 @@ Valkyrie is configured in two places: an initializer that registers the persiste
|
|
47
45
|
configuration file that sets which options are used by default in which environments.
|
48
46
|
|
49
47
|
### Sample initializer: `config/initializers/valkyrie.rb`:
|
50
|
-
|
51
48
|
Here is a sample initializer that registers a couple adapters and storage adapters, in each case linking an
|
52
49
|
instance with a short name that can be used to refer to it in your application:
|
53
50
|
|
@@ -91,7 +88,8 @@ The initializer registers two `Valkyrie::MetadataAdapter` instances for storing
|
|
91
88
|
|
92
89
|
Other adapter options include `Valkyrie::Persistence::BufferedPersister` for buffering in memory before bulk
|
93
90
|
updating another persister, `Valkyrie::Persistence::CompositePersister` for storing in more than one adapter
|
94
|
-
at once, `Valkyrie::Persistence::Solr` for storing in Solr, and `Valkyrie::Persistence::Fedora` for storing
|
91
|
+
at once, `Valkyrie::Persistence::Solr` for storing in Solr, and `Valkyrie::Persistence::Fedora` for storing
|
92
|
+
in Fedora.
|
95
93
|
|
96
94
|
The initializer also registers three `Valkyrie::StorageAdapter` instances for storing files:
|
97
95
|
* `:disk` which stores files on disk
|
@@ -100,7 +98,6 @@ The initializer also registers three `Valkyrie::StorageAdapter` instances for st
|
|
100
98
|
testing)
|
101
99
|
|
102
100
|
### Sample configuration with custom `Valkyrie.config.resource_class_resolver`:
|
103
|
-
|
104
101
|
```
|
105
102
|
require 'valkyrie'
|
106
103
|
Rails.application.config.to_prepare do
|
@@ -111,7 +108,6 @@ end
|
|
111
108
|
```
|
112
109
|
|
113
110
|
### Sample configuration: `config/valkyrie.yml`:
|
114
|
-
|
115
111
|
A sample configuration file that configures your application to use different adapters:
|
116
112
|
|
117
113
|
```
|
@@ -134,26 +130,12 @@ For each environment, you must set two values:
|
|
134
130
|
|
135
131
|
The values are the short names used in your initializer.
|
136
132
|
|
137
|
-
Further details can be found on the [
|
133
|
+
Further details can be found on the [Persistence Wiki
|
134
|
+
page](https://github.com/samvera-labs/valkyrie/wiki/Persistence).
|
138
135
|
|
139
136
|
## Usage
|
140
137
|
|
141
|
-
### The Public API
|
142
|
-
|
143
|
-
Valkyrie's public API is defined by the shared specs that are used to test each of its core classes.
|
144
|
-
This include change sets, resources, persisters, adapters, and queries. When creating your own kinds of
|
145
|
-
these kinds of classes, you should use these shared specs to test your classes for conformance to
|
146
|
-
Valkyrie's API.
|
147
|
-
|
148
|
-
When breaking changes are introduced, necessitating a major version change, the shared specs will reflect
|
149
|
-
this. When new features are added and a minor version is released there will be no change to the existing shared
|
150
|
-
specs, but there may be new ones. These new shared specs will fail in your
|
151
|
-
application if you have custom adapters, but your application will still work.
|
152
|
-
|
153
|
-
Using the shared specs in your own models is described in more [detail](https://github.com/samvera-labs/valkyrie/wiki/Shared-Specs).
|
154
|
-
|
155
138
|
### Define a Custom Work
|
156
|
-
|
157
139
|
Define a custom work class:
|
158
140
|
|
159
141
|
```
|
@@ -172,7 +154,8 @@ order of multiple values.
|
|
172
154
|
attribute :authors, Valkyrie::Types::Array.meta(ordered: true)
|
173
155
|
```
|
174
156
|
|
175
|
-
Defining resource attributes is explained in greater detail
|
157
|
+
Defining resource attributes is explained in greater detail on the [Using Types Wiki
|
158
|
+
page](https://github.com/samvera-labs/valkyrie/wiki/Using-Types).
|
176
159
|
|
177
160
|
#### Work Types Generator
|
178
161
|
|
@@ -190,7 +173,6 @@ rails generate valkyrie:resource Foo/Bar title member_ids:array
|
|
190
173
|
```
|
191
174
|
|
192
175
|
### Read and Write Data
|
193
|
-
|
194
176
|
```
|
195
177
|
# initialize a metadata adapter
|
196
178
|
adapter = Valkyrie::MetadataAdapter.find(:postgres)
|
@@ -209,44 +191,64 @@ objects = adapter.query_service.find_all
|
|
209
191
|
Valkyrie.config.metadata_adapter.query_service.find_all_of_model(model: MyModel)
|
210
192
|
```
|
211
193
|
|
212
|
-
The
|
194
|
+
The Wiki documents the usage of [Queries](https://github.com/samvera-labs/valkyrie/wiki/Queries),
|
195
|
+
[Persistence](https://github.com/samvera-labs/valkyrie/wiki/Persistence), and
|
196
|
+
[ChangeSets and Dirty Tracking](https://github.com/samvera-labs/valkyrie/wiki/ChangeSets-and-Dirty-Tracking).
|
213
197
|
|
214
|
-
### Concurrency Support
|
215
|
-
|
198
|
+
### Concurrency Support
|
199
|
+
A Valkyrie repository may have concurrent updates, for example, from a load-balanced Rails application, or
|
200
|
+
from multiple [Sidekiq](https://github.com/mperham/sidekiq) background workers). In order to prevent multiple
|
201
|
+
simultaneous updates applied to the same resource from losing or corrupting data, Valkyrie supports optimistic
|
202
|
+
locking. How to use optimistic locking with Valkyrie is documented on the [Optimistic Locking Wiki
|
203
|
+
page](https://github.com/samvera-labs/valkyrie/wiki/Optimistic-Locking).
|
216
204
|
|
217
|
-
|
205
|
+
### The Public API
|
206
|
+
Valkyrie's public API is defined by the shared specs that are used to test each of its core classes.
|
207
|
+
This include change sets, resources, persisters, adapters, and queries. When creating your own kinds of
|
208
|
+
these kinds of classes, you should use these shared specs to test your classes for conformance to
|
209
|
+
Valkyrie's API.
|
218
210
|
|
219
|
-
|
211
|
+
When breaking changes are introduced, necessitating a major version change, the shared specs will reflect
|
212
|
+
this. When new features are added and a minor version is released there will be no change to the existing
|
213
|
+
shared specs, but there may be new ones. These new shared specs will fail in your application if you have
|
214
|
+
custom adapters, but your application will still work.
|
220
215
|
|
221
|
-
|
222
|
-
|
223
|
-
* Note: Enabling uuid-ossp requires database superuser privileges.
|
224
|
-
* From `psql`: `alter user [username] with superuser;`
|
216
|
+
Using the shared specs in your own models is described in more detail on the [Shared Specs Wiki
|
217
|
+
page](https://github.com/samvera-labs/valkyrie/wiki/Shared-Specs).
|
225
218
|
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
219
|
+
### Fedora 5 Compatibility
|
220
|
+
When configuring your adapter, include the `fedora_version` parameter in your metadata or storage adapter
|
221
|
+
config. If Fedora requires auth, you can also include that in the URL, e.g.:
|
222
|
+
|
223
|
+
```
|
224
|
+
Valkyrie::Storage::Fedora.new(
|
225
|
+
connection: Ldp::Client.new("http://fedoraAdmin:fedoraAdmin@localhost:8988/rest"),
|
226
|
+
fedora_version: 5
|
227
|
+
)
|
228
|
+
```
|
229
|
+
|
230
|
+
## Installing a Development environment
|
230
231
|
|
231
232
|
### With Docker
|
233
|
+
The development and test stacks use fully contained virtual volumes and bind all services to different ports,
|
234
|
+
so they can be running at the same time without issue.
|
232
235
|
|
233
236
|
#### External Requirements
|
234
237
|
* [Docker](https://store.docker.com/search?offering=community&type=edition) version >= 17.09.0
|
235
|
-
*
|
236
|
-
### Dependency Setup (Mac OSX)
|
237
238
|
|
239
|
+
### Dependency Setup (Mac OSX)
|
238
240
|
1. `brew install docker`
|
239
241
|
1. `brew install docker-machine`
|
240
242
|
1. `brew install docker-compose`
|
241
243
|
|
242
244
|
### Starting Docker (Mac OSX)
|
243
|
-
|
244
245
|
1. `docker-machine create default`
|
245
246
|
1. `docker-machine start default`
|
246
247
|
1. `eval "$(docker-machine env)"`
|
247
248
|
|
248
249
|
#### Starting the development mode dependencies
|
249
|
-
1. Start Solr, Fedora, and PostgreSQL with `rake docker:dev:daemon` (or `rake docker:dev:up` in a separate
|
250
|
+
1. Start Solr, Fedora, and PostgreSQL with `rake docker:dev:daemon` (or `rake docker:dev:up` in a separate
|
251
|
+
shell to run them in the foreground)
|
250
252
|
1. Run `rake db:create db:migrate` to initialize the database
|
251
253
|
1. Develop!
|
252
254
|
1. Run `rake docker:dev:down` to stop the server stack
|
@@ -256,19 +258,24 @@ By default, it is assumed that a Valkyrie repository implementation shall use a
|
|
256
258
|
1. `rake docker:spec`
|
257
259
|
|
258
260
|
#### To run the test suite manually
|
259
|
-
1. Start Solr, Fedora, and PostgreSQL with `rake docker:test:daemon` (or `rake docker:test:up` in a separate
|
261
|
+
1. Start Solr, Fedora, and PostgreSQL with `rake docker:test:daemon` (or `rake docker:test:up` in a separate
|
262
|
+
shell to run them in the foreground)
|
260
263
|
1. Run `rake db:create db:migrate` to initialize the database
|
261
264
|
1. Run the gem's RSpec test suite with `rspec spec` or `rake`
|
262
265
|
1. Run `rake docker:test:down` to stop the server stack
|
263
266
|
* The test stack cleans up after itself on exit.
|
264
267
|
|
265
|
-
|
266
|
-
When configuring your adapter, include the `fedora_version` parameter in your metadata or storage adapter config. If Fedora requires auth, you can also include that in the URL, e.g.:
|
267
|
-
```
|
268
|
-
Valkyrie::Storage::Fedora.new(connection: Ldp::Client.new("http://fedoraAdmin:fedoraAdmin@localhost:8988/rest"), fedora_version: 5)
|
269
|
-
```
|
268
|
+
### Without Docker
|
270
269
|
|
271
|
-
|
270
|
+
#### External Requirements
|
271
|
+
* PostgreSQL with the uuid-ossp extension.
|
272
|
+
* Note: Enabling uuid-ossp requires database superuser privileges.
|
273
|
+
* From `psql`: `alter user [username] with superuser;`
|
274
|
+
|
275
|
+
#### To run the test suite
|
276
|
+
1. Start Solr and Fedora servers for testing with `rake server:test`
|
277
|
+
1. Run `rake db:create` (First time only)
|
278
|
+
1. Run `rake db:migrate`
|
272
279
|
|
273
280
|
## Acknowledgments
|
274
281
|
|
@@ -54,7 +54,7 @@ module Valkyrie::Persistence::Solr
|
|
54
54
|
# Construct a Time object from the datestamp for the date of the last resource update indexed in Solr
|
55
55
|
# @return [Time]
|
56
56
|
def updated_at
|
57
|
-
DateTime.parse(solr_document
|
57
|
+
DateTime.parse((solr_document["updated_at_dtsi"] || solr_document["timestamp"] || solr_document["created_at_dtsi"]).to_s).utc
|
58
58
|
end
|
59
59
|
|
60
60
|
# Construct the OptimisticLockToken object using the "_version_" field value in the Solr Document
|
data/lib/valkyrie/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: valkyrie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.0.
|
4
|
+
version: 1.5.0.RC2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trey Pendragon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|
@@ -607,7 +607,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
607
607
|
version: 1.3.1
|
608
608
|
requirements: []
|
609
609
|
rubyforge_project:
|
610
|
-
rubygems_version: 2.
|
610
|
+
rubygems_version: 2.7.7
|
611
611
|
signing_key:
|
612
612
|
specification_version: 4
|
613
613
|
summary: An ORM using the Data Mapper pattern, specifically built to solve Digital
|