Skip to content

M3b part 2: pattern 3 (CI-CD) page live — 12 of 12 - #13

Merged
MAOFILHO merged 2 commits into
mainfrom
m3b/cicd-page
Nov 16, 2026
Merged

MAOFILHO merged 2 commits into
mainfrom
m3b/cicd-page

Conversation

@MAOFILHO

Copy link
Copy Markdown
Owner

Closes #10. Refs #7: this PR's CI run should be the proof that a small change skips the jobs it doesn't touch.

What it does

  • New gateway endpoint /api/patterns/delivery:
    • It lists the commit each running service was built from.
    • It labels each service: current (built from main), behind (main changed that service's code or shared code since its build, the same rule the Deploy button uses), no changes since its build, local, or unknown.
    • It returns the latest CI and Deploy runs on main.
  • GitHub data: read from GitHub's public API, in parallel. Each answer is reused for 5 minutes, then re-checked with its ETag (an unchanged answer does not count against the 60-per-hour anonymous limit). On errors the last good answer is kept, so a GitHub problem never breaks the page.
  • The CI-CD pattern page: the problem, how this project does it, when not to use it, and the live demo. The README, Home and Patterns pages now say all 12 patterns are live. Screenshot: docs/screenshots/p03-ci-cd.jpg.

Review

Matt Pocock code review on both axes found 9 standards findings and 2 spec findings. All are fixed, test-first. GitHub is faked at the HTTP layer, so caching, ETags and errors are really tested.

Tests

  • 149 unit tests pass across 8 suites; the gateway suite now has 23.
  • The page was checked in the browser against GitHub's real data.

🤖 Generated with Claude Code

MAOFILHO and others added 2 commits November 15, 2026 18:30
- Gateway /api/patterns/delivery: each running service's build commit compared with the latest
  commit on main (current / behind / local / unknown), plus the latest CI and Deploy runs on main,
  from GitHub's public API, cached 60 s. Built test-first; GitHub stubbed in tests.
- CI-CD pattern page: problem, how this project does it, when not to use it, live demo.
- README, Home and Patterns say all 12 are live; screenshot p03-ci-cd.jpg.

Closes #10

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- "behind main" now uses Deploy's rule: only when main changed the service's folder or shared code
  since its build; otherwise "no changes since its build". No more false "press Deploy" alarms.
- GitHub calls run in parallel, are reused for 5 minutes and then revalidated with their ETag (a
  304 does not use the 60-per-hour anonymous limit); on 403/5xx the last good answer is kept;
  odd or non-JSON replies give "unknown", never a 500.
- Tests fake GitHub at the HTTP layer (httpx.MockTransport), so caching, ETags and errors are tested.
- Runtime fan-out shared through resilience.collect_runtimes; loading state and typed status maps
  on the page; copy fixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MAOFILHO
MAOFILHO merged commit c79bd03 into main Nov 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

M3b: Pattern 3 (CI-CD) page goes live

1 participant