Commit Graph

17 Commits

Author SHA1 Message Date
Claude BM
6d31b9bf2e Add PRODUCTION alert for main branch CI failures
When CI fails on main, notification escalates to 🚨 with
"PRODUCTION CI FAILED" header and instructions to verify
tsharps.com is still working.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-28 15:03:18 +00:00
Claude BM
8cf2b6c1cb Add auto-escalation: tag fail → light → heavy
When a tag-targeted run fails, automatically escalates:
  1. Tag tests fail → re-run full light suite
  2. If light fails → re-run heavy suite
  3. If tag fails but light passes → result = PASS (tag-only issue)

Escalation path shown in Telegram notification:
  "Escalation: tag:genlab (29 passed, 11 failed) → light PASSED (1431)"

Stops at first passing level — no wasted time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-28 14:52:52 +00:00
Claude BM
76dfd3b3c0 Add tag-targeted test runs to CI runner
ci-runner.sh now accepts optional 4th parameter for pytest markers:
  ci-runner.sh mfg abc123 claude genlab  → runs only genlab tests
  ci-runner.sh mfg abc123 claude heavy   → runs full heavy suite
  ci-runner.sh mfg abc123 claude         → runs full light suite (default)

Changes:
- TAG parameter parsed from $4
- pytest -m flag applied when tag provided
- RUN_MODE shown in Telegram notification (light/heavy/tag:name)
- Baseline check only enforced on full light suite runs
- Comments noting tags need periodic updates as features change

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-28 14:44:22 +00:00
Claude BM
7605094efb Rename TestMain → TestDevelop in README
Clearer name: TestDevelop is where CI changes are developed,
not related to the main/production branch.

Branch model: TestDevelop → TestStaging → TestProduction

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-28 14:21:15 +00:00
Claude BM
2f7b75e9b5 Update test baseline: 1279 → 1431
+28 weekend/CCX endpoint tests
+124 progression_v2 module tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-26 21:05:50 +00:00
Claude BM
e0b6103458 Add suggestions section to CI failure HTML report + dark mode
When CI fails, the HTML report now includes a "Suggestions" section
that analyzes failure patterns and provides actionable fix hints:
- Feature manifest path mismatches
- Import/module errors → pip install
- Auth failures → missing JWT cookie
- Route 404s → endpoint moved/renamed
- Test count regression → baseline drift
- Package check failures → missing deps
- Collection errors → broken conftest/syntax

Also converted the report to dark mode per golden rule.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-26 13:19:49 +00:00
Claude BM
b8ad91bbda Add test count baseline check — fails CI if tests drop below 1279
ci-config.json now has test_count_baseline. If a branch's passing
test count drops below this number, the build fails with
"TEST COUNT REGRESSION". Prevents accidental test loss from
incomplete syncs or bad merges.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 23:00:08 +00:00
Claude BM
e0a440232a Add centralized pipeline results JSON storage (Issue #4)
Creates /pipeline-results/ directory and writes a structured JSON file
after each CI run (before notification), capturing branch, commit,
actor, timestamp, result, test counts, features, duration, and tags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 22:29:53 +00:00
Claude BM
75dd4ee6dc Show feature tags instead of suite name in CI notifications
Lists all feature tags present in the tested files (e.g. genlab,
optimizer, scheduling) and how many tests were not in scope.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-22 08:27:21 +00:00
Claude BM
7406369b21 Add suite tag and deselected count to CI notifications
Telegram notifications now show which test suite was used (light/heavy)
and how many tests were not in that suite (deselected).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-22 08:14:27 +00:00
Claude BM
ab89dc05b2 Generate HTML failure report and attach to Telegram on CI fail
When tests fail, ci-runner.sh generates an HTML report with:
- Build metadata (branch, commit, actor, duration)
- Test stats (passed/failed/skipped/errors)
- Failed test table (file + test name)
- Failure detail output

ci-notify.sh sends the HTML as a document attachment alongside
the text notification in the CICD Pipeline topic.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-21 18:33:38 +00:00
Claude BM
cfaf67c4c6 Bind webhook server to 0.0.0.0 instead of 127.0.0.1
Required for Gitea webhook delivery via the server's public IP.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-21 16:47:25 +00:00
Claude BM
ec02b57adc Add global lock to serialize CI runs across branches
Multiple simultaneous test runs compete for PostgreSQL connections,
causing spurious errors. Global flock ensures one branch runs at a time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-21 09:20:11 +00:00
Claude BM
b8c4fe7cc2 Fail CI when 0 tests run — 0/0/0 is never a pass
If pytest reports 0 passed, 0 failed, 0 skipped, treat it as a
failure. Something is wrong if no tests ran at all.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-21 07:17:12 +00:00
Claude BM
0772d24cab Fix pytest-timeout detection and catch collection errors
--timeout flag caused pytest to fail silently on branches without
pytest-timeout installed. Now checks for the package first. Also
detects when pytest exits non-zero with 0 results (collection error)
and properly reports it as a failure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-21 07:13:15 +00:00
Claude BM
11b11ea8de feat: tag @TSHARPSbm_bot in all CI notifications so Claude sees results 2026-04-21 05:18:26 +00:00
Claude BM
9b7abec506 feat: TSHARPS-CI external runner — branch-independent CI pipeline
Complete CI system that lives outside TSHARPS branches:
- ci-webhook.py: HTTP server on port 9500, receives Gitea push webhooks
- ci-runner.sh: runs feature manifests, pytest, package checks (read-only)
- ci-notify.sh: sends results to Telegram CICD Pipeline topic (4706)
- ci-config.json: branch→worktree mapping, tokens, timeouts
- README.md: branch model, promotion workflow, switch-back plan

Same tests for ALL branches. No drift. Runner self-monitors for crashes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-21 03:25:31 +00:00