feat: add unified code quality dashboard with multiple validators
- Add validator_type field to scans and violations (architecture, security, performance) - Create security validator with SEC-xxx rules - Create performance validator with PERF-xxx rules - Add base validator class for shared functionality - Add validate_all.py script to run all validators - Update code quality service with validator type filtering - Add validator type tabs to dashboard UI - Add validator type filter to violations list - Update stats response with per-validator breakdown - Add security and performance rules documentation - Add chat-bubble icons to icon library 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
"""add_validator_type_to_code_quality
|
||||
|
||||
Revision ID: f4a5b6c7d8e9
|
||||
Revises: e3f4a5b6c7d8
|
||||
Create Date: 2025-12-21
|
||||
|
||||
This migration adds validator_type column to architecture scans and violations
|
||||
to support multiple validator types (architecture, security, performance).
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "f4a5b6c7d8e9"
|
||||
down_revision: Union[str, None] = "e3f4a5b6c7d8"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# Add validator_type to architecture_scans table
|
||||
op.add_column(
|
||||
"architecture_scans",
|
||||
sa.Column(
|
||||
"validator_type",
|
||||
sa.String(length=20),
|
||||
nullable=False,
|
||||
server_default="architecture",
|
||||
),
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_architecture_scans_validator_type"),
|
||||
"architecture_scans",
|
||||
["validator_type"],
|
||||
unique=False,
|
||||
)
|
||||
|
||||
# Add validator_type to architecture_violations table
|
||||
op.add_column(
|
||||
"architecture_violations",
|
||||
sa.Column(
|
||||
"validator_type",
|
||||
sa.String(length=20),
|
||||
nullable=False,
|
||||
server_default="architecture",
|
||||
),
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_architecture_violations_validator_type"),
|
||||
"architecture_violations",
|
||||
["validator_type"],
|
||||
unique=False,
|
||||
)
|
||||
|
||||
# Add validator_type to architecture_rules table
|
||||
op.add_column(
|
||||
"architecture_rules",
|
||||
sa.Column(
|
||||
"validator_type",
|
||||
sa.String(length=20),
|
||||
nullable=False,
|
||||
server_default="architecture",
|
||||
),
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_architecture_rules_validator_type"),
|
||||
"architecture_rules",
|
||||
["validator_type"],
|
||||
unique=False,
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# Drop indexes first
|
||||
op.drop_index(
|
||||
op.f("ix_architecture_rules_validator_type"),
|
||||
table_name="architecture_rules",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_architecture_violations_validator_type"),
|
||||
table_name="architecture_violations",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_architecture_scans_validator_type"),
|
||||
table_name="architecture_scans",
|
||||
)
|
||||
|
||||
# Drop columns
|
||||
op.drop_column("architecture_rules", "validator_type")
|
||||
op.drop_column("architecture_violations", "validator_type")
|
||||
op.drop_column("architecture_scans", "validator_type")
|
||||
Reference in New Issue
Block a user