Change Rules definition/management
A better way of managing the relation between Channels, Releases and Rules would probably be to:
- make Channels and Releases independent (a release can be valid and declared in multiple channels)
- declare Rules as a "matching" function that is applied in a channel.
Each Rule should be composed of:
- a parent Channel
- a priority (int)
- a set of criteria, each being linked to a request parameter (ex: OSversion >= XX, etc).
- a target, which should be linked to a "Release selection".
A channel is basically a named set of Rules, ordered by the channels priorities.
Notes:
- Criteria should probably not be hardcoded in Rules, as the parameters sent in the request can evolve (modification, addition, etc.). A one-to-many/many-to-many relation with a "Criterium" object seems more appropriate
- Release selection can be either:
- a direct selection: "Use Release X"
- a more complex algorithm: "Do some A/B testing with Release X and Y for 10%".