Repository navigation
Conversation
Duplicate-user recovery raised TypeError exactly when it ran: pymongo's aggregate is async and the cursor was iterated directly. Two tests cover it, both failing before the fix. tgcrypto has no wheel past cp311, so every install needed a compiler. tgcrypto-pyrofork ships cp313/cp314 wheels. uvloop's pin predated its own. Cleared five lint findings and the dead requested_action parameter.
Root, gcc, git and libssl-dev existed for one package. Every dependency has a wheel now, so the image drops from 977 MB to 287 MB and runs as uid 10001. COPY . . was baking config.env and a 115 MB .venv into images built from a deployment tree. The new .dockerignore excludes them, with a test: a pattern that looks right and silently misses the file is worse than no pattern. update.py reports a deployment that cannot self-update as not applicable rather than an error, so a container without git boots clean.
dockerize.yml pushed thunder:latest on every push to main with no dependency on the test job, so a red main shipped an image. One workflow now: the image is built, smoke-tested, then published. Fork PRs never see the Docker Hub secret. Suite runs on Linux and Windows at 3.13 plus 3.14, and weekly against fresh dependencies, since requirements.txt floats on purpose. Actions pinned to SHAs. pytest.ini becomes pyproject.toml. New tests cover plugin handler registration, the platform-only deployment files, and the workflow's own invariants. Also fixed /restart, which exec'd a hardcoded /bin/bash and crashed on Windows, and four ways update.py could lose a user's work or their config.env.
Applying an update replaced the repository: git init, a throwaway commit, fetch, reset. The user's branches, stashes and remotes went with it. It now fetches and resets in place, so nothing of theirs changes and rollback only has to restore the tree. Dependencies could not install in an environment created by `uv venv`, which has no pip, so an update reported success with new requirements missing. It tries pip then uv, and says what to do when neither works. Test sandboxes copied a virtualenv 24 times a run; excluding it takes the suite from minutes to seconds.
The comment cited git pack files, which cannot reach this helper any more: _snapshot() copies the tree with .git excluded, so the rollback directory holds no git objects. The retry still earns its place, just for a different file. Measured: a read-only file inside a copied tree makes rmtree raise PermissionError and leave the directory behind; with the chmod retry it is removed. copytree preserves the read-only bit, and the user's own tree can hold such a file, so the helper is still load-bearing on Windows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four changes, each one commit, each independently testable.
1.
fix:— a crash in the duplicate-user recovery path.pymongo'saggregatereturns a coroutine and the code iterated it directly, so therecovery raised
TypeErrorexactly when it was needed. Also swapstgcrypto→tgcrypto-pyrofork(the old name has no wheel past cp311, which isthe only reason the image needed a C toolchain) and unpins a stale
uvloop.2.
build:— the image. No root, no gcc, no git: every dependency has awheel, so 977 MB → 287 MB at uid 10001. The
.dockerignoreis the part thatmatters —
COPY . .was bakingconfig.envand a 115 MB.venvinto imagesbuilt from a deployment tree. It has a test, because a pattern that looks right
and silently misses the file is worse than none.
3.
ci:— the workflows.dockerize.ymlpublishedthunder:latestonevery push to main with no dependency on the test job, so a red main shipped an
image. Now one workflow: build, smoke-test, then publish. Fork PRs never see the
secret. Suite runs on Linux and Windows at 3.13 plus 3.14, weekly against fresh
dependencies since
requirements.txtfloats on purpose. Also fixes/restart(hardcoded
/bin/bash, crashed on Windows) and four waysupdate.pycould losea user's work or their
config.env.4.
build:— self-update. It replaced the repository to apply an update(
git init, throwaway commit, fetch, reset), taking the user's branches, stashesand remotes with it. It now fetches and resets in place. Dependencies could not
install in an environment made by
uv venv(no pip), so an update reportedsuccess with new requirements missing; it now tries pip then uv.
Verification
pyproject.tomlactionlintclean, validates against the published schemaThe tree is byte-identical to the
chore/hardening-phase-*branches this wassquashed from.
Not verified
mainhas never run this workflow, and the publish path has never executed — itneeds
DOCKER_TOKEN, which is now set. The first push tomainwill be thefirst real publish, so merging this is the point at which that gets exercised.