Skip to content

Conversation

@devlopersabbir
Copy link
Owner

@devlopersabbir devlopersabbir commented Sep 14, 2025

Summary by CodeRabbit

  • New Features

    • Real-time broadcast of active coders to connected clients.
    • Zero-downtime VPS deployment workflow for smoother updates.
    • Tag-based releases now auto-populate notes from the changelog.
    • Utilities to simplify HTTPS setup (self-signed certs and NGINX config).
  • Changes

    • Default server port changed to 6000.
    • Docker Compose profiles added for prod/dev to streamline runs.
  • Documentation

    • Example environment file expanded with deployment-related variables.
  • Chores

    • Version bumped to 0.0.3.
    • Ignored additional sensitive key files in VCS and Docker builds.

@vercel
Copy link

vercel bot commented Sep 14, 2025

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

Project Deployment Preview Comments Updated (UTC)
executeme Building Building Preview Comment Sep 14, 2025 0:26am

@coderabbitai
Copy link

coderabbitai bot commented Sep 14, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds CI/CD pipelines and a composite action for env setup, introduces zero-downtime deployment and NGINX/HTTPS setup scripts, updates server port and active-coder broadcasting, configures docker-compose profiles, adjusts release workflow to use tag-based changelogs, updates package metadata, and cleans up ignore files and deprecated workflows.

Changes

Cohort / File(s) Summary
Git ignore updates
\.dockerignore, \.gitignore, \.secrets
Add executeme.pem to ignore lists and remove one URL line from .secrets.
Environment examples & package metadata
.env.example, package.json
Add DOCKER/VPS variables to .env.example. Add displayName, bump version to 0.0.3, add dotenv-expand and node to devDependencies.
Server/runtime
app.js, docker-compose.yaml
Add emitActiveCoder() and call on connect/disconnect; default port to 6000. Add compose profiles: most services prod; server prod,dev.
Composite action
.github/setup-and-load-env/action.yml
New composite action to build .env, write SSH key, export envs, and verify. Inputs include DOCKER/VPS fields.
Workflows: CI/CD & release
.github/workflows/cd.yaml, .github/workflows/ci.yaml, .github/workflows/electron-build.yaml, .github/workflows/static.yml
New CD pipeline: build/push Docker image and deploy to VPS via SSH; loads env via composite action. CI removes Vitest step. Electron build extracts changelog by tag and publishes release to a target repo using a token. Static site workflow tweaks: triggers, setup-pages, env url.
Removed legacy workflows
.github/workflows/deploy.yaml, .github/workflows/release-tag.yaml
Delete old deploy and release-tag workflows.
Deployment & ops scripts
scripts.sh, scripts/deploy.sh, scripts/generate-self-signed-cert.sh, scripts/setup-nginx.sh
Replace scripts.sh with env/tag derivation and GH secrets sync. Add zero-downtime Docker deploy with rollback and status. Add self-signed cert generator. Add NGINX+HTTPS setup with self-signed/Let’s Encrypt paths and compose orchestration.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GH as GitHub Actions
  participant Act as setup-and-load-env (composite)
  participant DH as Docker Hub
  participant VPS as VPS Server

  Dev->>GH: Push to main / trigger CD
  GH->>Act: Run composite action (inputs from secrets)
  Act->>Act: Generate .env, write deploy_key.pem, export envs
  GH->>DH: docker login/build/push (compose --profile prod)
  GH-->>Dev: Build & push logs
  GH->>VPS: SSH + SCP (.env, compose, scripts)
  GH->>VPS: Run scripts/deploy.sh --version PACKAGE_VERSION
  VPS->>VPS: Start new container, health-check, switch
  VPS-->>GH: Status/health results
  GH-->>Dev: Deployment outcome
Loading
sequenceDiagram
  autonumber
  participant Depl as deploy.sh
  participant Docker as Docker Engine
  participant App as New Container
  participant Old as Current Container
  participant HC as Health Endpoint

  Depl->>Docker: Identify Old container/version
  Depl->>Docker: Pull/use image for target version
  Depl->>Old: Rename to backup (non-disruptive)
  Depl->>Docker: Launch App (compose with new version)
  loop Health retries
    App->>HC: HTTP GET /health (or /status)
    HC-->>App: 200 ok / fail
  end
  alt Success
    Depl->>Docker: Remove Old backup
    Depl->>Depl: Record version (history)
  else Failure
    Depl->>Docker: Stop/Remove App
    Depl->>Docker: Restore Old backup
    Depl->>Depl: Log rollback result
  end
Loading
sequenceDiagram
  autonumber
  participant Action as Composite Action
  participant FS as Workspace FS
  participant GEnv as GITHUB_ENV

  Action->>FS: Write .env with inputs
  Action->>FS: Write deploy_key.pem (chmod 600)
  Action->>FS: Append VPS_SSH_PRIVATE_KEY_FILE to .env
  Action->>GEnv: Export selected variables
  Action->>FS: Verify .env presence/size
  Action-->>Action: Print summary (package, version, key path)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • should release #14 — Also modifies .github/workflows/electron-build.yaml; overlapping release flow logic.
  • Sabbir #9 — Touches deployment workflow and app.js socket behavior; overlaps with deployment and broadcasting changes.
  • Sabbir #7 — Introduces the deploy workflow that this PR removes/replaces; directly conflicting lineage.

Poem

Thump-thump, I ship with careful cheer,
New pipes hum CI far and near.
Keys tucked safe, nginx aglow,
Zero-downtime—watch it flow!
Tag the clouds, release notes sing—
I twitch my nose and press “deploy”… spring! 🐇🚀

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sabbir

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ffb48e1 and a1ca58b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (18)
  • .dockerignore (1 hunks)
  • .env.example (1 hunks)
  • .github/setup-and-load-env/action.yml (1 hunks)
  • .github/workflows/cd.yaml (1 hunks)
  • .github/workflows/ci.yaml (1 hunks)
  • .github/workflows/deploy.yaml (0 hunks)
  • .github/workflows/electron-build.yaml (3 hunks)
  • .github/workflows/release-tag.yaml (0 hunks)
  • .github/workflows/static.yml (1 hunks)
  • .gitignore (1 hunks)
  • .secrets (0 hunks)
  • app.js (2 hunks)
  • docker-compose.yaml (2 hunks)
  • package.json (2 hunks)
  • scripts.sh (1 hunks)
  • scripts/deploy.sh (1 hunks)
  • scripts/generate-self-signed-cert.sh (1 hunks)
  • scripts/setup-nginx.sh (1 hunks)

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 and usage tips.

@devlopersabbir devlopersabbir merged commit 978230f into main Sep 14, 2025
1 of 4 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.

2 participants