Skip to content

ci: bulletproof pipeline (phase 1) — docs advisory, toolchain retries, dependabot auto-approve, main-health, DCO auto-signoff#179

Merged
se-jo-ma merged 2 commits into
mainfrom
ci/bulletproof-phase1
Jul 16, 2026
Merged

ci: bulletproof pipeline (phase 1) — docs advisory, toolchain retries, dependabot auto-approve, main-health, DCO auto-signoff#179
se-jo-ma merged 2 commits into
mainfrom
ci/bulletproof-phase1

Conversation

@se-jo-ma

@se-jo-ma se-jo-ma commented Jul 13, 2026

Copy link
Copy Markdown
Member

Phase 1 of the CI-fragility remediation. Companion to #178 (immediate unblock). Follows the RCA: the pipeline kept burning because required gates were nondeterministic or cosmetic, and dependabot automation was cancelled by its own rails.

Principle: block only on "does the code/docs build." Everything else auto-fixes or advises — never gates. And the required gates that remain must survive transient flake.

docs.yml — split by severity

Job Severity Contents
docs required (unchanged branch-protection context) version-sync · mkdocs build --strict · docstring + SDK coverage · tutorial snippets — deterministic, fast, no regeneration / no git-history / no network
docs-quality advisory (not required; every step continue-on-error) regenerate · drift · check_doc_sources freshness · spelling · markdownlint · link-check — all as warnings

The freshness gate keyed on commit SHAs/dates, which squash-merge rewrites → green-on-PR, red-on-main (what broke #178's target). Advisory kills the whole class. Reproduced: the original poison (stale last_verified vs a newer pyproject.toml commit) now exits 1 inside the advisory job (warning) while the required docs job stays green.

ci.yml — harden required toolchain installs (folded in)

The required test job installs minisign/protoc/protoc-gen-doc via raw apt+curl — a transient network/apt blip would fail a required job for no real reason. Each is now retried (3× w/ backoff). The SHA256 verify stays after the retries, so a partial/failed download still fails loud and no unverified binary installs. The issue-#16 skip-guard is preserved (a genuinely-missing tool still fails). Retry logic unit-tested for success / transient-then-success / all-fail-loud.

dependabot-auto-approve.yml (new)

github-actions[bot] approves only dependabot[bot] patch/minor PRs → satisfies the "1 review" rule → existing auto-merge completes with zero clicks. Human PRs (incl. write-collaborators) still require a manual review.

main-health.yml (new)

A required workflow failing a push to main opens/updates a main-health tracking issue. Main once sat red 6 days unnoticed.

DCO auto-signoff

scripts/dco_signoff.sh + pre-commit prepare-commit-msg hook (installed by make init) auto-append Signed-off-by matching the author — your own commits never trip DCO even when your git email isn't the org-mapped one.

Verified locally

  • Required docs job green against committed content, no regen/toolchain: mkdocs --strict 4s; version-sync/docstring/SDK coverage rc=0.
  • Original freshness poison → advisory warning, required docs still green (reproduced both directions).
  • Retry logic: success→0, transient→0, all-fail→loud 1.
  • DCO hook idempotent; all workflow YAMLs parse.

Not in this PR (by design)

  • No branch-protection API changes — docs stays required; docs-quality is never added to required.
  • .github/dco.yml untouched (already remediation-friendly, non-required). Open question: keep DCO vs drop the ceremony.

Phase 2 (separate): lift this pipeline into kraken-dotgithub reusable workflows for nautilus + stargraph.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WwWcjyxBybBxWxLEue99YY

Comment on lines +29 to +63
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.13"

- name: Install Python deps
run: uv sync --extra docs --extra server --extra mcp

- name: Version sync
run: uv run python scripts/check_version_sync.py

# Builds against the committed generated artifacts. Staleness of those
# artifacts is advisory (see docs-quality), not a build failure — a
# strict build validates nav, internal links, and rendering, which is
# what "the docs build" means.
- name: Build (strict)
run: uv run mkdocs build --strict

- name: Docstring coverage
run: uv run python scripts/check_docstrings.py

- name: SDK coverage
run: uv run python scripts/check_sdk_coverage.py

- name: Tutorial snippet verification
if: hashFiles('docs/tutorials/*.md') != ''
run: uv run python scripts/verify_tutorial_snippets.py docs/tutorials

# ---- ADVISORY: quality signals, never block a merge ------------------
docs-quality:
…t auto-approve, main-health canary, DCO auto-signoff

Phase 1 of the CI-fragility remediation. Root cause of the recurring red
checks: required gates that are nondeterministic (history-keyed doc-drift
across the squash-merge boundary; transient toolchain-install flake),
cosmetic checks wired as blocking, and automation defeated by its own
rails. This retiers the pipeline so only "does the code/docs build" blocks
a merge, and makes the remaining required installs survive network blips.

docs.yml — split into two jobs:
  * docs (REQUIRED): deterministic + fast — version-sync, mkdocs build
    --strict, docstring/SDK coverage, tutorial snippets. No regeneration,
    no git-history walk, no network. Cannot flake across a squash.
  * docs-quality (ADVISORY, every step continue-on-error): regenerate +
    drift / freshness (check_doc_sources) / spelling / markdownlint / link
    check, all as warnings. A doc typo or stale-artifact no longer blocks
    an unrelated PR. Release-PR artifact drift is still auto-fixed by
    release-please-docs.yml.

ci.yml — retry the raw-network installs in the REQUIRED test job (minisign
  apt, protoc + protoc-gen-doc downloads). 3 attempts with backoff; the
  SHA256 verify stays AFTER the retries so a partial/failed download still
  fails loud and unverified binaries never install. Preserves the issue-#16
  skip-guard (a genuinely-missing tool still fails the final `command -v` /
  sha256 check). Kills transient-flake merge blocks without losing coverage.

dependabot-auto-approve.yml (new) — github-actions[bot] approves only
  dependabot[bot] patch/minor PRs so they satisfy the "1 review" rule and
  auto-merge completes hands-free. Human PRs still require a manual review.

main-health.yml (new) — opens/updates a tracking issue when a required
  workflow fails on a push to main, so a red main can't sit unnoticed.

scripts/dco_signoff.sh + pre-commit prepare-commit-msg hook + `make init`
  — auto-append a DCO Signed-off-by trailer so your own commits never trip
  DCO, regardless of whether your git email maps to org membership.

Verified locally: required docs job passes against committed content with
no regen/foreign toolchain (mkdocs --strict 4s; coverage checks rc=0); the
original freshness-gate poison now downgrades to an advisory warning while
the required docs job stays green; retry logic tested (success / transient
/ all-fail-loud); DCO hook idempotent; all workflow YAMLs parse.

Signed-off-by: Sean Mauk <seanmauk@krakennetworks.com>
@se-jo-ma
se-jo-ma force-pushed the ci/bulletproof-phase1 branch from c3f2d83 to c6da401 Compare July 13, 2026 22:03
@se-jo-ma se-jo-ma changed the title ci: bulletproof pipeline (phase 1) — docs advisory, dependabot auto-approve, main-health canary, DCO auto-signoff ci: bulletproof pipeline (phase 1) — docs advisory, toolchain retries, dependabot auto-approve, main-health, DCO auto-signoff Jul 13, 2026
@se-jo-ma
se-jo-ma enabled auto-merge (squash) July 16, 2026 14:45
@se-jo-ma
se-jo-ma requested a review from krakennetworks July 16, 2026 14:46
@se-jo-ma
se-jo-ma merged commit b5951b0 into main Jul 16, 2026
27 checks passed
@se-jo-ma
se-jo-ma deleted the ci/bulletproof-phase1 branch July 16, 2026 14:52
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.

3 participants