Integrate real reviewer with measured Actions execution and live Jenkins pipeline
myfileagent-python-ci/pipeline/head This commit looks good
Final project review (live) / review (push) Failing after 1m24s

This commit is contained in:
Codex
2026-11-27 19:08:59 +00:00
parent ad69828bc5
commit 9275fcdcae
11 changed files with 277 additions and 15 deletions
+16 -1
View File
@@ -217,7 +217,10 @@ def test_review(verified, receipt):
# Adopt Member 1's smoke entry point when integrated; retain the independent assertion.
member1 = ROOT / 'tests/smoke_demo.py'
if member1.exists():
subprocess.run([sys.executable, str(member1), str(root/'reviewed.py')], check=True, timeout=20)
try:
subprocess.run([sys.executable, str(member1), str(root/'reviewed.py')], check=True, timeout=20)
except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as exc:
raise ValueError('Member 1 smoke test failed') from exc
smoke(root / 'reviewed.py')
write_json(receipt, {'reviewed_sha256': digest((root/'reviewed.py').read_bytes()), 'result': 'passed'})
@@ -295,6 +298,18 @@ def metrics(review, output, completed_at):
rows += [f'review_{key}_available{{mode="live"}} {int(known)}']
if known:
rows += [f'review_{key}{{mode="live"}} {value}']
if completed_at is None and data.get('finished_at'):
from datetime import datetime
completed_at = int(datetime.fromisoformat(data['finished_at'].replace('Z', '+00:00')).timestamp())
elapsed = data.get('elapsed_seconds')
if type(elapsed) in (int, float) and 0 <= elapsed < float('inf'):
rows += [f'review_duration_seconds{{mode="live"}} {elapsed}']
resource = data.get('resource_measurement', {})
for field, metric in [('memory_peak_bytes', 'review_job_memory_peak_bytes'),
('memory_limit_bytes', 'review_job_memory_limit_bytes')]:
value = resource.get(field)
if type(value) is int and value > 0:
rows += [f'{metric}{{mode="live"}} {value}']
if not re.fullmatch('[0-9]+', str(completed_at)):
raise ValueError('Completion timestamp must be measured epoch seconds')
rows += [f'review_completed_timestamp_seconds{{mode="live"}} {completed_at}']