Skip to content

feat: one Discord forum post per mod, each release posted in its mod's post - #100

Merged
vdmkenny merged 4 commits into
OpenReliant:mainfrom
zabka14:feat/mod-forum-posts
Dec 4, 2026
Merged

vdmkenny merged 4 commits into
OpenReliant:mainfrom
zabka14:feat/mod-forum-posts

Conversation

@zabka14

@zabka14 zabka14 commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Each mod gets its own post in the Discord forum channel #mod-discussions, so its releases and the talk about it stay in one place.

How it works

  • A mod's first release opens a post named after the mod, with its description and links to its page and release notes. The post gets the forum tag of the mod's folder of mods/ (Ships, Gameplay, Sound…), or Other, with a warning, for a folder that has no tag yet. The tags' IDs are in TAGS in release.py.
  • Its later releases are posted in that post, with their list of changes.
  • The post's ID is kept as <!-- discord-thread: ID --> at the end of the release's notes. GitHub doesn't show it, and the site only reads the - lines under ## Changes. It's looked for in all of the mod's releases, so editing one release's notes by hand doesn't lose the post.
  • If the post was deleted on Discord (Unknown Channel), a new one is opened.
  • On every run, a mod whose newest published release isn't in its post yet is posted. So the mods already released get their posts on the first push after the secret is set, and a release posted while Discord was down is caught up on the next push.
  • Nothing changes for mod authors, nor for DISCORD_MOD_RELEASES_WEBHOOK and #mod-releases.
  • Without DISCORD_MOD_FORUM_WEBHOOK, the forum part is skipped.

Needs

An admin must add the forum channel's webhook URL as the repository secret DISCORD_MOD_FORUM_WEBHOOK. I'll send it in a DM.

Tested

On a private test repository and a test forum channel, through GitHub Actions and then with this branch's code:

  • first releases of two mods open two posts;
  • a later release goes in the mod's post;
  • with the ID erased from the newest release's notes, the post is found in an older release;
  • with a wrong ID, a new post is opened;
  • a mod released before the forum gets its post, and a second run posts nothing again;
  • a release made in the same run is posted at once, though GitHub's list of releases doesn't show it yet.

Not tested: posting in a post Discord archived for inactivity, and the tags, since their IDs only exist in #mod-discussions (each current mod was checked to map to its folder's tag).

@zabka14
zabka14 requested a review from vdmkenny as a code owner December 2, 2026 21:27
…s post

A mod's first release opens a post named after it in the forum behind
DISCORD_MOD_FORUM_WEBHOOK, and its later releases go in that post. The post's
ID is kept in a hidden comment at the end of the release's notes. A mod whose
newest release isn't in its post yet is posted on the next run, so the mods
released before the secret was set get their posts on the first push after.
A mod in a folder with no tag of its own is tagged Other, with a warning.
@zabka14
zabka14 force-pushed the feat/mod-forum-posts branch from 937b2f7 to 9c9d8e4 Compare December 3, 2026 17:49

@vdmkenny vdmkenny left a comment

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.

An LLM wrote this review. I directed it, read it and approved it.

Thanks, this works well: I ran it against the published releases with Discord stubbed out, and every mod gets one post with the right tag.

One thing to fix: in to_forum the content is cut to 1900 characters and the links are added after that. The links line is up to 185 characters for the current mods, so a long change list goes over Discord's limit of 2000 and gets a 400 on every run. Cutting to 2000 - len(links) - 1 fixes it, in both places.

Also, json.load(response) in send can raise on a dropped connection. That fails the release job and skips the site rebuild. Catching OSError and ValueError there and returning 0, {} keeps the site safe.

I'll check the tag IDs and add the secret on my side.

@vdmkenny vdmkenny left a comment

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.

Both points are fixed and I checked them with Discord stubbed out. Thanks!

@vdmkenny
vdmkenny merged commit 855fc55 into OpenReliant:main Dec 4, 2026
1 check 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