Replace manual upsert logic with SQLite native upsert in Docker CRUD repositories, enhance Ansible backup playbook with better error handling and file permissions, add favicon endpoint, and improve playbook editor UI with syntax highlighting, lint integration, quality badges, and enhanced code editing features
Tests / Backend Tests (Python) (3.10) (push) Has been cancelled
Tests / Backend Tests (Python) (3.11) (push) Has been cancelled
Tests / Backend Tests (Python) (3.12) (push) Has been cancelled
Tests / Frontend Tests (JS) (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / All Tests Passed (push) Has been cancelled
Tests / Backend Tests (Python) (3.10) (push) Has been cancelled
Tests / Backend Tests (Python) (3.11) (push) Has been cancelled
Tests / Backend Tests (Python) (3.12) (push) Has been cancelled
Tests / Frontend Tests (JS) (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / All Tests Passed (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
"""
|
||||
Schémas Pydantic pour l'API ansible-lint.
|
||||
"""
|
||||
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class LintRequest(BaseModel):
|
||||
"""Requête de lint pour un playbook."""
|
||||
content: str = Field(..., description="Contenu YAML du playbook")
|
||||
rules: Optional[list[str]] = Field(None, description="Règles à activer (toutes par défaut)")
|
||||
skip_rules: Optional[list[str]] = Field(None, description="Règles à ignorer")
|
||||
|
||||
|
||||
class LintIssue(BaseModel):
|
||||
"""Un problème détecté par ansible-lint."""
|
||||
rule_id: str = Field(..., description="Identifiant de la règle")
|
||||
severity: str = Field(..., description="Sévérité: error, warning, info")
|
||||
message: str = Field(..., description="Message descriptif")
|
||||
line: int = Field(..., description="Numéro de ligne (1-indexed)")
|
||||
column: int = Field(1, description="Numéro de colonne (1-indexed)")
|
||||
context: Optional[str] = Field(None, description="Extrait de code concerné")
|
||||
help_url: Optional[str] = Field(None, description="URL de documentation")
|
||||
fix_suggestion: Optional[str] = Field(None, description="Suggestion de correction")
|
||||
|
||||
|
||||
class LintSummary(BaseModel):
|
||||
"""Résumé des résultats de lint."""
|
||||
total: int = Field(..., description="Nombre total de problèmes")
|
||||
errors: int = Field(..., description="Nombre d'erreurs")
|
||||
warnings: int = Field(..., description="Nombre d'avertissements")
|
||||
info: int = Field(..., description="Nombre d'infos")
|
||||
|
||||
|
||||
class LintResponse(BaseModel):
|
||||
"""Réponse de l'API ansible-lint."""
|
||||
success: bool = Field(..., description="True si le lint a été exécuté")
|
||||
execution_time_ms: int = Field(..., description="Temps d'exécution en ms")
|
||||
summary: LintSummary = Field(..., description="Résumé des problèmes")
|
||||
quality_score: int = Field(..., description="Score de qualité 0-100")
|
||||
issues: list[LintIssue] = Field(default_factory=list, description="Liste des problèmes")
|
||||
|
||||
|
||||
class LintHistoryEntry(BaseModel):
|
||||
"""Entrée historique de lint pour un playbook."""
|
||||
timestamp: str = Field(..., description="Date/heure ISO")
|
||||
quality_score: int = Field(..., description="Score de qualité")
|
||||
errors: int = Field(..., description="Nombre d'erreurs")
|
||||
warnings: int = Field(..., description="Nombre d'avertissements")
|
||||
info: int = Field(..., description="Nombre d'infos")
|
||||
Reference in New Issue
Block a user