Label critical changes with code queries

The codeQuery built-in allows you to query the code contained in the diff to understand if, for example, particular function calls were changed or sensitive data (such as passwords or access tokens) are being explicitly added to the code.

apiVersion: reviewpad.com/v0.0.4

labels:
  critical:
    description: critical code

rules:
  callsQuicksort:
    kind: patch
    description: Patch contains the keyword quicksort
    spec: $codeQuery("quicksort")

protectionGates:
  - name: critical
    description: Modifications of critical code require careful review
    patchRules:
      - rule: callsQuicksort
    actions:
      - $addLabel("critical")

Did this page help you?