Rule Cascade
LearnThe process, end to end

Review in a pull request and CI gates

Every rule change goes through a pull request. CI runs the same check you ran, and the reviewer reads the tests first.

A rule change is a code change. It goes through a pull request, a reviewer, and CI. CI runs the same rcas check you ran, on every ruleset, so a change that breaks a load check or a golden test cannot merge.

Hands-on

  1. Add a CI step that checks every ruleset.

    CI step: check every ruleset
    - name: Check every ruleset
      run: |
        npm install -g @rules-cascade/cli
        rcas check rules/

    Install the command any way Install lists, then name your own ruleset files or folders; without arguments, rcas check checks every ruleset under rules.dir of rcas.yaml.

  2. Make the step required. In the repository settings, mark the check as required for the main branch, so a red check blocks the merge.

  3. Review the change in this order:

    • the golden tests: do they say what the business asked for?
    • metadata.version: raised, with a minor version for a new rule and a major version for a change that denies what was allowed before;
    • the rule itself: its severity, its enforcement (does a secret limit stay server?), and its overridePolicy (may a child loosen it?).

Done when

  • The pull request shows the check step, and it is green.
  • A pull request with a failing golden test cannot be merged.
  • The reviewer approved the tests and the version, not only the rule.

Go deeper

Course overview

On this page