The team is splitting search out of checkout, and search needs all of checkout’s rules. A service’s rules are now of several kinds: alert rules, heartbeat rules (a job that has not checked in for a set time pages the channel), and more on the way from other teams. Each copy gets the new service in its ID (checkout/latency becomes search/latency) and a service label.
Copying rules by hand for each new service is how services ship without their alerts. A copy routine that knows each kind breaks the day another team adds one, and a heartbeat copy that keeps the old job’s check-in time looks healthy before its own job has ever run.
Reproduce
Copy checkout/latency and the heartbeat checkout/export to search with copyRules: no copies come back. A heartbeat’s duplicate also keeps the time its source last saw its job check in.
Acceptance criteria
- copyRules returns one copy per rule, in order, each with the new service’s ID (search/latency) and a service label naming it.
- It works for every kind of Rule, including kinds written after it, by other teams (the checker brings one of its own).
- A heartbeat’s copy keeps its interval and labels and has not seen its job yet.
- Everything PROTOTYPE-101 required still holds: the sources are unchanged, the channel is shared, firing stays behind.
Notes
- Cases print the sources, then the copies, each as describe prints it, joined by “ | ”.
- The checker brings a rule kind of its own (a health probe) that implements Rule. Keep Rule, its methods, and copyRules’s name and signature.
- Rule IDs are <service>/<name>; ruleName gives the name.