Request icon
Script icon
Process icon
OutputValues icon
If icon
Fail icon
Log icon
Webhook icon

Gate Python upgrades on published PyPI wheel coverage

Check PyPI wheel coverage across deployment targets, save matching filenames and SHA256 metadata, and block upgrades with missing wheels.

Categories
Infrastructure

A Python upgrade can unexpectedly start compiling from source when a release lacks a wheel for one deployment platform. Check published artifacts against an explicit tag matrix before promoting that release. This flow reads metadata only and never installs a package.

How it works

  1. GitHub sends an opened, reopened, or synchronize pull-request event to the secret-protected Kestra webhook. Manual runs remain available for initial validation.
  2. Fetch that exact release from PyPI's JSON API. HTTP and metadata errors fail the run.
  3. A Node task expands compressed filename tags and matches any accepted tag for each target. Yanked wheels and wheels without SHA256 metadata cannot satisfy a target; source archives never count.
  4. Save the JSON report and expose its URI before an If task fails the execution whenever coverage is BLOCK, preventing downstream upgrade tasks from running.

What you get

  • A PASS/BLOCK verdict, missing targets, matching filenames, and published SHA256 metadata.
  • outputs.assess_coverage.outputFiles['wheel-coverage.json'] for inspection or downstream gates.
  • Tags alone do not verify Requires-Python, dependencies, binary compatibility, or artifact integrity. SHA256 values come from metadata.

Who it's for

  • Release engineers and Python platform teams deploying to multiple operating systems or CPU architectures.

Why orchestrate this with Kestra

  • Keep the release pin, target matrix, HTTP response, verdict, and report in one execution. A failed gate prevents subsequent upgrade tasks from running.

Prerequisites

  • Kestra 2.0, the Node Script plugin, Node.js 22+ on the worker PATH, and outbound HTTPS access to pypi.org. The Process runner needs no Docker or npm packages. Set worker_os to WINDOWS on Windows workers; the default uses a Linux shell.
  • Supply 1–32 named targets, each with 1–256 acceptable tags. Use the tags your installer supports, including relevant abi3 or universal tags; this flow does not infer compatibility. Use PyPI's canonical version string.

Secrets

  • PYPI_UPGRADE_WEBHOOK_KEY: a random key used in the Kestra webhook URL. Only public PyPI release metadata is read.

Quick start

  1. Import the flow, create the PYPI_UPGRADE_WEBHOOK_KEY secret, and select the worker OS. Defaults check requests 2.32.5 with a universal wheel accepted for two targets.
  2. Execute manually and open wheel-coverage.json. Remove py3-none-any from one default target to exercise BLOCK and the failure gate.
  3. Replace the example release and target tags with your deployment policy, then configure a GitHub repository webhook for pull request events using the URL from Kestra's Triggers tab.

How to extend

  • Call this as a subflow before promotion, or add notifications using the saved report. Add a separate installer dry run to verify Requires-Python and dependency resolution.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.