Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyrax::CollectionType uses a custom GlobalId scheme #4696

Open
no-reply opened this issue Dec 31, 2020 · 1 comment
Open

Hyrax::CollectionType uses a custom GlobalId scheme #4696

no-reply opened this issue Dec 31, 2020 · 1 comment

Comments

@no-reply
Copy link
Contributor

Descriptive summary

CollectionType#gid has custom behavior that conflicts with GlobalID's typical supported interface. We should bring it in line.

ctype =  Hyrax::CollectionType.create(title: 'my type')

# the usual interface
ctype.to_global_id # => #<GlobalID:0x00005597abc31098 @uri=#<URI::GID gid://dassie/Hyrax::CollectionType/2>>
GlobalID::Locator.locate ctype.to_global_id # =>  #<Hyrax::CollectionType:0x...
GlobalID::Locator.locate ctype.to_global_id.to_s # =>  #<Hyrax::CollectionType:0x...

# Hyrax::CollectionType (as used by collection, etc...
ctype.gid # =>  ctype.gid=> "gid://dassie/hyrax-collectiontype/2"
GlobalID::Locator.locate ctype.gid #NameError: wrong constant name hyrax-collectiontype
Hyrax::CollectionType.find_by_gid(ctype.gid) # => #<Hyrax::CollectionType:0x...
Hyrax::CollectionType.find_by_gid('gid://dassie/just-making-some-stuff-up/2') # => #<Hyrax::CollectionType:0x0

we should realign so all users of #gid and .find_by_gid get correct global id syntax.

no-reply pushed a commit that referenced this issue Jan 5, 2021
this begins to address #4696 by allowing `CollectionType#find_by_gid` to find
"real" GlobalID objects and matching strings.

to move away from the old custom format, we'll need to provide a data
migration/rake task that can fix existing references.
no-reply pushed a commit that referenced this issue Jan 5, 2021
this begins to address #4696 by allowing `CollectionType#find_by_gid` to find
"real" GlobalID objects and matching strings.

to move away from the old custom format, we'll need to provide a data
migration/rake task that can fix existing references.
no-reply pushed a commit that referenced this issue Jan 5, 2021
this begins to address #4696 by allowing `CollectionType#find_by_gid` to find
"real" GlobalID objects and matching strings.

to move away from the old custom format, we'll need to provide a data
migration/rake task that can fix existing references.
no-reply pushed a commit that referenced this issue Jan 6, 2021
as part of #4696: since we're deprecating our older semi-custom global id
syntax, we need to be able to support applications updating their collections.

the rake task `hyrax:collections:update_collection_type_global_ids` provides a
way to do this, and is a non-destructive if collections all use the standard
syntax.

note that this task may create substantial load, even if all collections are
already up to date; so it shouldn't be run repeatedly.
no-reply pushed a commit that referenced this issue Jan 6, 2021
this begins to address #4696 by allowing `CollectionType#find_by_gid` to find
"real" GlobalID objects and matching strings.

to move away from the old custom format, we'll need to provide a data
migration/rake task that can fix existing references.
no-reply pushed a commit that referenced this issue Jan 6, 2021
as part of #4696: since we're deprecating our older semi-custom global id
syntax, we need to be able to support applications updating their collections.

the rake task `hyrax:collections:update_collection_type_global_ids` provides a
way to do this, and is a non-destructive if collections all use the standard
syntax.

note that this task may create substantial load, even if all collections are
already up to date; so it shouldn't be run repeatedly.
no-reply pushed a commit that referenced this issue Jan 6, 2021
this begins to address #4696 by allowing `CollectionType#find_by_gid` to find
"real" GlobalID objects and matching strings.

to move away from the old custom format, we'll need to provide a data
migration/rake task that can fix existing references.
no-reply pushed a commit that referenced this issue Jan 6, 2021
as part of #4696: since we're deprecating our older semi-custom global id
syntax, we need to be able to support applications updating their collections.

the rake task `hyrax:collections:update_collection_type_global_ids` provides a
way to do this, and is a non-destructive if collections all use the standard
syntax.

note that this task may create substantial load, even if all collections are
already up to date; so it shouldn't be run repeatedly.
no-reply pushed a commit that referenced this issue Jan 6, 2021
this begins to address #4696 by allowing `CollectionType#find_by_gid` to find
"real" GlobalID objects and matching strings.

to move away from the old custom format, we'll need to provide a data
migration/rake task that can fix existing references.
no-reply pushed a commit that referenced this issue Jan 6, 2021
as part of #4696: since we're deprecating our older semi-custom global id
syntax, we need to be able to support applications updating their collections.

the rake task `hyrax:collections:update_collection_type_global_ids` provides a
way to do this, and is a non-destructive if collections all use the standard
syntax.

note that this task may create substantial load, even if all collections are
already up to date; so it shouldn't be run repeatedly.
no-reply pushed a commit that referenced this issue Jan 6, 2021
this begins to address #4696 by allowing `CollectionType#find_by_gid` to find
"real" GlobalID objects and matching strings.

to move away from the old custom format, we'll need to provide a data
migration/rake task that can fix existing references.
@no-reply no-reply added this to the 3.x series milestone Jan 7, 2021
no-reply pushed a commit that referenced this issue Jan 11, 2021
as part of #4696: since we're deprecating our older semi-custom global id
syntax, we need to be able to support applications updating their collections.

the rake task `hyrax:collections:update_collection_type_global_ids` provides a
way to do this, and is a non-destructive if collections all use the standard
syntax.

note that this task may create substantial load, even if all collections are
already up to date; so it shouldn't be run repeatedly.
no-reply pushed a commit that referenced this issue Jan 11, 2021
this begins to address #4696 by allowing `CollectionType#find_by_gid` to find
"real" GlobalID objects and matching strings.

to move away from the old custom format, we'll need to provide a data
migration/rake task that can fix existing references.
@no-reply
Copy link
Contributor Author

the next step on this is to provide a data migration task to update existing references, then code to handle the custom format can be removed in the next major release.

no-reply pushed a commit to samvera/bulkrax that referenced this issue Oct 4, 2023
the old `#gid` method was weird and breaking for users expecting things to work
with `GlobalID` tools: samvera/hyrax#4696

Hyrax has provided a mechanism for updating "gid" references since the 3.0 line,
and will drop `#gid` in 5.0.0. use `#to_global_id` to get global ids instead.
no-reply pushed a commit to samvera/bulkrax that referenced this issue Oct 4, 2023
the old `#gid` method was weird and breaking for users expecting things to work
with `GlobalID` tools: samvera/hyrax#4696

Hyrax has provided a mechanism for updating "gid" references since the 3.0 line,
and will drop `#gid` in 5.0.0. use `#to_global_id` to get global ids instead.
dunn pushed a commit to samvera/bulkrax that referenced this issue Oct 12, 2023
the old `#gid` method was weird and breaking for users expecting things to work
with `GlobalID` tools: samvera/hyrax#4696

Hyrax has provided a mechanism for updating "gid" references since the 3.0 line,
and will drop `#gid` in 5.0.0. use `#to_global_id` to get global ids instead.
jeremyf pushed a commit to samvera/bulkrax that referenced this issue Oct 17, 2023
the old `#gid` method was weird and breaking for users expecting things to work
with `GlobalID` tools: samvera/hyrax#4696

Hyrax has provided a mechanism for updating "gid" references since the 3.0 line,
and will drop `#gid` in 5.0.0. use `#to_global_id` to get global ids instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant