Skip to content

ActiveRecord registry store #818

Description

@bolshakov

Background

So the admin dashboard can show which lights exist, every registration is recorded in a registry keyed by system. The registry stores each light's name (and a small payload) and is written when the light is defined. The Redis store keeps this as a hash; the Memory store's registry is a no-op, which is why the admin dashboard requires a persistent data store. This ticket adds the ActiveRecord registry so the dashboard works on a SQL backend.

This store implements the domain registry port (names, register, unregister); the Redis registry is the reference to mirror. The epic describes the schema.

Goal

Implement the ActiveRecord registry store conforming to the domain registry port, storing the raw light name so the dashboard can enumerate lights.

What to do

  • Add the stoplight_lights migration (raw name, payload, registered-at, unique per system and name, per the epic schema).
  • Implement names (select), register (upsert), and unregister (delete).
  • Match the registry payload format currently on the default branch.
  • Add the store to the benchmark harness (the register path in particular).

Acceptance criteria

  • A spec shows register / names / unregister round-tripping per system on SQLite and Postgres, and two systems' registries not seeing each other's lights.
  • The stored payload matches the current registry format — the shared examples the existing registry runs pass against the ActiveRecord registry.
  • The registry store appears in the benchmark harness; Redis / ActiveRecord numbers are recorded in the PR description.
  • bundle exec steep check and bundle exec standardrb pass.

References

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions