Skip to content

Add ruleClass api for priority override#52

Merged
emilyyuan03 merged 3 commits intomainfrom
rule-class-priority-override
Feb 2, 2026
Merged

Add ruleClass api for priority override#52
emilyyuan03 merged 3 commits intomainfrom
rule-class-priority-override

Conversation

@emilyyuan03
Copy link
Contributor

No description provided.

String ruleClassName = ruleClass.getClass().getCanonicalName();
for (Map.Entry<String, Priority> override : overrides.entrySet()) {
String overrideRuleName = override.getKey();
if (ruleClassName.startsWith(overrideRuleName) || id.equals(overrideRuleName)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if both the rule class and rule name have overrides, we should prefer the rule name override.
I think a test case for this could be added, and this impl will have to change to specify this behavior

consoleDetailsThreshold.set(Priority.valueOf(priority))
}

fun rule(ruleName: String, action: Action<RuleConfig>) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets leave rule in place for backward compatibility. you can mark it as @Deprecated and still create the new ruleName that does the same thing

@emilyyuan03 emilyyuan03 merged commit 85b01a5 into main Feb 2, 2026
3 checks passed
@emilyyuan03 emilyyuan03 deleted the rule-class-priority-override branch February 2, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants