A multi-purpose GitLab webhook service that automates merge request validation, repository maintenance, and workflow optimization.
π― Smart Automation: Validates MRs, maintains repositories, and keeps projects clean
Naysayer provides three core capabilities through webhook endpoints:
- β Auto-approves safe changes (cost reductions, compliant configurations)
β οΈ Flags for review risky changes (cost increases, security violations)- π Validates file content against organizational policies
- π Documents decisions with clear reasoning
- π Automatically rebases Fivetran terraform repository MRs
- β‘ Reduces merge conflicts through proactive rebasing
- π€ Streamlines workflows for infrastructure-as-code
- ποΈ Closes stale MRs (30+ days old)
- π Maintains clean project state across repositories
- π Stateless, pull-based design (repos opt-in via CI)
Naysayer includes built-in rules for:
- π’ Cost Control - Warehouse configuration validation
- π Security - Service account compliance
- π₯ Access Management - Consumer access auto-approval (NEW!)
- βοΈ TOC Approval - TOC oversight for production deployments
- π Documentation - Metadata and docs validation
π Complete Rule Details: See Rules Documentation for what gets validated, troubleshooting, and examples.
Naysayer uses Section-Based Validation Architecture for granular, configurable rule processing:
graph TD
A[π₯ GitLab MR] --> B[π File Analysis]
B --> C{Section-Based Config?}
C -->|Yes| D[π§© YAML Section Parsing]
C -->|No| E[π Traditional Validation]
D --> F[Extract File Sections]
F --> G[Section 1: warehouses]
F --> H[Section 2: service_account]
F --> I[Section N: custom]
G --> J[π’ Apply warehouse_rule]
H --> K[π Apply service_account_rule]
I --> L[π― Apply section rules]
E --> M[Apply all rules to file]
J --> N{All Sections Valid?}
K --> N
L --> N
M --> O{All Rules Pass?}
N -->|β
All sections pass| P[π Auto-Approve MR]
N -->|β Section failures| Q[π Manual Review Required]
O -->|β
All rules pass| P
O -->|β Rule failures| Q
classDef startEnd fill:#e1f5fe,stroke:#01579b,stroke-width:2px,color:#000
classDef process fill:#f3e5f5,stroke:#4a148c,stroke-width:2px,color:#000
classDef decision fill:#fff3e0,stroke:#e65100,stroke-width:2px,color:#000
classDef section fill:#e8f5e8,stroke:#2e7d32,stroke-width:2px,color:#000
classDef rule fill:#fff8e1,stroke:#f57f17,stroke-width:2px,color:#000
classDef success fill:#e8f5e8,stroke:#388e3c,stroke-width:3px,color:#000
classDef review fill:#ffebee,stroke:#d32f2f,stroke-width:2px,color:#000
class A,P startEnd
class B,D,E,F,M process
class C,N,O decision
class G,H,I section
class J,K,L rule
class P success
class Q review
π Section-Based Features:
- π― Granular Control: Rules target specific YAML sections (e.g.,
warehouses,service_account.dbt) - π§© Configurable Mapping: Rules and sections defined in
rules.yamlconfiguration - π Coverage Tracking: Ensures all sections are validated by appropriate rules
- π§ Modular Validation: Different rules can validate different sections of the same file
- π Enhanced Reporting: Section-by-section validation results with line-level detail
# Deploy to Kubernetes/OpenShift
kubectl apply -f config/
# Or run locally for development
export GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx
make build && make run- Go to GitLab project β Settings β Webhooks
- Add URL:
https://your-naysayer-domain.com/webhook - Select "Merge request events"
- Save configuration
Create an MR with configuration changes and Naysayer will automatically validate and provide feedback.
Result: Safe changes get auto-approved, risky changes get flagged for review
Basic configuration via environment variables:
# Required
GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx
# Optional
GITLAB_BASE_URL=https://gitlab.com
PORT=3000
# Rule toggles
WAREHOUSE_RULE_ENABLED=trueπ Complete Configuration: See Development Setup Guide for all rule-specific settings.
| Change Type | Risk Level | Auto-Approval | Business Rationale |
|---|---|---|---|
| Documentation | π’ Low | β Always | Zero operational risk |
| Warehouse Reduction | π’ Low | β Yes | Cost savings (~$50k/month) |
| Service Account (Astro) | π‘ Medium | β Conditional | Automated accounts with naming compliance |
| Warehouse Increase | π‘ Medium | β Never | Requires budget approval |
| Service Account (Other) | π΄ High | β Never | Security review required |
| New Product (Prod) | π΄ High | β Never | Requires TOC governance approval |
- Cost Increases - Warehouse size increases require budget approval
- New Production Deployments - New product.yaml files in preprod/prod require TOC approval
- Security Violations - Hardcoded secrets, invalid domains
- Configuration Errors - YAML syntax errors, missing fields
- Uncovered Changes - Lines not validated by any rule
π Compliance Details: For complete audit trails, risk matrices, and compliance procedures, see detailed rule documentation.
- π Section-Based Architecture - Complete architecture overview with Mermaid diagrams
- π‘ API Reference - Updated endpoints and configuration
- π Rules Overview - Understand what gets validated
- π§ Troubleshooting Guide - Fix common issues
- βοΈ Configuration Guide - Environment setup
- π― Rule Creation Guide - Build new validation rules
- π§ͺ E2E Testing Guide - End-to-end testing framework
- π§ Development Setup Guide - Testing strategies and development setup
- π³ Deployment Guide - Production setup
- π Troubleshooting Guide - Health checks and debugging
Quick setup for developers:
# Clone and setup
git clone https://github.com/your-org/naysayer.git
cd naysayer && make install
# Run tests
make test
# Start development server
export GITLAB_TOKEN=your-token
make runFor complete development setup, testing guides, and project structure details, see the Development Guide.
- Minimal Permissions: GitLab token only needs
read_repositoryscope - Audit Trail: All decisions logged with detailed reasoning
- Input Validation: All webhook payloads validated
- Policy Enforcement: Consistent application of organizational standards
- β‘ Faster Reviews: Safe changes approved automatically
- π‘οΈ Risk Reduction: Automated detection of policy violations
- π Consistency: Uniform application of organizational standards
- π Transparency: Clear explanations for all decisions
Naysayer deployment configs are maintained in this repository (/config/).
# Deploy from this repository
kubectl apply -f config/For complete setup: See Deployment Guide
Health Check: GET /health
- Read Rule Creation Guide
- Follow development guidelines and patterns
- Update documentation in
docs/rules/
π Ready to get started?
- Users: Check Rules Documentation to understand what Naysayer validates
- Developers: See Rule Creation Guide to build custom rules
- Operators: Follow Deployment Guide for production setup