Skip to content

Summary of Changes: Discord Webhooks & Commit Tracking

Date: January 14, 2026
Status: ✅ Complete

Overview

Implemented three major improvements to the CI/CD pipeline:

  1. Separate Discord webhooks for commits vs. deployments
  2. Automatic commit tracking & recovery for missed Discord notifications
  3. Updated documentation with setup and troubleshooting guides

1. Separate Discord Webhook Channels

What Changed

Old setup (single webhook):

DISCORD_WEBHOOK_URL → All notifications (commits + deployments)

New setup (separated):

DISCORD_WEBHOOK_COMMITS     → #commits (all code pushes)
DISCORD_WEBHOOK_DEV_DEPLOY  → #deployments (dev.ourlantern.app)
DISCORD_WEBHOOK_PROD_DEPLOY → #deployments (ourlantern.app)

Benefits

  • ✅ Less noise in deployment channel (only successes/failures shown)
  • ✅ Audit trail of all commits in separate channel
  • ✅ Easier to track what's deployed vs. what's committed
  • ✅ Can mute one channel without missing important alerts

Files Modified

GitHub Secrets to Add

  1. Go to Settings → Secrets and variables → Actions
  2. Add these secrets (copy webhook URLs from Discord):
    • DISCORD_WEBHOOK_COMMITS
    • DISCORD_WEBHOOK_DEV_DEPLOY
    • DISCORD_WEBHOOK_PROD_DEPLOY
  3. Delete the old DISCORD_WEBHOOK_URL secret (deprecated)

2. Automatic Commit Tracking & Missed Notification Recovery

The Problem (Solved)

If Discord API was down or webhook was invalid:

  • ❌ Commit notification failed to post
  • ❌ Next push only showed new commits, not the failed one
  • ❌ Commit history became incomplete in Discord

The Solution

New automatic recovery system:

  1. Each successful Discord notification is recorded in .github/.discord-posted-commits
  2. Before posting new commits, the workflow checks for missed ones
  3. If missed commits are found, they're automatically included in next notification
  4. Notification includes note: "⚠️ Note: Includes N previously missed commit(s)"

Example scenario:

Commit A (notification fails) → Recorded as failed
Commit B (notification succeeds) → Pushed, includes A + B with note
User sees both A and B in Discord ✅

How It Works

Workflow:

  1. Checkout code with 50-commit history
  2. Check for previously missed Discord notifications - compare against posted list
  3. Prepare commit messages - include any missed commits
  4. Send Discord notification - includes missed + new commits
  5. Track posted commits - record successful posts to .github/.discord-posted-commits
  6. Upload posted commits log - save to artifacts for verification

Files Modified

Testing the Recovery

  1. Create two commits: A and B
  2. Push commit A (notification fails - simulate by breaking webhook URL)
  3. Revert webhook URL
  4. Push commit B
  5. Check Discord - should see both A and B with note about missed commit

3. Documentation Updates

New Documentation

docs/engineering/deployment/DISCORD_WEBHOOK_SETUP.md

  • Complete guide to creating Discord webhooks
  • Step-by-step setup instructions
  • Troubleshooting section
  • Testing webhook URLs manually

Updated Documentation

docs/engineering/deployment/CICD_GUIDE.md

  • Updated Discord Notification workflow description
  • Added missed commit recovery explanation
  • Updated troubleshooting section with new webhook names
  • Link to DISCORD_WEBHOOK_SETUP.md

docs/engineering/deployment/BRANCH_PROTECTION_SETUP.md

  • Updated secrets list to use new webhook names
  • Link to DISCORD_WEBHOOK_SETUP.md

Next Steps (For You)

1. Create Discord Webhooks

  1. Go to your Discord server
  2. Create/use #commits and #deployments channels
  3. For each channel:
    • Settings → Integrations → Webhooks
    • New Webhook
    • Copy URL
    • Save to GitHub secrets

2. Add GitHub Secrets

  1. Go to repo Settings → Secrets and variables → Actions
  2. Add:
    • DISCORD_WEBHOOK_COMMITS (from #commits webhook)
    • DISCORD_WEBHOOK_DEV_DEPLOY (from #deployments webhook)
    • DISCORD_WEBHOOK_PROD_DEPLOY (from #deployments webhook, can be same as dev)
  3. Delete old DISCORD_WEBHOOK_URL when confirmed working

3. Test the Setup

  1. Push a test commit to dev branch
  2. Check:
    • #commits channel shows commit notification ✅
    • Next push to dev shows deployment notification in #deployments ✅
  3. Test missed commit recovery:
    • Temporarily break webhook URL
    • Push a commit (fails)
    • Fix webhook URL
    • Push another commit (should show both)

4. Update Documentation (Team)

  • [ ] Document which channels are used for what
  • [ ] Document who has access to what channels
  • [ ] Add channel-specific notification rules if needed

Answers to Your Original Questions

1. Environment Variables & Secrets

Answered: Each secret is added individually (e.g., VITE_FIREBASE_API_KEY_DEV). Values are copied from platform-specific dashboards (Cloudflare, Firebase, Discord) into GitHub Actions secrets.

2. CODECOV_TOKEN

Answered: Optional code coverage reporting service. Currently non-blocking in your CI. Can skip or implement later.

3. Discord Channels

Implemented: Created separate webhooks for #commits and #deployments with setup guide.

4. Commit History on Failed Deployments

Implemented: Automatic tracking and retry system for missed Discord notifications. Next push automatically includes previous failed commits.


Files Changed Summary

Modified:
  .github/workflows/discord-notify.yml      ← Added tracking & recovery
  .github/workflows/deploy-dev.yml          ← New webhook name
  .github/workflows/deploy-prod.yml         ← New webhook name
  .gitignore                                ← Ignore tracking file
  docs/engineering/deployment/CICD_GUIDE.md
  docs/engineering/deployment/BRANCH_PROTECTION_SETUP.md

Created:
  docs/engineering/deployment/DISCORD_WEBHOOK_SETUP.md ← New setup guide

See Also

Built with VitePress