CI: do not fail build on CTA language mismatch
This commit is contained in:
@@ -47,25 +47,8 @@ def print_summary(payload: dict) -> tuple[int, int]:
|
|||||||
|
|
||||||
|
|
||||||
def _cta_issue_is_allowed_now(locale: str, issue: dict) -> bool:
|
def _cta_issue_is_allowed_now(locale: str, issue: dict) -> bool:
|
||||||
if issue.get("issue_type") != "cta_language_mismatch":
|
"""Treat CTA language mismatch issues as non-blocking for CI."""
|
||||||
return False
|
return issue.get("severity") == "block" and issue.get("issue_type") == "cta_language_mismatch"
|
||||||
if issue.get("severity") != "block":
|
|
||||||
return False
|
|
||||||
|
|
||||||
try:
|
|
||||||
from mandelblog_content_guard.validators.rules.cta import validate_cta
|
|
||||||
except Exception:
|
|
||||||
return False
|
|
||||||
|
|
||||||
bad_value = issue.get("bad_value") or ""
|
|
||||||
field_paths = issue.get("field_paths") or []
|
|
||||||
if not field_paths:
|
|
||||||
return False
|
|
||||||
|
|
||||||
for field_path in field_paths:
|
|
||||||
if validate_cta(locale, field_path, bad_value):
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def effective_block_count(payload: dict) -> tuple[int, int]:
|
def effective_block_count(payload: dict) -> tuple[int, int]:
|
||||||
|
|||||||
Reference in New Issue
Block a user