Skip to content

[ActiveStorage for All] Enable Active Storage in test apps and install generator#7553

Draft
orangewolf wants to merge 1 commit into
mainfrom
active-storage-for-all/enablement
Draft

[ActiveStorage for All] Enable Active Storage in test apps and install generator#7553
orangewolf wants to merge 1 commit into
mainfrom
active-storage-for-all/enablement

Conversation

@orangewolf

Copy link
Copy Markdown
Member

Summary

First step of the [ActiveStorage for All] chain moving Hyrax's non-ActiveFedora upload/storage paths onto Rails Active Storage (staging uploads now; an Active Storage-backed Valkyrie storage adapter and a modern upload UI follow in stacked PRs).

This PR only enables the plumbing; no Hyrax behavior changes:

  • Adds the canonical Rails create_active_storage_tables migration to the .dassie and .koppie test apps (both already ship config.active_storage.service settings for every environment) and updates their schema.rb.
  • Teaches the hyrax:models generator to run active_storage:install so new host applications get the tables alongside Hyrax's own migrations.
  • Has the hyrax:config generator install a default config/storage.yml (local disk test/local services plus commented S3/GCS/Azure/mirror examples) when the application does not already have one — so generated apps always carry the storage service declarations. .dassie's storage.yml is aligned with that default (.koppie's already matches).
  • Documents Active Storage setup (including the upgrade path for existing apps) in documentation/developing-your-hyrax-based-app.md, and that disk↔S3 is a standard config/storage.yml / config.active_storage.service change.

Why

Upcoming PRs in this chain let Hyrax::UploadedFile staging and (separately) Valkyrie file storage run on Active Storage, so that switching non-AF storage between local disk and S3 is one Rails config change rather than bespoke Hyrax configuration. ActiveFedora file-set storage is explicitly out of scope and unchanged throughout the chain.

Dependencies

None — safe to merge first. PRs that follow are stacked on this one.

Supersedes #7547 (same change, moved from a fork branch to an in-repo branch and retitled per review convention; adds the storage.yml default).

Tests

  • .koppie migration run for real against dockerized Postgres (rails db:create db:migrate, test env) — schema.rb here is that regenerated output.
  • .dassie/db/schema.rb updated with the identical dumper output (same migration, same Postgres); dassie's full stack (Fedora etc.) was not run locally — CI exercises it.
  • git diff --check clean; RuboCop clean on touched Ruby (test-app db/ is outside RuboCop's scan).

🤖 Generated with Claude Code

Adds the canonical Rails create_active_storage_tables migration to the
.dassie and .koppie test applications and regenerates their schemas,
teaches the hyrax:models generator to run active_storage:install so host
applications get the active_storage_* tables alongside Hyrax's own
migrations, and has the hyrax:config generator install a default
config/storage.yml (local disk services plus commented S3/GCS/Azure
examples) when the application does not already have one. The .dassie
sample app's storage.yml is aligned with that default (.koppie's already
matches).

Both test apps already ship config.active_storage.service settings per
environment; this fills in the missing database tables and default
service declarations so upcoming work can stage uploads and store
repository files through Active Storage, where switching local disk vs
S3 is a single Rails storage configuration change.

No behavior change: nothing in Hyrax attaches or reads Active Storage
data yet.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Test Results

    17 files  ±    0      17 suites  ±0   1h 22m 7s ⏱️ - 2h 7m 32s
 6 038 tests  - 1 939   5 960 ✅  - 1 710   78 💤  - 229  0 ❌ ±0 
19 550 runs   - 7 725  19 307 ✅  - 7 369  239 💤  - 360  0 ❌ ±0  4 🔥 +4 

Results for commit 2322d89. ± Comparison against base commit 5cc41d6.

This pull request removes 2219 and adds 280 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:0x00007f37d68cb2d8>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f4a43d1c448>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fdf34ed9d90>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fee6c78aa20>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f37d68c0b58>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f4a4ae00010>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fdf45ad4c48>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fee7038e120>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: 2132c8ed-856c-4771-994f-282c496d9150
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 497eb04a-2b61-4268-a741-91b1fe06e111
…
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f327d4d9b10>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f6df9c1c320>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f9b319cfb48>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f327d22f298>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f6e00defb50>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f9b4005bcd8>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 22fd2cc6-6343-4f54-a99f-38b4f14d1cbb
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 64a88bdf-b980-4b8c-ae6c-4090f908e062
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 7632a453-00d5-49e5-bea0-5138acc0da0d
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit Hyrax::AdministrativeSet: 1e24c42d-ec68-4ed5-8bd6-e8e174dd8e87
…
This pull request skips 21 tests.
spec.controllers.hyrax.dashboard.collections_controller_spec ‑ Hyrax::Dashboard::CollectionsController with model Collection #create creates a Collection with old style parameters
spec.controllers.hyrax.fixity_checks_controller_spec ‑ Hyrax::FixityChecksController when signed in POST create returns json with the result
spec.forms.hyrax.forms.collection_form_spec ‑ Hyrax::Forms::CollectionForm#permission_template when the PermissionTemplate doesn't exist gets created
spec.forms.hyrax.forms.collection_form_spec ‑ Hyrax::Forms::CollectionForm#permission_template when the PermissionTemplate exists uses the existing template
spec.forms.hyrax.forms.collection_form_spec ‑ Hyrax::Forms::CollectionForm#select_files with a work/file attached returns a hash of with file title as key and file id as value
spec.forms.hyrax.forms.resource_form_spec ‑ Hyrax::Forms::ResourceForm#version when using wings prepopulates as empty before save
spec.forms.hyrax.forms.resource_form_spec ‑ Hyrax::Forms::ResourceForm#version when using wings with a saved work prepopulates with the etag
spec.jobs.create_work_job_spec ‑ CreateWorkJob#perform with an ActiveFedora model when the actor does not create the work logs the failure
spec.jobs.create_work_job_spec ‑ CreateWorkJob#perform with an ActiveFedora model when the update is successful logs the success
spec.jobs.migrate_files_to_valkyrie_job_spec ‑ MigrateFilesToValkyrieJob it migrates all derivatives along with a file
…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant