Skip to content

feat: enable the k8s deployment for the relay server#25

Merged
sirily11 merged 1 commit into
mainfrom
deployment
May 20, 2026
Merged

feat: enable the k8s deployment for the relay server#25
sirily11 merged 1 commit into
mainfrom
deployment

Conversation

@sirily11
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 20, 2026 05:29
@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rxcode Ready Ready Preview, Comment May 20, 2026 5:32am

Request Review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces infrastructure and runtime changes to support running the Go relay server in Kubernetes (multi-replica) and wires the desktop/mobile clients toward using an RxLab-hosted relay catalog, alongside some Claude/MCP integration updates.

Changes:

  • Add a Redis pub/sub backplane + presence tracking to enable multi-replica relay routing, plus Kubernetes manifests and a release-gated deploy workflow.
  • Add a hosted-relay catalog (relays.json) and update the desktop “Mobile” settings UI to pick hosted relays or enter a custom relay URL.
  • Extend Claude/MCP config generation to optionally include an IDE-provided MCP bridge and inform the agent via an appended system prompt.

Reviewed changes

Copilot reviewed 25 out of 27 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
website/public/relays.json Adds hosted relay catalog published by the website.
website/.gitignore Ignores local env files for the website.
RxCode/Views/Settings/MobileSettingsTab.swift Updates settings UI to support hosted relay presets vs custom URL.
RxCode/Services/RelayPresetCatalog.swift Implements hosted relay preset catalog loader with bundled fallback.
RxCode/Services/MCPService.swift Allows injecting an additional rxcode-ide MCP server into Claude config.
RxCode/Services/ClaudeService.swift Appends IDE-tools system prompt when using an MCP config.
RxCode/App/AppState.swift Allocates per-session IDE MCP port and passes bridge config to MCP service.
relay-server/relay.go Adds backplane-aware routing + presence refresh on ping.
relay-server/backplane.go Implements Redis backplane pub/sub + presence keys with ownership-safe clearing.
relay-server/main.go Adds REDIS_URL / -redis-url to enable multi-node mode.
relay-server/health.go Adds mode to /healthz response and bumps version.
relay-server/README.md Documents Redis-backed multi-node mode and Kubernetes deployment.
relay-server/go.mod Bumps Go version and adds Redis dependency.
relay-server/go.sum Updates sums for new dependencies.
relay-server/Dockerfile Updates base image version and runs as nonroot distroless.
relay-server/k8s/namespace.yaml Adds namespace manifest for relay deployment.
relay-server/k8s/configmap.yaml Adds config map for relay runtime configuration.
relay-server/k8s/deployment.yaml Adds Deployment for multi-replica relay server.
relay-server/k8s/service.yaml Adds ClusterIP service for relay.
relay-server/k8s/ingress.yaml Adds NGINX ingress config with WebSocket-friendly timeouts.
relay-server/k8s/pdb.yaml Adds PodDisruptionBudget to keep at least one pod serving.
relay-server/k8s/hpa.yaml Adds CPU-based autoscaling configuration.
relay-server/k8s/kustomization.yaml Adds Kustomize orchestration for manifests.
relay-server/k8s/README.md Adds operator docs for Kubernetes deployment.
.github/workflows/relay-deploy.yaml Adds CI workflow to build and (on release) deploy the relay.
Packages/Sources/RxCodeChatKit/ChatMessageBubble.swift Special-cases AskUserQuestion tool calls in compact bubbles.
.gitignore Ignores relay-server/k8s/secrets.yaml to avoid committing secrets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread relay-server/relay.go
Comment on lines 105 to +114
func (h *Hub) deliver(env *Envelope) {
if h.deliverLocal(env) {
return
}
// Not connected to this pod.
if h.backplane != nil {
// Another replica may hold the connection. The backplane round-trips
// to Redis, so run it off the hub loop to keep local routing fast.
go h.routeViaBackplane(env)
return
Comment thread relay-server/relay.go
Comment on lines +124 to 129
func (h *Hub) deliverLocal(env *Envelope) bool {
raw, err := json.Marshal(env)
if err != nil {
log.Printf("marshal envelope: %v", err)
return
return false
}
# Listen address inside the pod. The Service targets this port.
RELAY_ADDR: ":8787"
# APNs topic must equal the RxCode Mobile bundle identifier exactly.
APNS_TOPIC: "com.idealapp.RxCode.Mobile"
Comment thread relay-server/README.md
@@ -54,6 +54,7 @@ missing file is non-fatal — the relay just uses whatever's in the process env.
| `-apns-team-id` | `APNS_TEAM_ID` | 10-char Team ID. |
| `-apns-topic` | `APNS_TOPIC` | iOS app bundle identifier (e.g. `app.rxlab.rxcodemobile`). |
Comment on lines +4 to +7
metadata:
name: rxcode-relay
namespace: rxcode-relay

Comment on lines +40 to +50
### 1. Populate secrets

Edit `secrets.yaml` with real APNs values, then apply it manually (it is
deliberately excluded from `kustomization.yaml`):

```bash
# encode the .p8 auth key
base64 < AuthKey_XXXXXXXXXX.p8 | tr -d '\n'

kubectl apply -f secrets.yaml
```
Comment on lines +1 to +16
name: Deploy Relay Server

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- main
release:
types:
- created

env:
IMAGE: ghcr.io/${{ github.repository_owner }}/rxcode-relay
@sirily11 sirily11 merged commit 661bd31 into main May 20, 2026
6 checks passed
@sirily11 sirily11 deleted the deployment branch May 20, 2026 05:36
@sirily11
Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 1.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants