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
-
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 checkchecks every ruleset underrules.dirofrcas.yaml. -
Make the step required. In the repository settings, mark the check as required for the main branch, so a red check blocks the merge.
-
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, itsenforcement(does a secret limit stayserver?), and itsoverridePolicy(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
- Ship a rule change, step "Open the pull request; CI checks and compiles".
- Authoring guidelines: what a reviewer looks for.