Skip to content

Move to cookie-pyrate - #3

Merged
gvieralopez merged 7 commits into
mainfrom
pyrate-migration
Oct 27, 2026
Merged

gvieralopez merged 7 commits into
mainfrom
pyrate-migration

Conversation

@gvieralopez

Copy link
Copy Markdown
Owner

Moves SC2Helperbot onto cookie-pyrate v1.0.3, on Python 3.14. One commit per step:

  1. Move to cookie-pyrate. Minted with Docker on and no docs site. The package moves to src/sc2bot, and Poetry is replaced by uv. Everyone with commits is an author, including @sildel. The README follows the template layout.
  2. Apply automatic fixes. ruff format and the safe ruff check fixes only.
  3. Port the bot to aiogram 3. aiogram 2 doesn't run on 3.14. The sc2bot command now runs main() with a router. The handlers and the daily post have tests. The daily fetch no longer runs in a worker thread, because the database session can't cross threads.
  4. Move to SQLAlchemy 2 with typed models.
  5. Fix remaining QA findings.
    • Command targets take keyword-only Telegram fields.
    • The API clients have request timeouts.
    • The sc2ladder query had lost the #1234 part of the Battle Tag because it went in the URL. It's now sent as a parameter.
    • Users and player profiles have unique constraints.
    • Code, tests and scripts are fully typed, and tests and scripts close their database connections.
  6. Find a Battle Tag's profiles on SC2 Pulse. sc2ladder.com no longer exists, so /register found no profiles. It now uses SC2 Pulse's character search, which returns every profile of the account. Profiles on another realm than REALM_ID are skipped. SC2 Pulse is credited in the README.
  7. Publish the Docker image on release. Turned on with the template's publish-docker-image option. The image is published as ghcr.io/gvieralopez/sc2helperbot.

make qa passes (85 tests, 95.7% coverage), including from a fresh clone. The image builds locally and the bot starts in it.

After merge:

  • run make repo (release key, ruleset, Dependabot)
  • make the GHCR package public
  • deploy on the homelab

🤖 Generated with Claude Code

Minted from cookie-pyrate v1.0.3 (Python 3.14, Docker, no docs site). The package moves to src/sc2bot, Poetry to uv, and every person with commits is an author.
ruff format and the safe ruff check fixes only.
aiogram 2 doesn't run on Python 3.14. The entry point becomes main() (the sc2bot command) with a router, and the handler and the daily post get tests. The daily fetch no longer runs in a worker thread: the database session belongs to the loop's thread, so it failed there.
Mapped columns replace the sqlalchemy-stubs plugin, which doesn't work with current mypy, so the type: ignore workarounds go. MetaData binding and autocommit sessions are gone in 2.x.
The template's ruff and mypy settings are stricter than the old ones. /help no longer shadows a builtin, command targets take keyword-only Telegram fields, and the API clients get request timeouts and typed JSON. The sc2ladder query goes in the request params: in the URL, "#1234" was dropped as a fragment. Users and player profiles get unique constraints. Tests and scripts are fully annotated and close their database connections.
sc2ladder.com is gone, so /register found no profiles. SC2 Pulse's character search returns every profile of the Battle Tag's account (sc2ladder only knew some of them). Profiles on another realm are skipped, since the daily fetch only asks Blizzard for REALM_ID. SC2 Pulse is credited in the README.
Each release pushes ghcr.io/gvieralopez/sc2helperbot, tagged with the version and latest, through the template's publish-docker-image input.
@gvieralopez
gvieralopez merged commit 0ca1053 into main Oct 27, 2026
4 checks 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.

1 participant