Skip to content

feat(nats): ship the JetStream sink as its own binary - #36

Merged
yordis merged 1 commit into
mainfrom
yordis/feat-nats-binary
Oct 27, 2026
Merged

yordis merged 1 commit into
mainfrom
yordis/feat-nats-binary

Conversation

@yordis

@yordis yordis commented Oct 27, 2026 •

Copy link
Copy Markdown
Member
  • The sink needs no HTTP server or web UI, so it should not pay for them in size, startup or attack surface.
  • Operators can run and roll it independently of walgit serve, with the same walgit.toml or a smaller one.

@yordis
yordis added this pull request to stack #34 October 27, 2026 05:46
@cursor

cursor Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Operational breaking change (walgit nats removed) with no change to HTTP serve path or WAL publish semantics; same publisher code in a slimmer deployable.

Overview
The JetStream ref-events sink is no longer walgit nats; it runs as a dedicated walgit-nats binary (decision D51). The main walgit CLI drops the Nats subcommand and the walgit-cli → walgit-nats dependency, while walgit-nats gets its own entrypoint with --config / WALGIT_CONFIG, shared walgit-telemetry startup, and the existing walgit_nats::run logic unchanged in the library.

Packaging and tests follow the split: the OCI image and Nix build install walgit-nats alongside walgit / walgit-server; just smoke and tests/e2e.sh build and spawn the new binary (WALGIT_NATS) instead of walgit … nats. Docs and config comments now point operators at walgit-nats and note it can use a minimal config (store, cache, wal, events, telemetry only).

Reviewed by Cursor Bugbot for commit ee4035c. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

The JetStream sink is now shipped as a standalone walgit-nats binary rather than a walgit nats subcommand. Build outputs, configuration references, documentation, and end-to-end tests now use the standalone binary.

Changes

Standalone JetStream sink

Layer / File(s) Summary
Standalone binary and CLI separation
AGENTS.md, crates/walgit-nats/Cargo.toml, crates/walgit-nats/src/bin/*, crates/walgit-cli/*, crates/walgit-nats/src/*
The NATS sink gains a binary entry point that loads startup configuration and runs the sink. The walgit CLI no longer defines or dispatches the nats subcommand.
Build and configuration integration
Containerfile, flake.nix, crates/walgit-config/src/lib.rs, docs/EVENTS.md, walgit.example.toml
The Containerfile and Nix flake build and install walgit-nats. Documentation and configuration comments identify the standalone executable and describe its configuration options and dependencies.
Smoke-test execution and checks
justfile, tests/e2e.sh, crates/walgit-nats/tests/*, crates/walgit-server/tests/events_nats.rs
The smoke target supplies the standalone binary to the end-to-end test. The optional NATS phase launches it and retains the existing readiness, restart, catch-up, and shutdown checks.

Priority: Not assessed

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant WalgitNats as walgit-nats
  participant StartupConfig as startup configuration
  participant Sink as walgit_nats::run
  Operator->>WalgitNats: provide --config or WALGIT_CONFIG
  WalgitNats->>StartupConfig: load startup configuration
  WalgitNats->>Sink: run with shared configuration
Loading

Possibly related PRs

Suggested reviewers: tobi

Merge Risk: Low · up to 78b77

The optional end-to-end workflow may not test the current NATS sink when a custom walgit binary is supplied.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the NATS stream,
Then watches walgit-nats gleam.
A config flag points the way,
While tests run through the day.
The CLI lets the sink depart,
And hops along with a fresh start.

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

The sink needs no HTTP server or web UI, so it should not pay for them in
size or attack surface.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis force-pushed the yordis/feat-nats-binary branch from ee4035c to 78b7772 Compare October 27, 2026 06:09
Base automatically changed from yordis/refactor-walgit-telemetry to main October 27, 2026 06:31
@yordis
yordis force-pushed the yordis/feat-nats-binary branch 2 times, most recently from 18d6a0f to 78b7772 Compare October 27, 2026 07:43
@yordis
yordis merged commit 81c923c into main Oct 27, 2026
2 of 3 checks passed
@yordis
yordis deleted the yordis/feat-nats-binary branch October 27, 2026 07:46
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