Skip to content

Flexible lay ground work #7126

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

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Flexible lay ground work #7126

wants to merge 20 commits into from

Conversation

orangewolf
Copy link
Member

Summary

Lays the groundwork for Flexible metadata by making including core and basic metadata by default completely optional and toggled by config variables. This version allows configuring the Collection, AdministrativeSet, FileSet and each individual work type independently.

It depreciates two existing functions in a way that if you are using them you won't have to make changes right away.

The first is that Hyrax includes core_metadata in all work types. This can still be done in the future but should be explicit in each work types class and the generators have been updated to support that.

The second is the removal of the auto inclusion of "#{SchemaName}FormFieldsBehavior" when adding schema_name schemas to the form objects. This is difficult to trace as there is no explicit in include so its hard to know where this code comes from when one is debugging. It also doesn't save much in terms of LOC to have it explicit. In current Hyrax this is only used by based near. based_near form attributes have been moved to be generally included but to noop if the object doesn't have a based near field instead.

This is step 1 or arguably step 0 of the flexible metadata work. My plan is to chain additional PRs off this one so that they can be reviewed and merged in order only.

@samvera/hyrax-code-reviewers

@orangewolf orangewolf added the notes-minor Release Notes: Non-breaking features label Jun 13, 2025
@orangewolf orangewolf requested review from marrus-sh and dlpierce June 13, 2025 00:33
Copy link

github-actions bot commented Jun 13, 2025

Test Results

    13 files  ±0      13 suites  ±0   2h 48m 46s ⏱️ + 5m 10s
 6 863 tests ±0   6 557 ✅ ±0  306 💤 ±0  0 ❌ ±0 
18 197 runs  ±0  17 696 ✅ ±0  501 💤 ±0  0 ❌ ±0 

Results for commit e02daec. ± Comparison against base commit b8cdb49.

This pull request removes 360 and adds 360 tests. Note that renamed tests count towards both.
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fb15688af18>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fd558e417d8>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fe78b6bb690>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fb156a15518>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fd5578d03e0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fe78b528850>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: 124bd602-6b54-4b74-8830-766ed8b9ccfb
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: bdc6a557-5a8b-4b4c-bd81-ccd56093d4d7
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: f91923da-a686-4c6e-8d9b-7582619c9c45
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit AdminSet: 70db58d0-e96e-4544-bfc8-da4a5c74dfc8
…
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f28f85a6400>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f37354f7d10>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f3e9286f8d0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f28f85ba798>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f373bc980c8>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f3e92fc1e08>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: 66cbec6f-d541-4783-8307-628b1671a0c7
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 1ed58779-33f6-4a16-831c-e7564d8479ca
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: a68743f3-9dec-4225-bcab-6214179be61e
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit AdminSet: 04c3f718-dd59-4258-9105-42cbe79a2a88
…

♻️ This comment has been updated with latest results.

@dlpierce
Copy link
Member

This is a good start, and I'm on board with the deprecations. 👍

@orangewolf orangewolf force-pushed the flexible-lay_ground_work branch from 4c6a3f4 to 035258f Compare July 24, 2025 22:53
@@ -42,7 +42,7 @@
end
end

describe 'create collection type' do
describe 'create collection type', :clean_repo do
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed a flapping spec that was making me crazy ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notes-minor Release Notes: Non-breaking features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants