valkyrie 2.1.2 → 3.0.0.pre.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +36 -1
- data/.lando.yml +18 -0
- data/.rubocop.yml +10 -0
- data/.tool-versions +1 -1
- data/Appraisals +15 -0
- data/CHANGELOG.md +74 -14
- data/CONTRIBUTING.md +30 -8
- data/README.md +6 -17
- data/Rakefile +6 -1
- data/db/config.yml +1 -1
- data/gemfiles/activerecord_5_2.gemfile +0 -1
- data/gemfiles/activerecord_6_0.gemfile +0 -1
- data/gemfiles/activerecord_7_0.gemfile +11 -0
- data/gemfiles/faraday_0.gemfile +12 -0
- data/gemfiles/faraday_1.gemfile +12 -0
- data/lib/valkyrie/id.rb +1 -16
- data/lib/valkyrie/persistence/buffered_persister.rb +2 -2
- data/lib/valkyrie/persistence/composite_persister.rb +3 -3
- data/lib/valkyrie/persistence/custom_query_container.rb +8 -16
- data/lib/valkyrie/persistence/fedora/metadata_adapter.rb +5 -1
- data/lib/valkyrie/persistence/fedora/ordered_list.rb +4 -6
- data/lib/valkyrie/persistence/fedora/persister/model_converter.rb +0 -1
- data/lib/valkyrie/persistence/fedora/persister/orm_converter.rb +1 -26
- data/lib/valkyrie/persistence/fedora/persister.rb +3 -1
- data/lib/valkyrie/persistence/fedora/query_service.rb +1 -1
- data/lib/valkyrie/persistence/memory/persister.rb +18 -2
- data/lib/valkyrie/persistence/postgres/metadata_adapter.rb +11 -1
- data/lib/valkyrie/persistence/postgres/persister.rb +4 -1
- data/lib/valkyrie/persistence/solr/metadata_adapter.rb +15 -3
- data/lib/valkyrie/persistence/solr/model_converter.rb +8 -25
- data/lib/valkyrie/persistence/solr/orm_converter.rb +1 -1
- data/lib/valkyrie/persistence/solr/persister.rb +16 -4
- data/lib/valkyrie/persistence/solr/queries/find_by_alternate_identifier_query.rb +1 -1
- data/lib/valkyrie/persistence/solr/queries/find_by_id_query.rb +1 -1
- data/lib/valkyrie/persistence/solr/repository.rb +17 -7
- data/lib/valkyrie/persistence.rb +2 -0
- data/lib/valkyrie/rdf_patches.rb +1 -0
- data/lib/valkyrie/resource/access_controls.rb +1 -1
- data/lib/valkyrie/resource.rb +0 -1
- data/lib/valkyrie/specs/shared_specs/change_set_persister.rb +1 -0
- data/lib/valkyrie/specs/shared_specs/file.rb +1 -0
- data/lib/valkyrie/specs/shared_specs/persister.rb +21 -3
- data/lib/valkyrie/specs/shared_specs/queries.rb +11 -0
- data/lib/valkyrie/specs/shared_specs/resource.rb +1 -1
- data/lib/valkyrie/specs/shared_specs/storage_adapter.rb +19 -0
- data/lib/valkyrie/specs/shared_specs/write_only/metadata_adapter.rb +62 -0
- data/lib/valkyrie/specs/shared_specs.rb +2 -0
- data/lib/valkyrie/storage/disk.rb +25 -2
- data/lib/valkyrie/storage/fedora.rb +1 -1
- data/lib/valkyrie/storage_adapter.rb +1 -1
- data/lib/valkyrie/version.rb +1 -1
- data/lib/valkyrie/vocab/pcdm_use.rb +13 -0
- data/lib/valkyrie.rb +0 -15
- data/valkyrie.gemspec +2 -3
- metadata +31 -33
- data/lib/config/database_connection.rb +0 -15
- data/lib/generators/valkyrie/resource_generator.rb +0 -27
- data/lib/generators/valkyrie/templates/resource.rb.erb +0 -8
- data/lib/generators/valkyrie/templates/resource_spec.rb.erb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92a63ed951bdc096d910ffcc3b357f5723607c7014dabe1e7e9e1fd83e33c6aa
|
4
|
+
data.tar.gz: 065703d34ed3cc701d72f83fe23a73f56ae504e1f4448db9b35c62c831246049
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 673a3dd11538cccf8c99de59d303a58ae225bfd672dec42e19c1eb436e5a1112924b49319b72127d1f6cc8c0c555ebb748b2029f3cafb9f81dd5925ac6a3f6b8
|
7
|
+
data.tar.gz: 0b3ecfd44279c35865cd42e50ff7d40cc8d983f87cffccc09573f7c8ded1148e19e3855089bb9bdea72708efa528bb91bdd0f877f4c3b9abd33a7dc52f6c8251
|
data/.circleci/config.yml
CHANGED
@@ -28,13 +28,28 @@ jobs:
|
|
28
28
|
environment:
|
29
29
|
CATALINA_OPTS: "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"
|
30
30
|
JAVA_OPTIONS: "-Djetty.http.port=8998 -Dfcrepo.dynamic.jms.port=61618 -Dfcrepo.dynamic.stomp.port=61614"
|
31
|
+
- image: fcrepo/fcrepo:6.0.0
|
32
|
+
environment:
|
33
|
+
CATALINA_OPTS: "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true"
|
34
|
+
JAVA_OPTS: "-Djetty.http.port=8978 -Dfcrepo.dynamic.jms.port=61619 -Dfcrepo.dynamic.stomp.port=61615 -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true"
|
31
35
|
- image: solr:7.7-alpine
|
32
36
|
command: bin/solr -cloud -noprompt -f -p 8994
|
33
37
|
environment:
|
34
38
|
BUNDLE_GEMFILE: << parameters.gemfile >>
|
35
39
|
POSTGRES_PORT: 5432
|
40
|
+
FEDORA_6_PORT: 8080
|
36
41
|
steps:
|
37
42
|
- checkout
|
43
|
+
|
44
|
+
- run:
|
45
|
+
name: Check for 'master' branch
|
46
|
+
command: |
|
47
|
+
git fetch --all --quiet --prune --prune-tags
|
48
|
+
if [[ -n "$(git branch --all --list master */master)" ]]; then
|
49
|
+
echo "A branch named 'master' was found. Please remove it."
|
50
|
+
echo "$(git branch --all --list master */master)"
|
51
|
+
fi
|
52
|
+
[[ -z "$(git branch --all --list master */master)" ]]
|
38
53
|
- run:
|
39
54
|
name: Wait for solr
|
40
55
|
command: dockerize -wait tcp://localhost:8994 -timeout 1m
|
@@ -50,7 +65,7 @@ jobs:
|
|
50
65
|
- restore_cache:
|
51
66
|
keys:
|
52
67
|
- bundle-{{ checksum "<< parameters.gemfile >>" }}-{{ checksum "valkyrie.gemspec" }}-<< parameters.ruby >>-6
|
53
|
-
- run: sudo apt
|
68
|
+
- run: sudo apt update -y && sudo apt-get install -y libpq-dev lsof
|
54
69
|
- run:
|
55
70
|
name: Set BUNDLE_GEMFILE
|
56
71
|
command: |
|
@@ -83,6 +98,18 @@ workflows:
|
|
83
98
|
gemfile: "gemfiles/activerecord_6_0.gemfile"
|
84
99
|
ruby: 2.7.0
|
85
100
|
name: "Ruby2-7_Rails6-0"
|
101
|
+
- build:
|
102
|
+
gemfile: "gemfiles/activerecord_7_0.gemfile"
|
103
|
+
ruby: 2.7.5
|
104
|
+
name: "Ruby2-7_rails7-0"
|
105
|
+
- build:
|
106
|
+
gemfile: "gemfiles/faraday_1.gemfile"
|
107
|
+
ruby: 2.7.0
|
108
|
+
name: "Faraday1"
|
109
|
+
- build:
|
110
|
+
gemfile: "gemfiles/faraday_0.gemfile"
|
111
|
+
ruby: 2.7.0
|
112
|
+
name: "Faraday0"
|
86
113
|
- build:
|
87
114
|
gemfile: "gemfiles/activerecord_6_0.gemfile"
|
88
115
|
ruby: 2.6.5
|
@@ -112,6 +139,14 @@ workflows:
|
|
112
139
|
gemfile: "gemfiles/activerecord_6_0.gemfile"
|
113
140
|
ruby: 2.7.0
|
114
141
|
name: "Ruby2-7_Rails6-0"
|
142
|
+
- build:
|
143
|
+
gemfile: "gemfiles/faraday_1.gemfile"
|
144
|
+
ruby: 2.7.0
|
145
|
+
name: "Faraday1"
|
146
|
+
- build:
|
147
|
+
gemfile: "gemfiles/faraday_0.gemfile"
|
148
|
+
ruby: 2.7.0
|
149
|
+
name: "Faraday0"
|
115
150
|
- build:
|
116
151
|
gemfile: "gemfiles/activerecord_6_0.gemfile"
|
117
152
|
ruby: 2.6.5
|
data/.lando.yml
CHANGED
@@ -38,3 +38,21 @@ services:
|
|
38
38
|
ports:
|
39
39
|
- 8998:8080
|
40
40
|
portforward: true
|
41
|
+
valkyrie_fedora_6:
|
42
|
+
type: compose
|
43
|
+
app_mount: false
|
44
|
+
volumes:
|
45
|
+
fedora6:
|
46
|
+
services:
|
47
|
+
image: fcrepo/fcrepo:6.0.0
|
48
|
+
command:
|
49
|
+
- "catalina.sh"
|
50
|
+
- "run"
|
51
|
+
volumes:
|
52
|
+
- fedora6:/data
|
53
|
+
ports:
|
54
|
+
- 8978:8080
|
55
|
+
environment:
|
56
|
+
CATALINA_OPTS: "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true"
|
57
|
+
JAVA_OPTS: "-Dfcrepo.dynamic.jms.port=61619 -Dfcrepo.dynamic.stomp.port=61615 -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true"
|
58
|
+
portforward: true
|
data/.rubocop.yml
CHANGED
@@ -39,3 +39,13 @@ Naming/FileName:
|
|
39
39
|
Exclude:
|
40
40
|
- 'Appraisals'
|
41
41
|
- 'Gemfile'
|
42
|
+
Metrics/MethodLength:
|
43
|
+
Exclude:
|
44
|
+
- 'lib/valkyrie/persistence/postgres/persister.rb'
|
45
|
+
- 'lib/valkyrie/persistence/fedora/persister.rb'
|
46
|
+
Metrics/CyclomaticComplexity:
|
47
|
+
Exclude:
|
48
|
+
- 'lib/valkyrie/persistence/postgres/persister.rb'
|
49
|
+
RSpec/VerifiedDoubles:
|
50
|
+
Exclude:
|
51
|
+
- 'spec/valkyrie/persistence/postgres/metadata_adapter_spec.rb'
|
data/.tool-versions
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby 2.
|
1
|
+
ruby 2.7.5
|
data/Appraisals
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
3
|
+
appraise "activerecord-7-0" do
|
4
|
+
gem "activerecord", "~> 7.0.0"
|
5
|
+
end
|
6
|
+
|
2
7
|
appraise "activerecord-6-0" do
|
3
8
|
gem "activerecord", "~> 6.0.0"
|
4
9
|
end
|
@@ -6,3 +11,13 @@ end
|
|
6
11
|
appraise "activerecord-5-2" do
|
7
12
|
gem "activerecord", "~> 5.2.0"
|
8
13
|
end
|
14
|
+
|
15
|
+
appraise "faraday-0" do
|
16
|
+
gem "faraday", "< 1"
|
17
|
+
gem "activerecord", "~> 6.0.0"
|
18
|
+
end
|
19
|
+
|
20
|
+
appraise "faraday-1" do
|
21
|
+
gem "faraday", "~> 1.0"
|
22
|
+
gem "activerecord", "~> 6.0.0"
|
23
|
+
end
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,64 @@
|
|
1
|
-
#
|
1
|
+
# v3.0.0.beta2 2022-06-15
|
2
|
+
|
3
|
+
## Changes since last release
|
4
|
+
|
5
|
+
* Update pcdm_use warning
|
6
|
+
[dchandekstark](https://github.com/dchandekstark)
|
7
|
+
* Add support for Faraday 2
|
8
|
+
[tpendragon](https://github.com/tpendragon)
|
9
|
+
* Rails 7 Support
|
10
|
+
[cgalarza](https://github.com/cgalarza)
|
11
|
+
[tpendragon](https://github.com/tpendragon)
|
12
|
+
* Support discovery of multiple disk adapters on different paths.
|
13
|
+
[no-reply](https://github.com/tpendragon)
|
14
|
+
* New Product Owner: Alexandra Dunn!
|
15
|
+
[dunn](https://github.com/dunn)
|
16
|
+
|
17
|
+
Additional thanks to the following for code review and issue reports leading to
|
18
|
+
this release:
|
19
|
+
|
20
|
+
[cjcolvar](https://github.com/cjcolvar)
|
21
|
+
|
22
|
+
# v3.0.0.beta1 2021-10-18
|
23
|
+
|
24
|
+
## Changes since last release
|
25
|
+
|
26
|
+
* More informative NoMethodError for missing custom queries.
|
27
|
+
[no-reply](https://github.com/no-reply)
|
28
|
+
* Persisters error if you save something which existed at query time, but has
|
29
|
+
since been deleted.
|
30
|
+
* Shared write-only persisters.
|
31
|
+
* Solr ModelConverter performance.
|
32
|
+
* Don't hold open a file handle from StorageAdapter#upload/find_by
|
33
|
+
* Files can be #close'd.
|
34
|
+
* Remove Draper
|
35
|
+
* Remove deprecated string equality function.
|
36
|
+
* Remove deprecated BlacklistedValue.
|
37
|
+
* Allow reform upgrade to 2.6.
|
38
|
+
* Don't require a specific error message in shared specs
|
39
|
+
[tpendragon](https://github.com/tpendragon)
|
40
|
+
|
41
|
+
Additional thanks to the following for code review and issue reports leading to
|
42
|
+
this release:
|
43
|
+
|
44
|
+
[hackartisan](https://github.com/hackartisan)
|
45
|
+
[eliotjordan](https://github.com/eliotjordan)
|
46
|
+
|
47
|
+
|
48
|
+
# v2.2.0 2021-05-06
|
49
|
+
|
50
|
+
## Changes since last release
|
51
|
+
|
52
|
+
* Add support for Fedora 6.
|
53
|
+
[tpendragon](https://github.com/tpendragon)
|
54
|
+
* Deprecate pcdmuse:PreservationMasterFile in favor of pcdmuse:PreservationFile
|
55
|
+
[escowles](https://github.com/escowles)
|
56
|
+
* Improve spec docs for resource.rb
|
57
|
+
[dchandekstark](https://github.com/dchandekstark)
|
58
|
+
* Memoize resource in Solr queries to reduce Solr calls.
|
59
|
+
[dchandekstark](https://github.com/dchandekstark)
|
60
|
+
|
61
|
+
# v2.1.2 2021-04-19
|
2
62
|
|
3
63
|
## Changes since last release
|
4
64
|
|
@@ -47,9 +107,9 @@ this release:
|
|
47
107
|
* Use `::` prefixed names for `JSON::LD` references.
|
48
108
|
[no-reply](https://github.com/no-reply)
|
49
109
|
* Use SVG instead of PNG for version badge.
|
50
|
-
[
|
110
|
+
[hackartisan](https://github.com/hackartisan)
|
51
111
|
* Fix Rubocop for latest Bixby.
|
52
|
-
[
|
112
|
+
[hackartisan](https://github.com/hackartisan)
|
53
113
|
* Valkyrie IDs equal string equivalent of ID to String with config
|
54
114
|
[jlevnhv](https://github.com/jlevnhv)
|
55
115
|
* Add optional model parameter to find_inverse_references_by and
|
@@ -194,7 +254,7 @@ involved for their contributions in the last year:
|
|
194
254
|
[cjcolvar](https://github.com/cjcolvar)
|
195
255
|
[dgcliff](https://github.com/dgcliff)
|
196
256
|
[escowles](https://github.com/escowles)
|
197
|
-
[
|
257
|
+
[hackartisan](https://github.com/hackartisan)
|
198
258
|
[jeremyf](https://github.com/jeremyf)
|
199
259
|
[jrgriffiniii](https://github.com/jrgriffiniii)
|
200
260
|
[kelynch](https://github.com/kelynch)
|
@@ -275,17 +335,17 @@ this release:
|
|
275
335
|
* Provide a warning when postgres adapter overwrites an ID, deprecate this
|
276
336
|
behavior so it will throw an exception in the future.
|
277
337
|
[cam156](https://github.com/cam156)
|
278
|
-
[
|
338
|
+
[hackartisan](https://github.com/hackartisan)
|
279
339
|
[tpendragon](https://github.com/tpendragon)
|
280
340
|
* Add support for passing just an ID to find_inverse_references_by
|
281
341
|
[cam156](https://github.com/cam156)
|
282
|
-
[
|
342
|
+
[hackartisan](https://github.com/hackartisan)
|
283
343
|
* Fix memory adapter raising an exception in find_by_alternate_identifier when
|
284
344
|
there are resources without the alternate_identifier attribute.
|
285
345
|
[jeremyf](https://github.com/jeremyf)
|
286
346
|
* Provide a warning when using the postgres adapter without manually providing
|
287
347
|
the pg gem, so it can be an optional dependency in 2.0.0.
|
288
|
-
[
|
348
|
+
[hackartisan](https://github.com/hackartisan)
|
289
349
|
* Provide guidance in specs on how to define alternate_ids
|
290
350
|
[cjcolvar](https://github.com/cjcolvar)
|
291
351
|
* Upload files to Fedora using form/multipart.
|
@@ -331,17 +391,17 @@ Additional thanks to the following for code review:
|
|
331
391
|
* Provide a warning when postgres adapter overwrites an ID, deprecate this
|
332
392
|
behavior so it will throw an exception in the future.
|
333
393
|
[cam156](https://github.com/cam156)
|
334
|
-
[
|
394
|
+
[hackartisan](https://github.com/hackartisan)
|
335
395
|
[tpendragon](https://github.com/tpendragon)
|
336
396
|
* Add support for passing just an ID to find_inverse_references_by
|
337
397
|
[cam156](https://github.com/cam156)
|
338
|
-
[
|
398
|
+
[hackartisan](https://github.com/hackartisan)
|
339
399
|
* Fix memory adapter raising an exception in find_by_alternate_identifier when
|
340
400
|
there are resources without the alternate_identifier attribute.
|
341
401
|
[jeremyf](https://github.com/jeremyf)
|
342
402
|
* Provide a warning when using the postgres adapter without manually providing
|
343
403
|
the pg gem, so it can be an optional dependency in 2.0.0.
|
344
|
-
[
|
404
|
+
[hackartisan](https://github.com/hackartisan)
|
345
405
|
* Provide guidance in specs on how to define alternate_ids
|
346
406
|
[cjcolvar](https://github.com/cjcolvar)
|
347
407
|
* Upload files to Fedora using form/multipart.
|
@@ -392,7 +452,7 @@ this release:
|
|
392
452
|
## Changes since last release
|
393
453
|
|
394
454
|
* Fix solr persister to pass through exceptions on timeout
|
395
|
-
[
|
455
|
+
[hackartisan](https://github.com/hackartisan)
|
396
456
|
* Fix generated specs to work with shared_specs expectation
|
397
457
|
[revgum](https://github.com/revgum)
|
398
458
|
|
@@ -439,7 +499,7 @@ following participants who made it happen:
|
|
439
499
|
* [cam156](https://github.com/cam156)
|
440
500
|
* [DanCoughlin](https://github.com/DanCoughlin)
|
441
501
|
* [escowles](https://github.com/escowles)
|
442
|
-
* [
|
502
|
+
* [hackartisan](https://github.com/hackartisan)
|
443
503
|
* [jrgriffiniii](https://github.com/jrgriffiniii)
|
444
504
|
* [mtribone](https://github.com/mtribone)
|
445
505
|
* [tpendragon](https://github.com/tpendragon)
|
@@ -456,7 +516,7 @@ following participants who made it happen:
|
|
456
516
|
## Changes since last release
|
457
517
|
|
458
518
|
* Loosened ActiveRecord restriction to allow upgrading pg gem to 1.0.
|
459
|
-
[
|
519
|
+
[hackartisan](https://github.com/hackartisan)
|
460
520
|
|
461
521
|
# v1.1.0 2018-05-08
|
462
522
|
|
@@ -535,7 +595,7 @@ Initial Release
|
|
535
595
|
* [dlpierce](https://github.com/dlpierce)
|
536
596
|
* [escowles](https://github.com/escowles)
|
537
597
|
* [geekscruff](https://github.com/geekscruff)
|
538
|
-
* [
|
598
|
+
* [hackartisan](https://github.com/hackartisan)
|
539
599
|
* [jcoyne](https://github.com/jcoyne)
|
540
600
|
* [jeremyf](https://github.com/jeremyf)
|
541
601
|
* [jgondron](https://github.com/jgondron)
|
data/CONTRIBUTING.md
CHANGED
@@ -22,6 +22,28 @@ https://wiki.duraspace.org/display/samvera/Samvera+Community+Intellectual+Proper
|
|
22
22
|
|
23
23
|
You should also add yourself to the `CONTRIBUTORS.md` file in the root of the project.
|
24
24
|
|
25
|
+
## Language
|
26
|
+
The language we use matters. Today, tomorrow, and for years to come
|
27
|
+
people will read the code we write. They will judge us for our
|
28
|
+
design, logic, and the words we use to describe the system.
|
29
|
+
Our words should be accessible. Favor descriptive words that give
|
30
|
+
meaning while avoiding reinforcing systemic inequities. For example,
|
31
|
+
in the Samvera community, we should favor using allowed\_list instead
|
32
|
+
of whitelist, denied\_list instead of blacklist, or source/copy
|
33
|
+
instead of master/slave.
|
34
|
+
We're going to get it wrong, but this is a call to keep working to
|
35
|
+
make it right. View our code and the words we choose as a chance to
|
36
|
+
have a conversation. A chance to grow an understanding of the systems
|
37
|
+
we develop as well as the systems in which we live.
|
38
|
+
See [“Blacklists” and “whitelists”: a salutary warning concerning the
|
39
|
+
prevalence of racist language in discussions of predatory
|
40
|
+
publishing](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6148600/) for
|
41
|
+
further details.
|
42
|
+
|
43
|
+
If you're working on PR for this project, create a feature branch off of `main`.
|
44
|
+
|
45
|
+
Please ***do not*** create a branch called `master` for this repository or as part of your pull request; the branch will either need to be removed or renamed before it can be considered for inclusion in the code base and history of our repositories.
|
46
|
+
|
25
47
|
## Contribution Tasks
|
26
48
|
|
27
49
|
* Reporting Issues
|
@@ -45,10 +67,10 @@ You should also add yourself to the `CONTRIBUTORS.md` file in the root of the pr
|
|
45
67
|
|
46
68
|
* Fork the repository on GitHub
|
47
69
|
* Create a topic branch from where you want to base your work.
|
48
|
-
* This is usually the
|
49
|
-
* To quickly create a topic branch based on
|
50
|
-
* Then checkout the new branch with `git checkout fix/
|
51
|
-
* Please avoid working directly on the `
|
70
|
+
* This is usually the main branch.
|
71
|
+
* To quickly create a topic branch based on main; `git branch fix/main/my_contribution main`
|
72
|
+
* Then checkout the new branch with `git checkout fix/main/my_contribution`.
|
73
|
+
* Please avoid working directly on the `main` branch.
|
52
74
|
* You may find the [hub suite of commands](https://github.com/defunkt/hub) helpful
|
53
75
|
* Make sure you have added sufficient tests and documentation for your changes.
|
54
76
|
* Test functionality with RSpec; Test features / UI with Capybara.
|
@@ -109,15 +131,15 @@ You should also add yourself to the `CONTRIBUTORS.md` file in the root of the pr
|
|
109
131
|
### Submitting Changes
|
110
132
|
|
111
133
|
* Read the article ["Using Pull Requests"](https://help.github.com/articles/using-pull-requests) on GitHub.
|
112
|
-
* Make sure your branch is up to date with its parent branch (i.e.
|
113
|
-
* `git checkout
|
134
|
+
* Make sure your branch is up to date with its parent branch (i.e. main)
|
135
|
+
* `git checkout main`
|
114
136
|
* `git pull --rebase`
|
115
137
|
* `git checkout <your-branch>`
|
116
|
-
* `git rebase
|
138
|
+
* `git rebase main`
|
117
139
|
* It is a good idea to run your tests again.
|
118
140
|
* If you've made more than one commit take a moment to consider whether squashing commits together would help improve their logical grouping.
|
119
141
|
* [Detailed Walkthrough of One Pull Request per Commit](http://ndlib.github.io/practices/one-commit-per-pull-request/)
|
120
|
-
* `git rebase --interactive
|
142
|
+
* `git rebase --interactive main` ([See Github help](https://help.github.com/articles/interactive-rebase))
|
121
143
|
* Squashing your branch's changes into one commit is "good form" and helps the person merging your request to see everything that is going on.
|
122
144
|
* Push your changes to a topic branch in your fork of the repository.
|
123
145
|
* Submit a pull request from your fork to the project.
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ Jump in: [![Slack Status](http://slack.samvera.org/badge.svg)](http://slack.samv
|
|
17
17
|
## Primary Contacts
|
18
18
|
|
19
19
|
### Product Owner
|
20
|
-
[
|
20
|
+
[Alexandra Dunn](https://github.com/dunn)
|
21
21
|
|
22
22
|
### Technical Lead
|
23
23
|
[Trey Pendragon](https://github.com/tpendragon)
|
@@ -180,21 +180,6 @@ attribute :authors, Valkyrie::Types::Array.meta(ordered: true)
|
|
180
180
|
Defining resource attributes is explained in greater detail on the [Using Types Wiki
|
181
181
|
page](https://github.com/samvera/valkyrie/wiki/Using-Types).
|
182
182
|
|
183
|
-
#### Work Types Generator
|
184
|
-
|
185
|
-
To create a custom Valkyrie model in your application, you can use the Rails generator. For example, to
|
186
|
-
generate a model named `FooBar` with an unordered `title` field and an ordered `member_ids` field:
|
187
|
-
|
188
|
-
```
|
189
|
-
rails generate valkyrie:resource FooBar title member_ids:array
|
190
|
-
```
|
191
|
-
|
192
|
-
You can namespace your model class by including a slash in the model name:
|
193
|
-
|
194
|
-
```
|
195
|
-
rails generate valkyrie:resource Foo/Bar title member_ids:array
|
196
|
-
```
|
197
|
-
|
198
183
|
### Read and Write Data
|
199
184
|
```
|
200
185
|
# initialize a metadata adapter
|
@@ -239,7 +224,7 @@ custom adapters, but your application will still work.
|
|
239
224
|
Using the shared specs in your own models is described in more detail on the [Shared Specs Wiki
|
240
225
|
page](https://github.com/samvera/valkyrie/wiki/Shared-Specs).
|
241
226
|
|
242
|
-
### Fedora 5 Compatibility
|
227
|
+
### Fedora 5/6 Compatibility
|
243
228
|
When configuring your adapter, include the `fedora_version` parameter in your metadata or storage adapter
|
244
229
|
config. If Fedora requires auth, you can also include that in the URL, e.g.:
|
245
230
|
|
@@ -282,3 +267,7 @@ This software has been developed by and is brought to you by the Samvera communi
|
|
282
267
|
## Contributing
|
283
268
|
|
284
269
|
Bug reports and pull requests are welcome on GitHub at https://github.com/samvera/valkyrie/.
|
270
|
+
|
271
|
+
If you're working on PR for this project, create a feature branch off of `main`.
|
272
|
+
|
273
|
+
This repository follows the [Samvera Community Code of Conduct](https://samvera.atlassian.net/wiki/spaces/samvera/pages/405212316/Code+of+Conduct) and [language recommendations](https://github.com/samvera/maintenance/blob/master/templates/CONTRIBUTING.md#language). Please ***do not*** create a branch called `master` for this repository or as part of your pull request; the branch will either need to be removed or renamed before it can be considered for inclusion in the code base and history of this repository.
|
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
require "bundler/gem_tasks"
|
3
3
|
require "rspec/core/rake_task"
|
4
4
|
require 'yaml'
|
5
|
-
|
5
|
+
require_relative 'spec/support/database_connection.rb'
|
6
6
|
require 'active_record'
|
7
7
|
require 'rubocop/rake_task'
|
8
8
|
load 'tasks/dev.rake'
|
@@ -32,6 +32,11 @@ namespace :db do
|
|
32
32
|
task configure_connection: :configuration do
|
33
33
|
DatabaseConnection.connect!(DATABASE_ENV)
|
34
34
|
ActiveRecord::Base.logger = Logger.new STDOUT if @config['logger']
|
35
|
+
@config = if ::ActiveRecord::Base.configurations.respond_to?(:configs_for)
|
36
|
+
::ActiveRecord::Base.configurations.configs_for(env_name: DATABASE_ENV.to_s)[0]
|
37
|
+
else
|
38
|
+
::ActiveRecord::Base.configurations[DATABASE_ENV.to_s]
|
39
|
+
end
|
35
40
|
end
|
36
41
|
|
37
42
|
desc 'Create the database from db/config.yml for the current DATABASE_ENV'
|
data/db/config.yml
CHANGED
data/lib/valkyrie/id.rb
CHANGED
@@ -25,27 +25,12 @@ module Valkyrie
|
|
25
25
|
delegate :hash, to: :state
|
26
26
|
|
27
27
|
def eql?(other)
|
28
|
-
|
29
|
-
default_equality(other)
|
28
|
+
other == to_str
|
30
29
|
end
|
31
30
|
alias == eql?
|
32
31
|
|
33
32
|
protected
|
34
33
|
|
35
|
-
def default_equality(other)
|
36
|
-
output = (other.class == self.class && other.state == state)
|
37
|
-
return output if output == true
|
38
|
-
if output == false && string_equality(other) && Valkyrie.config.id_string_equality.nil?
|
39
|
-
warn "[DEPRECATION] Valkyrie::IDs will always be equal to their string counterparts in 3.0.0. " \
|
40
|
-
"To silence this message, please either compare IDs or set Valkyrie.config.id_string_equality = true."
|
41
|
-
end
|
42
|
-
false
|
43
|
-
end
|
44
|
-
|
45
|
-
def string_equality(other)
|
46
|
-
other == to_str
|
47
|
-
end
|
48
|
-
|
49
34
|
def state
|
50
35
|
[@id]
|
51
36
|
end
|
@@ -24,8 +24,8 @@ module Valkyrie::Persistence
|
|
24
24
|
@buffer_class = buffer_class
|
25
25
|
end
|
26
26
|
|
27
|
-
def save(resource:)
|
28
|
-
persister.save(resource: resource)
|
27
|
+
def save(resource:, external_resource: false)
|
28
|
+
persister.save(resource: resource, external_resource: external_resource)
|
29
29
|
end
|
30
30
|
|
31
31
|
def save_all(resources:)
|
@@ -24,14 +24,14 @@ module Valkyrie::Persistence
|
|
24
24
|
end
|
25
25
|
|
26
26
|
# (see Valkyrie::Persistence::Memory::Persister#save)
|
27
|
-
def save(resource:)
|
27
|
+
def save(resource:, external_resource: false)
|
28
28
|
# Assume the first persister is the canonical data store; that's the optlock we want
|
29
29
|
first, *rest = *persisters
|
30
|
-
cached_resource = first.save(resource: resource)
|
30
|
+
cached_resource = first.save(resource: resource, external_resource: external_resource)
|
31
31
|
# Don't pass opt lock tokens to other persisters
|
32
32
|
internal_resource = cached_resource.dup
|
33
33
|
internal_resource.clear_optimistic_lock_token!
|
34
|
-
rest.inject(internal_resource) { |m, persister| persister.save(resource: m) }
|
34
|
+
rest.inject(internal_resource) { |m, persister| persister.save(resource: m, external_resource: true) }
|
35
35
|
# return the one with the desired opt lock token
|
36
36
|
cached_resource
|
37
37
|
end
|
@@ -39,25 +39,17 @@ module Valkyrie::Persistence
|
|
39
39
|
attr_reader :query_service, :query_handlers
|
40
40
|
def initialize(query_service:)
|
41
41
|
@query_service = query_service
|
42
|
-
@query_handlers =
|
42
|
+
@query_handlers = {}
|
43
43
|
end
|
44
44
|
|
45
45
|
def register_query_handler(query_handler)
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
def find_query_handler(method)
|
56
|
-
query_handlers.find { |x| x.queries.include?(method) }
|
57
|
-
end
|
58
|
-
|
59
|
-
def respond_to_missing?(meth_name, _args)
|
60
|
-
find_query_handler(meth_name).present?
|
46
|
+
query_handler.queries.each do |query|
|
47
|
+
handler = query_handler.new(query_service: query_service)
|
48
|
+
query_handlers[query.to_sym] = handler
|
49
|
+
define_singleton_method query do |*args, &block|
|
50
|
+
query_handlers[query.to_sym].__send__(query, *args, &block)
|
51
|
+
end
|
52
|
+
end
|
61
53
|
end
|
62
54
|
end
|
63
55
|
end
|
@@ -58,7 +58,7 @@ module Valkyrie::Persistence::Fedora
|
|
58
58
|
# @param [RDF::URI] id the Valkyrie ID
|
59
59
|
# @return [RDF::URI]
|
60
60
|
def id_to_uri(id)
|
61
|
-
prefix =
|
61
|
+
prefix = [5, 6].include?(fedora_version) ? "" : "#{pair_path(id)}/"
|
62
62
|
RDF::URI("#{connection_prefix}/#{prefix}#{CGI.escape(id.to_s)}")
|
63
63
|
end
|
64
64
|
|
@@ -71,6 +71,10 @@ module Valkyrie::Persistence::Fedora
|
|
71
71
|
id.to_s.split(/[-\/]/).first.split("").each_slice(2).map(&:join).join("/")
|
72
72
|
end
|
73
73
|
|
74
|
+
def url_prefix
|
75
|
+
connection.http.url_prefix
|
76
|
+
end
|
77
|
+
|
74
78
|
# Generate the prefix used in HTTP requests to the Fedora RESTful endpoint
|
75
79
|
# @return [String]
|
76
80
|
def connection_prefix
|
@@ -33,12 +33,10 @@ module Valkyrie::Persistence::Fedora
|
|
33
33
|
# empty, tail.prev is the first element.
|
34
34
|
def tail
|
35
35
|
@tail ||=
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
head.next
|
41
|
-
end
|
36
|
+
if tail_subject
|
37
|
+
TailSentinel.new(self, prev_node: build_node(tail_subject))
|
38
|
+
else
|
39
|
+
head.next
|
42
40
|
end
|
43
41
|
end
|
44
42
|
|
@@ -313,7 +313,6 @@ module Valkyrie::Persistence::Fedora
|
|
313
313
|
end
|
314
314
|
|
315
315
|
# Generate a new RDF hash URI for the "child" graph for the ModelConverter::Property
|
316
|
-
# @see https://github.com/fcrepo4/fcrepo4/blob/master/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/JcrRdfTools.java#L455
|
317
316
|
# @return [RDF::Graph]
|
318
317
|
def subject_uri
|
319
318
|
@subject_uri ||= ::RDF::URI(RDF::Node.new.to_s.gsub("_:", "#"))
|