Skip to content

feat: auto-update Data:LatestUpdate.json on new updates - #466

Open
MonsterDomosed wants to merge 1 commit into
developfrom
feature/auto-update-latest-update-json
Open

MonsterDomosed wants to merge 1 commit into
developfrom
feature/auto-update-latest-update-json

Conversation

@MonsterDomosed

@MonsterDomosed MonsterDomosed commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Updates Data:LatestUpdate.json on the wiki with the date of the newest update changelog whenever the wiki uploader runs, so the wiki's "Latest update" excerpt (Module:LatestUpdate) stays current without manual edits.

Previously this page was maintained by hand, and every run logged Missing file map for data page "LatestUpdate.json".

Details

  • New WikiUpload._update_latest_update_page() runs at the end of run(), alongside the other changelog-derived wiki mutations.
  • The date is derived from the generated changelogs/wiki/*.txt files, reusing changelog_utils.sort_changelog_files / parse_changelog_date_from_id (the same helpers _update_latest_chain uses).
  • Content format matches the existing Module:LatestUpdate schema:
    {
        "latest_update": {
            "month": "October",
            "day": 16,
            "year": 2026
        }
    }
  • Idempotent and safe:
    • skips when the page already matches the latest date (no revision noise)
    • never moves the date backward — logs a warning and skips if the wiki holds a newer date
    • overwrites unparsable content with a warning
    • no-ops when no changelogs exist, and respects --dry_run
  • _update_data_pages now skips this page with a trace log instead of the "Missing file map" warning, since it is handled separately.

Testing

  • No test suite exists in the repo; validated with a local harness that fakes the mwclient site: 16 scenarios passing — new update advances the page, same date is idempotent, never moves backward, page creation, garbage content, hotfix variant files (-1 suffix) with same/new date, dry-run, data-page loop skip, and full run() integration.
  • ruff check . and ruff format --check . pass.

Parsed data in deadlock-data PR - Reopen deadbot PR or run deploy workflow for this branch here to reparse the data

Updates Data:LatestUpdate.json on the wiki with the date of the newest update changelog whenever the wiki uploader runs, so the wiki's "Latest update" excerpt stays current without manual edits.

The date is derived from the generated changelogs/wiki/*.txt files, reusing the existing changelog date helpers. The page is skipped when it already matches the latest date, and never moved backward if the wiki holds a newer date. It is also excluded from the "Missing file map" warning in _update_data_pages since it is handled separately.

This branch has not been deployed

No deployments
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.

1 participant