Knowledge Base Administration Guide

Rule Templates

Rule Templates are global Regular Expressions, which expand into Rules, when new (untriaged) signatures are encountered by Simscope.

  • During Regression imports, if a Job is imported but no existing rules match it, then a Rule Template can automatically Create a New Rule.
  • Rule templates can match across any Signature and any branch.

This is an advanced use case, where you want to automatically assign new errors to a user, based on the incoming Job's:

  • Signature pattern (Regular Expression)
  • Component
  • Branch pattern (Regular Expression)
  • Optionally: any other job field

Example Rule Template

For example, you might want to automatically assign a group of new errors to Nancy:

  • Component alpha_cpu_core
  • Branch main|dev (regular expression: main or dev branch)
  • Job contains testgroup =~ daily
  • Signature Title contains overflow

→ A Rule Template can do this.


Adding a Rule Template

Note: adding/editing Rule Templates requires Manager or higher user privileges.

To add a Rule Template:

  1. In the top blue bar, Click Rules.
  2. Click Rule Templates.
  3. Click the Add Rule Template button.

Add rule template

Then set the rule fields:

  • Signature pattern (use .* to match any signature).
  • Job pattern (e.g. component=abc or regex: component=~abc|xyz).
  • Branch pattern (either a raw string or a Regular Expression).
  • Assignee.

Add rule template


Example: Rule Template assignment

This example shows a Rule Template (0.4) expanding into 3 child Rules (based on 3 Signatures):

Rule Template 0.4
├── Rule 1248.1
├── Rule 903.1
└── Rule 751.2

Rule Template assignment email

When a Rule template matches a new Signature, it will send the assignee an email notification.

Here is an example email notification, for user pdq on Signature 19:

Rule template email


Rule Template Fields

Note: Rule Template fields are a super-set of Rule fields.

FieldOptionalExample
Signature Patterncorelogic
Job Search Patterncomponent =~ alphaǀbeta
Branchmain
StateOPEN
AssigneeJill
IssueCHIP-99

Rule Template Activation

Afterward, if a regression runs on the alpha_cpu_core component, and a new Pipeline mismatch error with testgroup daily2 is posted to Simscope, then it will automatically:

  1. Create a Signature Rule (based on the above matching template).
  2. Assign to user Jill.
  3. And send a notification email to Jill.

Rule Template Restrictions

  1. Rule Templates do not match on existing jobs. They only match on future jobs imported to Simscope.
  2. If an active Rule matches the incoming job, Rule templates will be ignored (skipped).
  3. Rule Templates cannot be marked as FIXED.
    • Since template rules act on brand new Signatures, marking them as FIXED is specifically defeating triage.
    • However, you can mark a template rule as WONTFIX
    • Also, after the template rule creates a child rule, you can mark the child rule as FIXED with a Fix ID.