fix(owners): stop a stale posthog_owners copy from breaking images - #5
Draft
evanmarshall wants to merge 1 commit into
Draft
evanmarshall wants to merge 1 commit into
evanmarshall wants to merge 1 commit into
Conversation
posthog-owners installs with `uv sync --no-editable`, which builds a wheel and caches it in the persistent uv cache mount. The package keeps one static version, so a later build reuses that first wheel even into a new venv. Any new export is then missing from the baked copy, and `posthog/urls.py` imports the chain unconditionally, so Django system checks fail and nothing in the image starts. Add `--reinstall-package posthog-owners` to both image builds. uv rebuilds the wheel from the bind mount every build, so the baked copy always matches the checkout without anyone remembering to bump a version. Generated-By: PostHog Desktop Task-Id: cc020ff8-2a32-48f3-adfb-66b6dd4e8d72
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.
This is an Ito QA mirror of PostHog#93572.
Original author: @PostHog[bot]
Pinned upstream head: 993391b
This draft is for QA and build-environment experimentation and will not be merged.
Problem
posthog_ownerscopy than their checkout loses every request and management command in that container, not only the feature that added a symbol.posthog/urls.pyimports the chain unconditionally (urls, rest_router,load_product_modules, product routes, the owners resolver), so one missing export fails Django system checks and nothing starts.uv sync --no-editable, which builds a wheel and stores it in the persistent uv cache mount.tools/owners/pyproject.tomlkeeps one static version,0.1.0. uv keys the cached wheel on that version, so a later build reuses the first wheel it ever built.Changes
posthog_ownersnow reaches the image on the next build, so the container starts instead of failing every entrypoint.--reinstall-package posthog-owners, which implies--refresh-package. uv rebuilds the wheel from the bind mount every build.posthog-ownersneeds it.hogliis the other workspace member installed from a bind mount, but it sits in thedevgroup and both builds pass--no-dev.uv syncline.Note
Rebuilding one small pure-Python wheel per build. Every other package still reads from the cache.
How did you test this code?
No new automated tests: the change is two build flags, and no suite covers Dockerfile content.
Neither image was built. Building a full PostHog image is out of reach in this sandbox, so the cache behavior was reproduced in a minimal uv workspace instead, matching the real setup (a local path member, one static version,
--no-editable, a shared cache directory).Reproduction results
--reinstall-package--reinstall-packageThe fourth row is the image case: a build starts from an empty venv, and the cache mount alone is enough to serve a stale copy.
The real
uv syncline was also run against this repository's lockfile with--dry-run, and it resolves.Automatic notifications
Docs update
None. The change is internal to the image builds.
🤖 Agent context
Autonomy: Fully autonomous
Written by Claude Code (Opus) from a PostHog self-driving inbox report. Skills invoked:
/writing-pr-descriptions,/writing-simplified-technical-english.The report named the version pin as the cause and a version bump as the fix. The pin is a real cause, and the reproduction above confirms it. The bump was rejected as the fix because it holds only while every future author remembers it. Forcing the reinstall removes the class of failure.
A build-time assertion comparing the baked copy against the checkout was also considered and dropped. It turns a silent runtime failure into a build failure, but the reinstall makes the mismatch impossible, so the assertion would only add a way to hard-block CI with no path forward except busting a cache.
Nothing in this diff or description carries material from the agent session. The two symbol names are in this repository's git history, and the reproduction workspace is invented.
Created with PostHog Desktop from this inbox report.