Mentions
Triagebot can leave a comment on PRs that touch certain files. This can be useful to alert people who want to review any change to those files, or to provide a informational message to the author.
Usage
Mentions are triggered automatically when a PR is opened (or new changes are pushed) based on the configuration in triagebot.toml of the repo.
Configuration
To enable mentions, add entries to the [mentions] table in triagebot.toml.
Each key in the table should either be a path in the repo or should be a string (when type="content"). See the dedicated section below for more details.
There are four optional values that can be specified in the table:
type--- Specifies the matching type that must be satisfied, eitherfilename(the default) orcontent.trigger_files--- Fortype = "content"mentions, restrict the content matching to only the specified array of file globs.cc--- A list of strings of users to ping. They should start with@like@ehussor@rust-lang/clippy. If this is not specified, nobody will be pinged.message--- This is the message that will be included in the comment. If this is not specified, the comment will saySome changes occurred in {path}.
Path-based mentions
By default triagebot checks for any file that starts with1 the given UNIX-style path. Can be explicitly requested with type="filename".
Glob matching is supported with the following syntax:
?matches any single character.*matches zero or more characters.**recursively matches directories.{a,b}matchesaorbwhereaandbare arbitrary glob patterns.[ab]matchesaorbwhereaandbare characters.[!ab]to match any character except foraandb.
For example, library/std (or library/std*) would match anything under the library/std directory like library/std/src/process.rs.
Content-based mentions
Optionally triagebot can check any added lines of a PR with type="content".
In those cases the key is the content to be found.
Example
[mentions."src/tools/cargo"]
cc = ["@ehuss"]
[mentions."src/rustdoc-json-types"]
message = """
rustdoc-json-types is a **public** (although nightly-only) API.
If possible, consider changing `src/librustdoc/json/conversions.rs`;
otherwise, make sure you bump the `FORMAT_VERSION` constant.
"""
[mentions."#[rustc_attr]"]
type = "content"
cc = ["@someone"]
[mentions."miri"]
type = "content"
trigger_files = ["library"]
message = """
Any special-casing of Miri in the standard library requires review.
"""
cc = ["@rust-lang/miri"]
Implementation
-
In order to achieve the starts with an implicit glob
*is added an the end of path. ↩