Skip to content

Some pipeline improvements - #104

Merged
colinjlacy merged 1 commit into
runtimeconditions:mainfrom
itvi-1234:duplicate-safe-publish
Dec 2, 2026
Merged

colinjlacy merged 1 commit into
runtimeconditions:mainfrom
itvi-1234:duplicate-safe-publish

Conversation

@itvi-1234

Copy link
Copy Markdown
Member

What this changes

Soon, publishing will run by itself after bindings are generated on main. Then two publish runs can start close together, and over time there will be many more packages. This PR gets the publish workflows ready for that.

1. Running publish twice is now safe

Sometimes a registry has received a new version but does not show it yet. If a second run starts in that moment, it tries to upload the same version again, and the registry refuses it. Now:

  • PyPI: files PyPI already has are skipped (skip-existing).
  • npm: if npm refuses a version, the script asks npm again. If the version is there, it is skipped.
  • Maven Central: if the Portal refuses an upload, the script asks Maven Central again. If the version is there, it is skipped. If not, the error says another run may still be publishing it, with a link to the Portal's deployments page. (The Portal has no public way to look up a version by name, so this case can't be checked.)

2. Only new versions are built

Before, the registry workflows got all packages, so a release of one package built every package. Now preflight sends each registry only the versions it does not have yet.

An empty package list is never sent, because the registry workflows read an empty list as "every package".

3. Registry lookups run in parallel

  • Each registry is asked 16 lookups at a time, and all registries at the same time.
  • If a registry says "too many requests" (429), has a server error (5xx), or the network fails, those lookups are tried again 8 at a time, then one by one, with a short pause before each try.
  • Go versions now come from one list of tags, instead of one call per package.
  • The pull request card uses the same lookups.

A preflight of all packages in all languages took about 5 seconds against the real registries.

…ok up registries in parallel

Publishing is about to run after every generation on main, so two runs close
together and many packages have to work.

Repeated publishing: a run started soon after another can build a version that
the registry has just received but does not list yet. PyPI now skips a file it
already has (skip-existing). When npm refuses a publish or a first-release
stage, the script asks npm again and skips the package if the version is
there. When the Central Portal refuses an upload, the script asks Maven
Central again and skips it if the version is there; otherwise it says the
upload may still be publishing from another run and points to the Portal's
deployments, since the Portal has no documented lookup by coordinates.

Only missing versions: preflight now passes each registry's workflow only the
versions that registry does not have, instead of all, so a release of one
package no longer builds every package. An empty or malformed targets list is
never sent, because an empty input means every package to those workflows.

Parallel lookups: registries are asked side by side, 16 lookups at a time per
registry. Lookups a registry throttles (429, 5xx) or that fail on the network
are tried again 8 at a time, then one by one, with a pause before each round.
Go versions come from one tag listing instead of one git ls-remote per
package. The pull request card uses the same lookups. A preflight of every
package in every language took 5 seconds against the live registries.

@colinjlacy colinjlacy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good additions. Nicely done.

@colinjlacy
colinjlacy merged commit c139d12 into runtimeconditions:main Dec 2, 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.

2 participants