Files
EscapistsReintroduced/docs/discord-changelog-ci.md
T
2026-11-07 01:05:43 +01:00

5.6 KiB

Discord changelogs through Drone

Active since 2026-10-17: build #1 confirmed delivery, and the user confirmed receipt. Drone is the sole sender. The retired local tools/discord_changelog.py exits without sending, including when invoked with its old arguments.

.drone.yml runs a Docker pipeline for pushes to main. It tests the notifier, then reads CHANGELOG.md from the pushed commit. Discord receives only the newest entry's heading and body, plus the last recorded published Workshop version when available, with mentions disabled and no build, Git or hosting status added.

One-time setup

  1. Connect Drone to Gitea and activate this repository in Drone. A Docker runner must be available. Keep the configuration filename at .drone.yml.
  2. In this repository's Drone settings → Secrets, add discord_webhook_url. Use the existing webhook URL stored locally in .local/discord-webhook.url. Do not put the URL in Git or enable the secret for pull requests.
  3. Push these files to main, then verify the notify-discord step and its corresponding Discord message. Creating the YAML alone does not activate Drone or install its Gitea webhook.
  4. Keep local/manual notification sending disabled. Do not add a second sender or automatically fall back to local delivery after a failed Drone build.

Drone's repository activation manages the Gitea event webhook. This notification pipeline does not compile, publish or update the mission.

Updating the changelog

Prepend a new level-two heading and player-facing bullets for each update:

## 2026-10-18 — Checkpoint improvements

- Improved checkpoint cover and approach barriers.
- Added a small rest tent and inspection table.

Keep headings unique, newest first, with no empty placeholder section at the top. Use a distinct title for multiple updates on the same date. Entries are plain Markdown prose/lists; level-three headings are supported. Do not use level-two headings inside code examples within an entry. Keep the formatted newest entry within Discord's 2000-character limit; oversized entries fail without truncation. The dated files in publishing/ remain separate Workshop release notes.

Before preparing every push, synchronize the last published version automatically:

python3 tools/workshop_changelog.py --sync --native-compat .local/rhs-19-work/compat

This workstation uses the game's live public Workshop catalogue because the web listing can lag behind publication. The helper uses the existing disposable Proton prefix under .local, takes its test-run lock, opens a temporary muted headless game profile, queries only this addon, and closes its own processes. It neither downloads addons nor uploads or changes Workshop content. The query is bounded to 60 seconds and refuses a busy prefix.

On a machine without that native setup, --sync alone reads the official Workshop page. It checks the addon ID and the current version's published and approved flags. Neither route overwrites a newer recorded publication with an older response. Lookup/validation failure leaves the changelog unchanged and returns failure; obtain fresh publication evidence before pushing.

--published remains available immediately after an observed successful Workbench upload. It records the matching local publishing manifest's version; without either flag the helper only displays the bundled version. Bundling alone is never publication confirmation.

Commit the synchronized preamble with the requested changes. Updating only that version does not resend the previous entry. Drone labels it as the last published version because a Git push can contain changes newer than the Workshop upload.

The notifier compares DRONE_COMMIT_BEFORE with DRONE_COMMIT_SHA, covering the whole push, even when a documentation commit follows the changelog commit. Unchanged newest entries, historical edits and removing an entry to expose an older one do not post. Editing the current newest entry posts its revised text. If a push adds several entries, only the newest is posted. Combine their notes in one top entry when all changes should appear in the announcement.

The first push introducing CHANGELOG.md posts its newest entry. It does not backfill older release notes. Missing Git history fails instead of guessing a previous revision; an exact-SHA fetch is attempted for a missing before commit.

Verification and delivery failures

Run python3 -m unittest discover -s tests -p test_discord_changelog_ci.py locally. Also run python3 -m unittest discover -s tests -p test_workshop_changelog.py for the Workbench version sync. The tests use temporary Git repositories and mocked HTTP; they send no messages. python3 tools/discord_changelog_ci.py --dry-run inside a Drone checkout with its normal commit environment prints the selected message without using the secret.

Delivery uses wait=true and requires Discord's message confirmation. Errors fail the step without printing the webhook URL. There are no automatic HTTP retries. Inspect Discord before manually rebuilding a delivery step: a timed-out request may already have arrived. Drone workspaces are ephemeral, so rerunning the same push is not deduplicated across builds; exactly-once delivery is not claimed.

References: Drone push triggers, repository secrets, push before commit, Discord webhooks.