Scripts: mirror the testing feed into Discord from GitHub Actions #3485
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3485"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by Foniass on 2026-11-30T01:17:45Z.
Moves the Discord posts of the testing queue (#nvidia-prs, #amd-prs, #any-prs, #ready-to-merge) from a bot on my PC into this repo's Actions, so they keep working without it. Same posts as before.
What is in it
scripts/discord_mirror.py: one pass that keeps one Discord post per PR and channel in step withqueue.json(post / edit / delete), through one webhook per channel. Standard library only, read-only on GitHub except for its own state branch..github/workflows/discord-mirror.yml: runs it after each successfulTesting feedrun, when a PR is closed (its posts go at once), and every 10 min as a fallback. Which Discord message is which post is kept on adiscord-mirror-statebranch (a webhook cannot list a channel). No PR code is checked out; no event text reaches a shell.scripts/test_discord_mirror.py: unit tests against a fake Discord.Setup (maintainer, once)
DISCORD_WEBHOOK_NVIDIA_PRS,DISCORD_WEBHOOK_AMD_PRS,DISCORD_WEBHOOK_ANY_PRS,DISCORD_WEBHOOK_READY_TO_MERGE. The names must be exactly these.That's all: the next run starts posting (20 a run, the channels are full after about 20 min). My bot sees that, deletes its own posts and removes itself; until then some posts show twice. Please don't delete the
discord-mirror-statebranch: it keeps which message is which post.Stop: disable the workflow (posts stay up), or first run it with action
remove-all.Tested
python -m unittest scripts/test_discord_mirror.py: 11 passed;scripts/test_triage_pr.pystill passes.queue.jsonontesting-feedthrough the script against a fake Discord: the 91,679 posts are identical to the old bot's and within Discord's size limits; with 5–15 % of Discord calls failing (5xx, 429, dropped connections) and runs killed partway, no duplicate and no lost post, and Discord ended up matching the last feed.actionlint1.7.12 withshellcheck0.11.0: clean.Regression run
Not needed: scripts and CI only.
Not tested
discord-mirror-statewithGITHUB_TOKEN). The workflow does nothing until the secrets exist, and its first push is made before anything is posted.cargo test: not built; no Rust is changed. (Build and test (Windows, no GPU)fails onhle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, as it does onmainat this PR's base.)AI use
🤖 Generated with Claude Code