Skip to content

Improve docs: accurate batch/worker flow, architecture & deployment guides#782

Open
cmraible wants to merge 1 commit into
mainfrom
repo-audit/docs
Open

Improve docs: accurate batch/worker flow, architecture & deployment guides#782
cmraible wants to merge 1 commit into
mainfrom
repo-audit/docs

Conversation

@cmraible

Copy link
Copy Markdown
Collaborator

Summary

First PR of the repo-audit run: documentation. The prior audit found the docs mostly good except AGENTS.md was materially stale — it described a synchronous `PROXY_TARGET` flow, but the service runs in batch mode by default (publish to Pub/Sub → separate worker enriches → forwards to Tinybird).

Changes

  • AGENTS.md — correct the request flow (batch + proxy modes), fix the salt-store default, replace the stale module map (removed a nonexistent `src/services/proxy/` reference), and complete/group the environment-variable reference (adds `WORKER_MODE`, `PUBSUB_`, `BATCH_`, Firestore vars, etc).
  • README.md — add a "Run modes" section (batch vs proxy) and links to the new docs.
  • docs/architecture.md (new) — Mermaid diagram of the batch pipeline, Pub/Sub, salt-store adapters, and OpenTelemetry.
  • docs/deployment.md (new) — the Cloud Run deploy pipeline, `deploy-staging` label flow, and rollback.

Docs-only; no source, config, or workflow changes. Every technical claim was verified against source and the workflow files.

Context

This is step 1 of a full repo-audit (docs → CI trust → settings/rulesets → pnpm → oxlint). Later PRs that change tooling (pnpm, oxlint) will sweep these docs to keep commands current.

🤖 Generated with Claude Code

…uides

- Rewrite AGENTS.md request flow to reflect the default batch mode
  (Pub/Sub publish -> worker enrich -> Tinybird) plus synchronous proxy
  mode; correct the salt-store default and module map; group and complete
  the environment variable reference.
- Add a Run modes section to the README distinguishing batch vs proxy.
- Add docs/architecture.md with a Mermaid diagram of the batch pipeline,
  Pub/Sub, salt-store adapters, and OpenTelemetry setup.
- Add docs/deployment.md documenting the Cloud Run deploy pipeline,
  deploy-staging label flow, and rollback.
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The changes expand runtime documentation for batch and proxy modes, architecture modules, request flows, configuration, Pub/Sub, salt storage, and observability. They add deployment documentation covering release workflows, Cloud Run environments, image publishing, health checks, staging deployments, rollback, CI, cleanup, and local releases. The README links these new architecture and deployment references.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the docs-focused batch/worker flow and architecture/deployment guide updates.
Description check ✅ Passed The description accurately describes the documentation-only changes and matches the stated objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch repo-audit/docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cmraible cmraible marked this pull request as ready for review July 14, 2026 18:05

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
docs/deployment.md (1)

69-71: 🗄️ Data Integrity & Integration | 🔵 Trivial | 🏗️ Heavy lift

Make the rollback scope explicit for the worker.

Normal deployments update both analytics and worker, but rollback currently documents only analytics. Unless mixed-version operation is verified as compatible, operators can leave the ingest and worker services on different image versions; either roll back both or document the compatibility requirement and residual worker version.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/deployment.md` around lines 69 - 71, Update the rollback documentation
around the rollback.yml section to explicitly cover the worker service: state
whether rollback redeploys both analytics and worker, or document the required
compatibility of mixed versions and identify the worker version that remains
active. Align the wording with the actual workflow behavior and avoid implying
analytics-only rollback without this operational detail.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/architecture.md`:
- Around line 46-48: Specify a text/plaintext language identifier on the
service-name pattern code fence in docs/architecture.md lines 46-48 and the
Cloud Run service-name pattern code fence in docs/deployment.md lines 46-48;
leave the fenced content unchanged.

In `@docs/deployment.md`:
- Line 27: Update the “Bump Version” step description in the deployment
documentation to clarify that GH_PAT authorizes the push and tag only; remove
the implication that it allows the push to re-trigger CI or downstream
workflows, since the commit uses [skip ci] and Docker Hub is dispatched
explicitly by the following job.

---

Nitpick comments:
In `@docs/deployment.md`:
- Around line 69-71: Update the rollback documentation around the rollback.yml
section to explicitly cover the worker service: state whether rollback redeploys
both analytics and worker, or document the required compatibility of mixed
versions and identify the worker version that remains active. Align the wording
with the actual workflow behavior and avoid implying analytics-only rollback
without this operational detail.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3d7bf026-fa6b-4bca-8fd1-b7df3f734228

📥 Commits

Reviewing files that changed from the base of the PR and between 04cb97f and 1489e1e.

📒 Files selected for processing (4)
  • AGENTS.md
  • README.md
  • docs/architecture.md
  • docs/deployment.md

Comment thread docs/architecture.md
Comment on lines +46 to +48

Notes:
- **HMAC validation** ([`src/plugins/hmac-validation.ts`](../src/plugins/hmac-validation.ts)) is a global `preValidation` hook. It validates the signature and timestamp carried in the URL query parameters and strips them before downstream processing. It is skipped entirely if `HMAC_SECRET` is unset, and it can be run in log-only mode with `HMAC_VALIDATION_LOG_ONLY=true`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Specify languages for the documentation code fences.

Both fenced blocks omit a language identifier, triggering Markdownlint MD040.

  • docs/architecture.md#L46-L48: use text or plaintext for the service-name pattern block.
  • docs/deployment.md#L46-L48: use text or plaintext for the Cloud Run service-name pattern block.
📍 Affects 2 files
  • docs/architecture.md#L46-L48 (this comment)
  • docs/deployment.md#L46-L48
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture.md` around lines 46 - 48, Specify a text/plaintext language
identifier on the service-name pattern code fence in docs/architecture.md lines
46-48 and the Cloud Run service-name pattern code fence in docs/deployment.md
lines 46-48; leave the fenced content unchanged.

Source: Linters/SAST tools

Comment thread docs/deployment.md

Triggered on every push to `main` (and via manual `workflow_dispatch`). Jobs:

1. **Bump Version** — bumps the patch version with `npm version patch` (e.g. `1.2.3 → 1.2.4`), commits it as `vX.Y.Z [skip ci]`, pushes to `main`, and creates + pushes the `vX.Y.Z` git tag. Sends a Slack "new version released" notification. (Uses a `GH_PAT` so the push can re-trigger downstream workflows.)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the workflow-trigger explanation.

This step commits with [skip ci], which suppresses push-triggered workflows. GH_PAT authorizes the push/tag; Docker Hub is dispatched explicitly by the following job. Reword the parenthetical to avoid implying that this push re-triggers CI or deployment.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/deployment.md` at line 27, Update the “Bump Version” step description in
the deployment documentation to clarify that GH_PAT authorizes the push and tag
only; remove the implication that it allows the push to re-trigger CI or
downstream workflows, since the commit uses [skip ci] and Docker Hub is
dispatched explicitly by the following job.

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