Rules
Simscope Rules are automatic assignments to be performed on matching jobs within a Signature.
Think of them like "email rules in your inbox", where instead of matching incoming emails, Rules match simulation fails, within Signatures.
Standard Rule Workflow
The standard Rule Workflow is a three-step process:
- Create a Signature Rule and assign to a user.
- Mark a bug on the Rule, and move to OPEN state.
- Resolve the Bug (either as Fixed or Wontfix).
NOTE: steps 1 or 2 can be bypassed, if a Bug is already open, or if a Fix has already been committed.
Rule Fields
Rules are composed of:
- Trigger — what causes the rule to activate
- Action — what happens once a rule matches
Rule Trigger
The Rule Trigger is what causes a rule to activate.
Field | Example | Description |
---|---|---|
Signature | 1249 | Signature to match |
Branch | master | Branch to match |
Query | component=fpu, message=~TOP | Query to match |
NOTE: the Query field must contain at least 1 component.
Rule Action
The Rule Action is what happens to each Signature job which matches the trigger:
Field | Example | Description |
---|---|---|
Assignee | bob.jeffries | Signature assignee |
State | OPEN | Signature state |
Issue | SIM-99 | Issue ID (Bug or Tag) |
Fix ID | 15949 (checkin #) | (only for FIXED rules) |
Example Rule Scenario
For example, you can create a rule to automatically mark all Signature 12
jobs:
- on branch
default
- on any component
To:
Open
stateBug 143
- assigned to
Fred Wilson
With this rule, all future regressions containing fails matching Signature 12
will get updated
to Open, Bug 143, Fred Wilson.
How do Rules link to Signatures?
Each Signature can have 1 or more Rules.
- However, each Rule only works on 1 Signature.
For example: Signature 112 may have 3 Rules, but each of these rules only operates on Signature 112.
How to match multiple components in a single Rule?
Use the =~
operator to match Regular Expressions in the job search.
To match all components containing foo_
:
component=~foo_
To match multiple components, use the |
(pipe) operator.
- This example matches two components:
component=~alpha_one|alpha_two
To match all components within a project, prefix the project name with the @
operator.
- This example matches all components under project
ZETA
:
component=~@ZETA
How do I create a Rule?
Rules can be created either from the Signature Search page, or from the Signature Details page.
Rule Naming
Simscope automatically names Rules as the format SIGNATURE.RULENUM
. For example, the first
rule in Signature 19 will be Rule #19.1
. The second will be Rule #19.2
. And so on.
Rule Matching
It is possible for multiple rules within a signature to be possible candidates to match an incoming job (ie rules can be ambiguous).
Simscope only executes the first matching rule for a job, checking in Priority order. All other potential matching rules will be ignored.
See the Priority section for more info.
Rule Best Practices
#1. Don't add single-regression filters to rules.
This will make them only match a single regression. Future regressions will not match the rule.
Here is an example Bad Rule, which only matches a single regression:
regr=myregr/12
Here is a Good Rule (match all myregr
regressions):
regr=~myregr