feat: migrate changelog fetching from Deadlock forums to Steam API#401
Conversation
… subheaders, and hotfix preservation
… ability subheaders, and hotfix preservation" This reverts commit b7dd29c.
Reverts the 3 commits since 26fe3d9: - b1994dc feat: exclude Hero Lab entries from reprocessing - 9b8de0e TEST: Delete existing notes - 7f2e144 feat: enhance changelog processing with pending ID support Preserves the DRY_RUN env var forwarding fix in docker-compose.yml, which fixes a pre-existing bug where the variable was set by the CI workflow but silently dropped at the container boundary.
6363402 to
e20047a
Compare
hassayag
left a comment
There was a problem hiding this comment.
Sorry I haven't gotten to this sooner. Great to see this has worked nicely. Main thing I am concerned with is getting rid of any old code that was designed specifically for the old RSS feed
| is_steam_link = ( | ||
| 'store.steampowered.com/news/' in source_link | ||
| or 'steamstore-a.akamaihd.net/news/' in source_link | ||
| or 'steamcommunity.com/app/' in source_link | ||
| ) |
There was a problem hiding this comment.
Is there any circumstance that the link would not be steam if we are pointing to the steam rss feed?
There was a problem hiding this comment.
Any changelog before 2026-06-04 used the old forum links. But to keep things clean, I just made the parser skip generating wikitext for anything before that migration date entirely.
| 'is_hero_lab': False, | ||
| 'title': e.get('title'), | ||
| 'steam_hash': e['steam_hash'], | ||
| 'was_edited': True, |
There was a problem hiding this comment.
Interested to know how we would handle edited updates. Would it function with our current hotfix system?
There was a problem hiding this comment.
I removed the manual was_edited flag entirely. Now, if Valve edits a post, the bot detects the hash change and silently updates the local .txt file. To prevent false hotfixes when overwriting, I set it so the newly fetched text is treated as the "old text" for comparison. The hotfix system still runs fine, and the wiki stays safe because the uploader skips overwriting the main page (while still appending genuinely new hotfix sections via the separate appender).
| final_text += f'\n\n=== Patch {patch_num} ===\n\n{entry_text}' | ||
| logger.debug(f'Adding Patch {patch_num} to {date_key}') | ||
|
|
||
| # Detect hotfixes - compare new patches against old content |
There was a problem hiding this comment.
Please be observant what your AI is spitting out, they often strip comments
There was a problem hiding this comment.
Fixed, will check it better in the future.
| link = existing_config.get('link') | ||
| title = existing_config.get('title') | ||
| steam_hash = existing_config.get('steam_hash') | ||
| elif append_entries: |
There was a problem hiding this comment.
Correct me if I'm wrong as I'm not that familiar with the changelog side
Is append_entries a remnant of the old forums, which had a main forum post with additional updates added as comments? If so, have you seen a similar thing with their use of steam news?
There was a problem hiding this comment.
It was originally for forum comments. But we still need it for Steam in case Valve posts multiple patch notes on the same day. Since the wiki only has one page per date, we still use append_entries to merge them under === Patch N === headers.
| source_id = main_entry['version'] | ||
| link = main_entry['link'] | ||
| title = main_entry.get('title') | ||
| steam_hash = main_entry.get('steam_hash') | ||
| elif existing_config: | ||
| source_id = existing_config.get('source_id') | ||
| link = existing_config.get('link') | ||
| title = existing_config.get('title') | ||
| steam_hash = existing_config.get('steam_hash') | ||
| elif append_entries: | ||
| source_id = append_entries[0]['version'] | ||
| link = append_entries[0]['link'] | ||
| title = append_entries[0].get('title') | ||
| steam_hash = append_entries[0].get('steam_hash') |
There was a problem hiding this comment.
(if possible,) I would try to make use an object like {source_id, link, title, steam_hash}, although you would have to deal with the version vs source_id issue
There was a problem hiding this comment.
I collapsed that whole block down by determining the source dict first: source_data = main_entry or existing_config or (append_entries[0] if append_entries else {}). It should handle the version vs source_id key discrepancy.
…gex flags, and remove dead code
|
I also wrapped the Steam API parsing in error handling to prevent malformed news items from crashing the changelog run. Also removed some leftover forum and hero lab code. |
|
Other than fixing any other issues you might spot, we'll have to change the output of the wiki patch uploads to match closer to the formatting used there, as it has been changed. |
|
Looks great to me. Make any further changes and set it to ready for review, and I'll give it a final look |
hassayag
left a comment
There was a problem hiding this comment.
Seems good to me, but part of that is pure faith 😂
This reverts commit 9f16142.
Here is the updated PR description in a markdown codeblock, ready to copy and paste:
Changed from using the forums to the Steam API since the devs don't post patch notes on the forums anymore, they moved to Steam posts. Also removed hero labs code.
What changed:
fetch_forum_changelogs()→fetch_steam_changelogs(), reads fromsteam_community_announcementsfiltered topatchnotes-tagged posts_bbcode_to_text()converts Steam BBCode to plain text (paragraphs, lists, links, images, embeds, plus a catch-all for unknown tags)steam_hash) detects when Valve edits a post after publishing. If it changes, the local.txtfile is updated silently, and hotfix detection is adjusted to prevent false positives.STEAM_MIGRATION_DATEcut-off (2026-06-04) keeps all historical forum-sourced data intactforum_id→source_idinchangelog_configs.json;title,steam_hashfields addedfeedparserandbs4dropped frompyproject.toml;tzdataaddedget_gamefile_changelogs()pipeline (~130 lines) parsedcitadel_patch_notes_english.jsoninto_HeroLabentries. Devs haven't used Hero Labs in forever.== Items ==and== Heroes ==sections (with=== Hero/Item ===and==== Ability ====sub-headings) instead of flat bullet points, matching the wiki's Patch Formatter output.hide_generaltoparse_changelogs.pyto suppress the General heading on patches with no unclassified bullets.Unstable RiftandRift Troopertolink_targets.json.Parsed data in deadlock-data PR - Reopen deadbot PR or run deploy workflow for this branch here to reparse the data