Quality Gates & Make Lifecycle
Relevant source files
The following files were used as context for generating this wiki page:
FLEXT Quality provides a unified orchestration platform for code quality workflows and agent-based tooling. It enforces technical standards through canonical make verbs and automated quality gates that integrate various analysis backends like Ruff, MyPy, and Bandit.
Lifecycle Verbs
The project uses a standard set of make commands to manage the development lifecycle. These verbs execute declared operations directly from the workspace root.
| Verb | Action |
|---|---|
gen | Regenerates managed projections and code. |
check | Executes static analysis (Ruff, basedpyright, Bandit). |
test | Runs the test suite and generates coverage reports. |
fmt | Applies automated code formatting. |
docs | Generates system documentation. |
Sources: README.md:63-65, AGENTS.md:37-39, pyproject.toml:5
Quality Gate Architecture
Quality gates function as automated barriers that a code change must pass before promotion. The system integrates multiple analysis backends to validate security, complexity, and structural integrity.
Analysis Flow
The following diagram illustrates how the CodeAnalyzer orchestrates various backends during a quality check.
The analysis engine executes multiple specialized tools and aggregates their findings into a single quality metric.
Sources: examples/README.md:100-110, tests/README.md:57-60, AGENTS.md:28-30
Scoring and Grading Thresholds
The system assigns a numeric score (0-100) and a letter grade based on analysis results.
- A+ Grade: 97–100 points (Exceptional)
- A Grade: 93–96 points (Excellent)
- B+ Grade: 87–92 points (Very Good)
- B Grade: 83–86 points (Good)
- C+ Grade: 77–82 points (Satisfactory)
- F Grade: Below 60 points (Failing)
Sources: examples/basic/simple_analysis/README.md:148-158
CI/CD Integration
Quality gates are enforced within CI/CD pipelines to ensure only compliant code is merged. This involves minimum coverage requirements and mandatory static analysis.
Required CI/CD Proofs
- Test Coverage: A minimum of 90% coverage is required across all source modules.
- Static Analysis: All
make checkoperations must return a success exit code. - Security Triage: Vulnerability detection must pass defined security thresholds.
Sources: tests/README.md:105-108, tests/README.md:267-272, pyproject.toml:267-270
GitHub Actions Workflow Example
# Simplified Quality Gate Workflow
name: Quality Gate
on: [push, pull_request]
jobs:
analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Quality Analysis
run: |
flext-quality analyze . \
--min-score 85.0 \
--max-complexity 10
Sources: examples/README.md:133-156
Validation Models
The system uses Pydantic-2 models to define the schema for quality findings, metrics, and configuration thresholds.
Audit Metrics Schema
The AuditMetrics model tracks documentation and code quality issues found during a run.
| Field | Type | Description |
|---|---|---|
total_issues | int | Total count of issues found. |
quality_score | int | Score from 0 to 100. |
severity_breakdown | MutableMapping[str, int] | Count per severity level. |
issues_per_file | float | Average issues per analyzed file. |
Sources: src/flext_quality/_models/flextqualitymodels_part_01.py:32-60
Threshold Configuration
QualityThresholdsConfig defines the limits for automated flagging.
- max_age_days: Flags stale documentation.
- min_word_count: Minimum content length for documents.
- max_broken_links: Tolerated link failures before an audit fail.
- max_file_size_mb: Size limit for documentation files.
Sources: src/flext_quality/_models/flextqualitymodels_part_01.py:62-95
Code Analysis Summary
FLEXT Quality ensures that every package in the workspace is re-validated at the current version before promotion beyond alpha status. By centralizing tool orchestration through a single facade (FlextQuality), the project maintains a zero-debt baseline and verified registry.
Sources: README.md:20-24, AGENTS.md:10-12