Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIM-1: Trait-based rulesets #29

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

MIM-1: Trait-based rulesets #29

wants to merge 3 commits into from

Conversation

lukecarr
Copy link
Member

@lukecarr lukecarr commented Apr 28, 2024

Currently, we only have one ruleset implemented within Mimir. This ruleset treats rules with more requirements as more "specific" and only evaluates the most specific rule.

This behaviour is desirable for performance because we can sort the ruleset in descending order of specificity and avoid iterating over the entire ruleset (breaking out early if we find a matching rule).

However, there are scenarios in which we might want to willingly evaluate all rules in a ruleset, irrespective of specificity. For example, suppose we use a ruleset to store the behaviour for unlocking achievements. In that case, we want to evaluate and find all achievements that should be unlocked, not just the achievement with the most requirements (this is the behaviour that would currently happen in Mimir).

With this in mind, we should refactor the codebase to replace the concrete implementation of the current ruleset with a trait-based approach to define rulesets.

@lukecarr lukecarr added the enhancement New feature or request label Apr 28, 2024
@lukecarr lukecarr self-assigned this Apr 28, 2024
@lukecarr lukecarr requested a review from a team as a code owner April 28, 2024 20:32
Copy link

linear bot commented Apr 28, 2024

Copy link

cloudflare-workers-and-pages bot commented Apr 29, 2024

Deploying mimir with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3f029d8
Status:🚫  Build failed.

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant