MCPcopy
hub / github.com/github/awesome-copilot / check_integration_sidecar

Function check_integration_sidecar

skills/quality-playbook/quality_gate.py:1109–1190  ·  view source on GitHub ↗

Integration sidecar JSON section.

(q, strictness)

Source from the content-addressed store, hash-verified

1107
1108
1109def check_integration_sidecar(q, strictness):
1110 """Integration sidecar JSON section."""
1111 print("[Integration Sidecar JSON]")
1112 ij = _resolve_artifact_path(q, "results/integration-results.json")
1113
1114 if not ij.is_file():
1115 if strictness == "benchmark":
1116 warn("integration-results.json not present")
1117 else:
1118 info("integration-results.json not present (optional in general mode)")
1119 return
1120
1121 data = load_json(ij)
1122
1123 for key in ["schema_version", "skill_version", "date", "project",
1124 "recommendation", "groups", "summary", "uc_coverage"]:
1125 if has_key(data, key):
1126 pass_(f"has '{key}'")
1127 else:
1128 fail(f"missing key '{key}'")
1129
1130 summary = data.get("summary") if isinstance(data, dict) else None
1131 if not isinstance(summary, dict):
1132 summary = {}
1133 for iskey in ["total_groups", "passed", "failed", "skipped"]:
1134 if iskey in summary:
1135 pass_(f"integration summary has '{iskey}'")
1136 else:
1137 fail(f"integration summary missing required sub-key '{iskey}'")
1138
1139 isv = get_str(data, "schema_version")
1140 if isv == "1.1":
1141 pass_("integration schema_version is '1.1'")
1142 else:
1143 fail(f"integration schema_version is '{isv or 'missing'}', expected '1.1'")
1144
1145 int_date = get_str(data, "date")
1146 if int_date: # match bash: if [ -n "$int_date" ]
1147 status = validate_iso_date(int_date)
1148 if status == "bad_format":
1149 fail(f"integration-results.json date '{int_date}' is not ISO 8601 (YYYY-MM-DD)")
1150 elif status == "placeholder":
1151 fail(f"integration-results.json date is placeholder '{int_date}'")
1152 elif status == "future":
1153 fail(f"integration-results.json date '{int_date}' is in the future")
1154 else:
1155 pass_(f"integration-results.json date '{int_date}' is valid")
1156
1157 rec = get_str(data, "recommendation")
1158 if rec in ("SHIP", "FIX BEFORE MERGE", "BLOCK"):
1159 pass_(f"recommendation '{rec}' is canonical")
1160 elif rec:
1161 fail(f"recommendation '{rec}' is non-canonical (must be SHIP/FIX BEFORE MERGE/BLOCK)")
1162 else:
1163 fail("recommendation missing")
1164
1165 # groups[].result enum
1166 allowed_results = {"pass", "fail", "skipped", "error"}

Callers 1

check_repoFunction · 0.85

Calls 9

_resolve_artifact_pathFunction · 0.85
load_jsonFunction · 0.85
has_keyFunction · 0.85
pass_Function · 0.85
failFunction · 0.85
get_strFunction · 0.85
validate_iso_dateFunction · 0.85
warnFunction · 0.70
infoFunction · 0.70

Tested by

no test coverage detected