Skip to content

Automation - Integrate gitStream with Rust

Approve Rust Log Output Changes

Approve changes to Rust files that only affect lines of code that invoke the logging marcos.

approve Rust log output

Configuration Description

Conditions (all must be true):

  • All files end in .rs
  • The changes only affect lines of code that invoke print, println or dbg macros or use the log crate macros.

Automation Actions:

  • Apply a log-output-only label
  • Approve the PR
  • Post a comment explaining that the change only affects logging output.

Approve Rust Log Output Changes

# -*- mode: yaml -*-

manifest:
  version: 1.0

automations:
  approve_rust_log_output:
    # Triggered for Rust changes that only affect the logging macros
    if: 
      - {{ files | extensions | match(term='rs') | every }}
      - {{ source.diff.files | matchDiffLines(regex=r/^.*\b(println|print|dbg|error|warn|info|debug|trace)\b!/, ignoreWhiteSpaces=true) | every }}
    run: 
      - action: add-label@v1
        args:
          label: 'log-output-only'
      - action: approve@v1
      - action: add-comment@v1
        args:
          comment: |
            This PR has been approved because it only contains changes to log output

Additional Resources

gitStream is a workflow automation tool that enables you to use YAML configuration files to optimize your code review process. Add context to PRs, find code experts for reviews, and automate the merge process to maximize developer productivity.

Learn More about how gitStream Works.

More Automations can be found on the Automation Library and Integrations pages.