Redirect the replicable details page when replication is disabled
What does this MR do and why?
The Geo replicable details page is served by a generic route, and Admin::Geo::ReplicablesController#set_replicator_class only renders a 404 when no replicator class exists for the name at all. Switching a replicable's replication off does not remove its class, so the URL still resolves, the page still renders, and the GraphQL registries resolver returns nothing for it. The admin is left looking at an empty table with nothing to say why it is empty.
The Geo Sites page stopped linking to these pages when disabled replicables were hidden, so the only ways in now are a bookmark or an old runbook link.
index now checks replication_enabled? on the resolved replicator class and, when it is off, redirects to the Geo Sites page with a notice naming the replicable. The check is generic, so it covers every disabled replicable rather than special casing any one of them.
Two things this deliberately does not do. show is left as it is, because it is not reachable from the sites page either and the same redirect can be added there if it turns out to be. And there is no permanent alias for a removed replicable, because once a replicable is split across partitions there is no single successor page to point at.
References
- Closes #628311 (closed)
- Follows the hide-disabled-replicables behaviour from #591685 (closed)
Differences
Before: visiting the details page for a replicable whose replication is disabled rendered the page normally. The registries resolver returned nothing, so the admin saw an empty table, with no message and nothing to distinguish it from a replicable that simply had no registries yet.
After: the same URL redirects to the Geo Sites page and shows a notice reading "Replication of Uploads is disabled on this site.", with the replicable's own title in place of Uploads. An enabled replicable renders exactly as before, and an unknown replicable name still returns 404.
How to set up and validate locally
The behaviour is covered by request specs, which is the quickest way to see it:
bundle exec rspec ee/spec/requests/admin/geo/replicables_controller_spec.rbThe new contexts are "when replication is disabled for the replicable", which asserts both the redirect and the notice text, and "when the replicable name is unknown", which pins the existing 404 so the new branch cannot swallow it.
To see it by hand on a Geo secondary, disable the ops feature flag for a replicable and open its details page at /admin/geo/sites/:id/replication/:replicable_name_plural. It should bounce to the Geo Sites page with the notice rather than rendering an empty table.