Skip to content

Mirror from the published packages; make the PyPI upload safe to repeat - #138

Merged
rebrowsernet merged 1 commit into
mainfrom
release/mirror-from-published
Oct 19, 2026
Merged

rebrowsernet merged 1 commit into
mainfrom
release/mirror-from-published

Conversation

@rebrowsernet

Copy link
Copy Markdown
Collaborator

Mirrors are now built from what was actually published, and a release can be re-run without tripping over PyPI.

Mirrors (release/mirror.mjs)

  • npm drop-ins: the "patched" commit is the published rebrowser-* package from the registry (integrity-checked); the "original" commit is the upstream package.
  • Python: the "patched" commit is the exact source tree the published wheels were built from, saved by release.yml as the python-source artifact. Mirroring checks that the run's PyPI publish succeeded and that PyPI lists every wheel.
  • Existing branches are compared tree by tree and never rewritten. A mismatch, or a default branch that can't be moved, is an error.
  • --check changes nothing and fails unless every current version is mirrored and every default branch is the newest version.
  • Python branches leave out upstream's repository tooling (CI, publishing, dependency updates); the "original" commit keeps it.

PyPI (release/pypi-plan.mjs)

  • Our wheels aren't byte-reproducible, so re-uploading a version that is already on PyPI failed with "File already exists". The plan step now compares each wheel's RECORD with PyPI's: it uploads only missing wheels, skips ones with the same contents, and stops if the contents changed under a published version.

Banners and links (ship with the next versions)

  • The README banners say how to install the drop-ins and how to read a mirror branch.
  • The homepage of rebrowser-playwright[-core] and the Python "Release notes" link now point to rebrowser-patches.

Checked against the published v1.1.2

  • mirror.mjs --check: all 5 branches already mirrored and identical, all default branches the newest.
  • pypi-plan.mjs on wheels rebuilt from v1.1.2: 8/8 "same contents", nothing to upload. On wheels built before 57ba953 (driver package.json differs): 8/8 conflicts, exit 1.
  • Unit tests for the helpers: node --test 'release/test/*.test.mjs' (also run in CI).

- mirror.mjs builds each drop-in repo's version branch from what was published: npm packages from the
  registry, Python from the release run's python-source artifact (the tree the wheels were built from).
  Existing branches are compared tree by tree and never rewritten, and a default branch that can't be
  moved is an error. --check verifies that a release is fully mirrored.
- Python mirror branches leave out upstream's repository tooling (CI, publishing, dependency updates).
- pypi-plan.mjs uploads only the wheels PyPI doesn't have: rebuilt wheels with the same RECORD are
  skipped, and changed contents under a published version stop the release.
- build-python.mjs saves python-src.tar, python-orig.tar and the source commit; release.yml uploads them
  as the python-source artifact.
- Banners say how to install the drop-ins and how to read a mirror branch; the Playwright homepage and the
  Python release-notes link point to rebrowser-patches (they ship with the next versions).
- Unit tests for the release helpers, run in CI.
@rebrowsernet
rebrowsernet merged commit c363f86 into main Oct 19, 2026
1 check passed
@rebrowsernet
rebrowsernet deleted the release/mirror-from-published branch October 19, 2026 22:22
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.

2 participants