Skip to content

Scanning a Monorepo

nfr-review scans a single directory tree at a time. For monorepos with multiple services, scan each service independently and merge results as needed.

Point nfr-review at each service’s root directory:

Terminal window
# Scan individual services
nfr-review report ./services/user-service --output-dir ./results/user-service
nfr-review report ./services/order-service --output-dir ./results/order-service
nfr-review report ./services/gateway --output-dir ./results/gateway

Each scan produces its own report with findings, scores, and baselines scoped to that service.

Create an nfr-review.yaml in each service directory for service-specific tuning:

monorepo/
services/
user-service/
nfr-review.yaml # service-specific config
src/
order-service/
nfr-review.yaml
src/

Or use a shared config with per-service overrides:

Terminal window
nfr-review report ./services/user-service \
--config ./shared-nfr-config.yaml

Use a matrix strategy to scan services in parallel:

jobs:
nfr-review:
strategy:
matrix:
service: [user-service, order-service, gateway]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Run NFR Review
uses: JimAKennedy/nfr-review@v1
with:
path: services/${{ matrix.service }}
comment: "true"

For shared infrastructure (Helm charts, Terraform modules, CI pipelines) that lives outside service directories, add a separate scan:

Terminal window
nfr-review report ./infrastructure --output-dir ./results/infra

Extract scores from each service’s JSONL output for a dashboard:

Terminal window
for service in user-service order-service gateway; do
SCORE=$(jq -r 'select(.record_type == "score") | .overall' \
results/$service/*-report.jsonl)
echo "$service: $SCORE"
done