Skip to content

feat: self-sufficient, vendor-neutral CLI for k8s/Jenkins - #7

Merged
YoniRaviv merged 17 commits into
mainfrom
feat/k8s-vendor-neutral-cli
Jun 14, 2026
Merged

YoniRaviv merged 17 commits into
mainfrom
feat/k8s-vendor-neutral-cli

Conversation

@YoniRaviv

Copy link
Copy Markdown
Owner

Summary

Makes the docpulse CLI work correctly when invoked outside its Docker entrypoint (k8s sidecar / uv/pipx-installed) and vendor-neutral for findings output — so DocPulse runs on any CI/SCM without a Docker daemon or per-vendor comment-API lock-in. The GitHub Action's behavior is unchanged.

  • src/docpulse/ci.py (new) — CI self-prep the entrypoint used to do, now in the CLI: ensure_safe_directory (trust the checkout under a container uid mismatch), resolve_base_ref (fetch the base on shallow checkouts), loop_guard (skip a re-triggered run on a bot-authored HEAD). All guarded against TimeoutExpired/FileNotFoundError.
  • cli.py — _bot_identity env resolver; check/repair gain --comment-out PATH and --comment-via {gh,none} (default gh); both call the self-prep in order (safe.directory → push-only loop guard → base-ref fetch) before diffing.
  • destinations/repo_markdown.py — writes the flag comment to a portable artifact for any CI to post; gh pr comment is gated on --comment-via gh + live + a PR number; the doc-sync commit is bot-authored via inline git -c user.* (so the loop guard recognizes it). Push stays plain git push origin HEAD — host-agnostic.
  • entrypoint.sh — slimmed to a thin env→CLI wrapper (git-prep/loop-guard removed; the CLI owns them now).
  • README — adds a "Kubernetes (no Docker daemon)" sidecar recipe.

Vendor-neutrality is a producer/consumer split: DocPulse detects, fixes, and reports; posting to a specific PR/MR UI is the CI platform's job (GitHub stays the built-in default via gh).

Spec & plan: docs/superpowers/specs/2026-06-14-k8s-vendor-neutral-cli-design.md, docs/superpowers/plans/2026-06-14-k8s-vendor-neutral-cli.md.

Test Plan

  • uv run pytest -q → 219 passed
  • uv run ruff check src tests → clean
  • docpulse check --help / repair --help expose --comment-out and --comment-via [gh|none]
  • --comment-via bogus rejected with a clean Typer error
  • docker build succeeds with the slimmed entrypoint
  • Smoke-test the sidecar recipe in a real k8s Jenkins pod (docpulse index + docpulse check --comment-via none --comment-out flag.md)

🤖 Generated with Claude Code

YoniRaviv and others added 17 commits June 14, 2026 14:24
Move CI git-prep + loop guard out of entrypoint.sh into the CLI so docpulse
works correctly via sidecar/install (no Docker daemon), and emit findings as a
portable --comment-out artifact (gh posting stays default, other vendors opt out).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
8 TDD tasks: ci.py self-prep (safe.directory, base fetch, loop guard),
bot-identity resolver, --comment-out/--comment-via destination routing,
bot-authored commit via inline git -c, slimmed entrypoint, k8s sidecar docs.
Reconcile spec to inline-identity commit approach.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…match

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nt options

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e bot constants

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…est, doc clarity

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@YoniRaviv
YoniRaviv merged commit 2e950a6 into main Jun 14, 2026
2 of 3 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.

1 participant