docs/config-rulebase-common: fix code block markdown Also add language specifications to code blocks to enable syntax highlighting. Change-Id: I36c2e35153cab51b701e0cb4d895920f8c059f45
diff --git a/src/main/resources/Documentation/config-rulebase-common.md b/src/main/resources/Documentation/config-rulebase-common.md index 3c52cfe..303aed6 100644 --- a/src/main/resources/Documentation/config-rulebase-common.md +++ b/src/main/resources/Documentation/config-rulebase-common.md
@@ -3,6 +3,7 @@ [TOC]: # "Table of Contents" ### Table of Contents + - [Overview](#overview) - [Rule Bases Scope](#rule-bases-scope) - [Rules](#rules) @@ -10,7 +11,6 @@ - [Event Properties](#event-properties) - [Actions](#actions) - ## Overview In this part we describe how to specify which events in Gerrit (E.g.: @@ -26,7 +26,7 @@ A simple rule bases file may look like -``` +```ini [rule "rule1"] event-type = change-merged action = add-standard-comment @@ -103,6 +103,7 @@ is true either if they are defined in generic or project specific scope. [rules-inheritance]: #rules-inheritance + ### <a name="rules-inheritance">Rules inheritance</a> For project specific rules, i.e., those defined on the `refs/meta/config` @@ -152,7 +153,7 @@ The conditions are lines of the form -``` +```ini name = value1, value2, ..., valueN ``` @@ -162,7 +163,7 @@ having `subject`, or `footer-Bug`, the following condition can be used: -``` +```ini association = subject,footer-Bug ``` @@ -171,7 +172,7 @@ example to match events that do not come with a `status` property having `DRAFT`, the following condition can be used: -``` +```ini status = !,DRAFT ``` @@ -209,7 +210,7 @@ For example - ``` +```ini [rule "someRuleForBugzillaOnly"] its-name = its-bugzilla approvalCodeReview = -2 @@ -218,7 +219,7 @@ its-name = its-jira approvalCodeReview = -2 action = add-comment Dear JIRA users, the change had a -2 Code-Review approval. - ``` +``` would report the “Heya Bugzilla...” text only through its-bugzilla for changes that had a -2 Code-Review and have an association through @@ -585,7 +586,7 @@ Lines of the form -``` +```ini action = name param1 param2 ... paramN ``` @@ -620,7 +621,7 @@ So for example -``` +```ini action = add-comment This is a sample command ``` @@ -646,7 +647,7 @@ So for example -``` +```ini action = add-soy-comment TemplateName ``` @@ -655,7 +656,6 @@ example for what the soy template will look like (note @param is required with correct variables.) - ``` {namespace etc.its.templates} {template .TemplateName kind="text"} @@ -679,7 +679,7 @@ Example with the event property `branch` and a field identified as `labels`: -``` +```ini action = add-property-to-field branch labels ``` @@ -693,7 +693,7 @@ Example with the event property `ref`: -``` +```ini action = create-version-from-property ref ``` @@ -705,6 +705,7 @@ This is useful when you want to trigger rules on a multiple past commits. Available collectors are: + - `since-last-tag`: Collects all commits between the current ref and previous tag To avoid to trigger issue actions twice for the same event, you should condition your rule on @@ -712,11 +713,10 @@ Example: -``` +```ini action = fire-event-on-commits since-last-tag ``` - ### Action: log-event The `log-event` action appends the event's properties to Gerrit's log. @@ -725,7 +725,7 @@ adding the desired log level as parameter. Supported values are `error`, `warn`, `info`, and `debug`). So for example -``` +```ini action = log-event error ```