Skip to content

feat: add admin_notify, deploy_status, logs commands + finish deploy.yml - #59

Merged
gamblecodezcom merged 1 commit into
mainfrom
claude/update-prod-runner-script-Lq2gS
Feb 22, 2026
Merged

feat: add admin_notify, deploy_status, logs commands + finish deploy.yml#59
gamblecodezcom merged 1 commit into
mainfrom
claude/update-prod-runner-script-Lq2gS

Conversation

@gamblecodezcom

@gamblecodezcom gamblecodezcom commented Feb 22, 2026

Copy link
Copy Markdown
Owner

User description

  • Add /admin_notify: broadcasts a message to all admin IDs via notifyAdminsPlain
  • Add /deploy_status: reads /tmp/deploy-report.txt from the VPS deploy script and returns it in chunks
  • Add /logs: tails journalctl or /tmp/runewager-3000.log (configurable line count, max 200)
  • deploy.yml: add workflow_dispatch dry_run/skip_tests inputs, [skip deploy] guard, secrets verification, duration tracking, disk free warning, artifact upload, post-deploy health check (30s), dry-run-report job

https://claude.ai/code/session_01X3PxGFF5zzKptQwVkjYzzN

Summary by CodeRabbit

  • New Features

    • Added dry-run deployment capability to safely test deployments without live impact.
    • Added admin commands for broadcast notifications, deployment status retrieval, and system log access.
  • Chores

    • Enhanced deployment workflow with improved safety checks including Node version validation, secrets verification, and disk space monitoring.

CodeAnt-AI Description

Improve deployment workflow and add admin maintenance commands

What Changed

  • Add three admin bot commands: broadcast an admin-only message, fetch the latest deploy report (split into message chunks), and tail recent service logs with a configurable line count (max 200).
  • Add dry-run and skip-tests inputs to the deployment workflow; support a dedicated dry-run job that sends a summary without changing the VPS.
  • Prevent accidental deploys by guarding builds (only main branch, optional [skip deploy] commit flag) and by verifying required secrets and Node 20+ before deploying.
  • During deploys, record start/duration, warn when VPS disk free is under 100MB, upload the VPS deploy report as an artifact, and send a final report that includes duration and the report body.
  • After successful deploys, wait 30s and run a post-deploy health check that reports OK/FAIL to the notification channel.

Impact

✅ Fewer accidental production deploys
✅ Clearer final deploy reports with duration and server report
✅ Faster troubleshooting via admin log access and deploy-report artifact

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

- Add /admin_notify: broadcasts a message to all admin IDs via notifyAdminsPlain
- Add /deploy_status: reads /tmp/deploy-report.txt from the VPS deploy script and returns it in chunks
- Add /logs: tails journalctl or /tmp/runewager-3000.log (configurable line count, max 200)
- deploy.yml: add workflow_dispatch dry_run/skip_tests inputs, [skip deploy] guard, secrets verification, duration tracking, disk free warning, artifact upload, post-deploy health check (30s), dry-run-report job

https://claude.ai/code/session_01X3PxGFF5zzKptQwVkjYzzN
@codeant-ai

codeant-ai Bot commented Feb 22, 2026

Copy link
Copy Markdown

CodeAnt AI is reviewing your PR.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gamblecodezcom
gamblecodezcom merged commit 7423ed2 into main Feb 22, 2026
2 of 4 checks passed
@coderabbitai

coderabbitai Bot commented Feb 22, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The PR introduces comprehensive deployment workflow automation with quality gates, pre-deployment safeguards, and conditional dry-run support, alongside three new admin commands for real-time system visibility and operational notifications.

Changes

Cohort / File(s) Summary
Deployment Workflow Enhancements
.github/workflows/deploy.yml
Introduces workflow inputs for dry_run and skip_tests; adds Quality Gates job with pre-flight checks (branch validation, commit message filtering, secret verification, Node version checks, disk space validation); enhances Deploy to VPS job with conditional execution, SSH setup, pre/post-deployment health snapshots, port-swap with restart guards, artifact attachment, and rollback triggers; adds Dry Run Report job for workflow_dispatch with dry_run=true; includes detailed duration tracking and metadata throughout.
Admin Command Extensions
index.js
Adds three new admin-restricted commands: /admin_notify for broadcast messaging to admins, /deploy_status for reading and displaying deploy reports in chunked Markdown, and /logs for fetching system logs (journalctl or tail fallback) with chunked output formatting.

Sequence Diagram(s)

sequenceDiagram
    participant GHA as GitHub Actions
    participant QG as Quality Gates Job
    participant VPS as VPS Server
    participant NOTIF as Notification System
    participant PD as Post-Deploy Check

    GHA->>QG: Trigger workflow (dry_run flag)
    QG->>QG: Verify branch == main
    QG->>QG: Check commit message (no [skip deploy])
    QG->>QG: Validate secrets & Node version
    QG->>QG: Run optional tests (if skip_tests=false)
    QG-->>GHA: Quality gates passed

    alt Dry Run Mode
        GHA->>NOTIF: Send dry-run report
        NOTIF-->>GHA: Notification sent
    else Normal Deploy
        GHA->>VPS: SSH setup & health snapshot
        VPS->>VPS: Check disk space threshold
        VPS->>VPS: Git fetch/reset to main
        VPS->>VPS: npm install (omit dev)
        VPS->>VPS: Port-swap deployment (max 3 restarts)
        alt Deployment Success
            VPS-->>GHA: Deploy complete
            GHA->>NOTIF: Send success notification
            GHA->>PD: Wait 30s, run post-deploy health check
            PD-->>GHA: Health status
        else Deployment Failure
            VPS-->>GHA: Deploy failed
            GHA->>NOTIF: Send failure notification & trigger rollback
            NOTIF-->>GHA: Rollback initiated
        end
    end
Loading

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 Hops with glee
Deploy gates guard the way with care,
Dry-runs practice in the air!
Admins peek at logs and status bright,
Safe deployments in the night! 🌙


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

@gamblecodezcom
gamblecodezcom deleted the claude/update-prod-runner-script-Lq2gS branch February 22, 2026 15:07
@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Feb 22, 2026
@codeant-ai

codeant-ai Bot commented Feb 22, 2026

Copy link
Copy Markdown

CodeAnt AI finished reviewing your PR.

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

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants