Skip to content

Send Discord notifications for rollback failures#36

Open
NDB-7 wants to merge 2 commits intoSCE-Development:mainfrom
NDB-7:feat/rollback-notifications
Open

Send Discord notifications for rollback failures#36
NDB-7 wants to merge 2 commits intoSCE-Development:mainfrom
NDB-7:feat/rollback-notifications

Conversation

@NDB-7
Copy link
Copy Markdown
Collaborator

@NDB-7 NDB-7 commented Mar 30, 2026

For issue #34

Steps to test

  1. Ensure enable_rollback is true in config.yml
  2. On the repo being watched, make a new branch locally but don't push it to the remote repo (this will trigger a Git error)
  3. On that repo, modify docker-compose.yml in a way that makes docker-compose up --build -d trigger an error
  4. Run python server.py
  5. Trigger a webhook event with curl on that repo and local branch:
curl -X POST WEBHOOK_URL \
  -H "Content-Type: application/json" \
  -H "X-GitHub-Event: push" \
  -d '{
    "ref": "refs/heads/BRANCH_NAME",
    "repository": {
      "name": "REPO_NAME"
    }
  }'

After the webhook event, the Git step will trigger an error, initiating a rollback. During the rollback, the Docker step will fail, resulting in a rollback failure.

Here's my config:
image

Logs

Command line output:
image
Discord embed output:
image

Comment thread server.py Outdated
subprocess.run(["docker-compose", "up", "--build", "-d"], cwd=repo_cfg.path, check=True)
return True
except Exception:
logger.warning(f"Rolling back {repo_cfg.name} to {backup_name}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lets keep the try/catch/finally block here because without it there will be uncaught exceptions from the subprocess runs

@NDB-7 NDB-7 force-pushed the feat/rollback-notifications branch from 9a1aab8 to 8ef6d1e Compare March 31, 2026 17:33
@NDB-7 NDB-7 requested a review from adarshm11 March 31, 2026 17:34
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