Introducing a new way to review your PRs.

Read the announcement

reflex-dev / reflex

🕸️ Web apps in pure Python 🐍

View on GitHub

30 documents · Updated Nov 23, 2026

docs / release-engineering

Release engineering

Release engineering turns reviewed change notes into versioned Python packages and matching GitHub releases. The reflex-release tool uses changelog versions as the publish record, coordinates package order and dependency constraints, and keeps upload behind artifact checks and human approval. See Release command lifecycle for command-level detail and Release automation for workflow coordination.

Release model

The release model moves through a small set of states: planned change, changelog version, built artifact, approved upload, and verified release. A Git tag is created only after the package reaches PyPI, so an untagged changelog version remains retryable after a failed build or rejected approval.

Release record

The newest version heading in each package CHANGELOG.md is the source of truth for normal publishing. A package is due when that version has no matching tag. The root package uses the configured tag prefix, while sub-packages include their package name in the tag.

News fragments describe user-facing changes before release preparation. The release tool materializes them into the changelog and can also update dependency floors that cannot appear in published metadata. A floor with no published version that satisfies it holds the package back instead of creating an unusable release.

Source can include directories outside a package's own directory. The extra-source-dirs setting maps those paths to the package they support, so a change there receives the same news-fragment and release treatment as a change in the package's normal source.

The root package requires Python 3.11 or newer and supports Python 3.11 through 3.15. The release tool records support changes in its changelog and uses the same floor in its package metadata.

References: pyproject.toml• L21 pyproject.toml• L51-60 packages/…/pyproject.toml• L1-18 packages/…/CHANGELOG.md• L1-20 packages/…/+extra-source-dirs.feature.md• L1 packages/…/config.py• L195-197 packages/…/config.py• L417-447 packages/…/commands.py• L197-257

Release paths

The release action determines how a version reaches a publishing branch. Final releases use a pull request. Prereleases use a release branch. Internal packages use a separate source-change path and do not need a changelog.

PathRelease signalResult
Final releaseSelected bump or pending news fragmentsChangelog pull request, then publish after merge
PrereleaseNew or continued prerelease actionAlpha version on a prerelease branch, then publish
Internal packageSource change on mainAutomatic patch release
Never-publish packageRepository build need onlyExcluded from every release path

Lockstep packages add a release order to these paths. Packages without publish-last advance together. A publish-last package waits for its early siblings to publish and can reuse a sibling tag at the required version.

References: packages/…/config.py• L468-497 packages/…/commands.py• L297-362 .github/…/auto_release_internal.yml• L6-11 packages/…/README.md• L180-229

Changelog-driven preparation

Preparation makes the next version and its notes explicit before any build starts. It joins change intake, version planning, dependency checks, changelog materialization, and delivery into one reviewed change.

Change intake

Pull request checks require a news fragment when a releasable package's source changes. They allow configured exceptions for changes that do not affect users and reject hand-written version headings. This keeps ordinary pull requests focused on change notes while the release action owns version headings.

The release tool also treats orphan fragments as release notes. During materialization it can associate an orphan with the pull request that added it, so the final entry keeps the normal issue link without requiring a fragment rename during development.

References: packages/…/README.md• L344-373 .github/…/changelog.yml• L6-23 .github/…/changelog.yml• L94-111 packages/…/commands.py• L476-491 packages/…/scaffold.py• L563-591

Version planning

The planner selects packages from the dispatch inputs or from pending release work. It expands selection to the lockstep partners that must share a version, checks that the target tag is unused, and holds back packages whose dependency floors cannot be satisfied by a published version.

Dependency order matters when one package requires an exact sibling version. Early packages publish first. The dependent package then builds against the versions already tagged or planned for the same batch. The root configuration uses this model for reflex and reflex-base.

References: packages/…/commands.py• L297-362 packages/…/commands.py• L365-473 packages/…/config.py• L468-512 pyproject.toml• L421-426

Changelog materialization

Materialization consumes the selected fragments and writes the next version section with towncrier. For a final release from a prerelease train, it combines the alpha sections into one final section. It stages the changelog with any dependency-pin changes and the lock file changes that result from re-resolution.

Towncrier uses the packaged reflex_release:changelog.md template for these entries. The template keeps issue links out of a trailing fenced code block, which preserves valid Markdown when a release note ends with example code. The same template setting is written by repository setup and is present in this repository's shared Towncrier configuration.

The dispatch workflow then delivers that commit in one of two ways: it pushes a prerelease branch or opens a release pull request. Materialization does not publish by itself. Merging a final-release pull request, or pushing the prerelease branch, gives changelog detection the input it needs.

References: .github/…/dispatch_release.yml• L6-45 packages/…/dispatch_release.yml• L4-43 packages/…/commands.py• L476-491 packages/…/README.md• L639-682 pyproject.toml• L432-445 packages/…/scaffold.py• L892-930 packages/…/changelog.md• L1-104

Publishing and validation

Publishing separates detection, preparation, building, artifact review, approval, upload, and release-record creation. The separation keeps repository code out of the job that holds the PyPI identity permission.

Release pipeline

The diagram shows how a changelog version becomes a verified release and then an optional downstream handoff.

flowchart LR
    A[News fragments] --> B[Dispatch release]
    B --> C[Changelog version]
    C --> D[Main or release branch]
    D --> E[Detect untagged version]
    E --> F[Prepare and build]
    F --> G[Verify artifacts and notes]
    G --> H[Human approval in pypi]
    H --> I[Upload to PyPI]
    I --> J[Push Git tag]
    J --> K[Create verified GitHub release]
    K --> L[Optional post-release workflow]

Detection runs on the main, prerelease, and hotfix publishing branches. Independent packages can publish in parallel. A publish-last package starts only after the early part of its lockstep batch succeeds and its required tags exist. A final report marks the batch failed when work is skipped, held back, cancelled, or rejected.

References: .github/…/release_from_changelog.yml• L6-29 .github/…/release_from_changelog.yml• L69-170 packages/…/release_from_changelog.yml• L4-27 packages/…/release_from_changelog.yml• L41-166

Artifact validation

The publish path validates the package, version, tag, branch, changelog, and lockstep state before it builds. It then checks every artifact's distribution name and version. Optional filename patterns can require a complete set from a platform build matrix.

The collected files are hashed into a SHA-256 manifest. The approval step reviews that set, and the upload uses only the checked artifacts. A wrong package, wrong version, empty build, or incomplete expected set stops before PyPI receives a file.

Custom builds support packages that need a repository-owned workflow. That workflow runs before approval and must accept the package, version, tag, build directory, and artifact prefix. The shared pipeline still verifies its output and applies the same upload gate.

References: .github/…/publish.yml• L8-33 .github/…/publish.yml• L119-299 packages/…/dist.py• L83-142 packages/…/scaffold.py• L77-105 packages/…/scaffold.py• L429-466 packages/…/config.py• L751-830

CI validation gate

The CI validation gates protect the main branch before release detection can use its changelog state. The unit-test workflow checks the Python and JavaScript parts of the product across supported operating systems and Python versions, with service-backed checks on the Linux path.

Package validation also builds every Python package, checks that each wheel and source archive installs in a clean environment, and tests declared minimum dependency versions on Python 3.11 and 3.14. A single gate summarizes the matrix so branch protection has one stable result even when package sets change.

Integration validation checks generated apps, the documentation site, a template app, state managers, browser behavior, and the Bun startup path. Its change filter runs inside the workflow so skipped work still reaches the always-run integration-tests-gate, which gives branch rules one stable result. The matrix covers the supported Python range for the app harness and exercises both memory and Redis state.

Performance validation checks code benchmarks and runtime smoke paths. It also checks browser behavior and Lighthouse output. A fixed hash seed reduces unrelated benchmark drift, while the always-run performance-tests-gate turns the three performance jobs into one branch status and preserves their reports as artifacts.

Together, these gates make release validation cover product behavior as well as package metadata. A release can proceed from a branch only when its required CI results are present and successful.

References: .github/…/build_packages.yml• L21-49 .github/…/build_packages.yml• L51-87 .github/…/build_packages.yml• L94-184 .github/…/unit_tests.yml• L22-81 .github/…/unit_tests.yml• L160-180 .github/…/unit_tests.yml• L211-236 .github/…/integration_tests.yml• L32-52 .github/…/integration_tests.yml• L54-204 .github/…/integration_tests.yml• L206-246 .github/…/integration_tests.yml• L281-352 .github/…/integration_tests.yml• L354-426 .github/…/performance.yml• L14-20 .github/…/performance.yml• L22-73 .github/…/performance.yml• L75-160

Approval and publication record

The pypi GitHub environment is the human control point for every upload. Its required reviewers must approve the already-built artifact set. The workflow can require a second person when allow-self-review is false; in that mode it also checks that the environment prevents self-review.

After upload, the pipeline creates the tag and GitHub release. It reads the release back and verifies the tag, title, prerelease flag, and checksum manifest. Only that verified release can dispatch the optional post-release workflow with the tag, package, and version.

References: .github/…/publish.yml• L301-395 .github/…/publish.yml• L397-446 packages/…/commands.py• L1319-1452 packages/…/commands.py• L1455-1499 packages/…/config.py• L140-222

Release controls

The root pyproject.toml is the release policy for package scope, branch rules, tags, lockstep groups, publishing exceptions, and workflow tool versions. Generated workflow files express that policy in GitHub Actions and are checked for drift.

Workflow generation

reflex-release init creates the release configuration, news directories, shared Towncrier configuration, and core workflows. The generated Towncrier configuration points to the packaged changelog template so all package changelogs use the same rendering rule. reflex-release sync renders the workflows from the current configuration. sync --check compares the rendered result with the checked-in files and fails when they differ.

The workflows are copied into the consuming repository rather than called from the tool's repository. This preserves PyPI trusted publishing's workflow identity and keeps repository triggers and local reusable-workflow calls pointed at the consumer's own files. A custom build workflow must exist locally and expose the required call interface before sync accepts it.

References: .github/…/changelog.yml• L1-3 packages/…/scaffold.py• L1-21 packages/…/scaffold.py• L774-843 packages/…/scaffold.py• L892-990 packages/…/README.md• L49-71

Release toolchain

Generated workflows install the configured uv and Python versions. The current defaults are uv 0.13.6 and Python 3.14.10; these pins also reject the compromised eMudhra intermediate CA certificates. A configuration change or tool upgrade appears as workflow drift until the files are regenerated.

This keeps the release path repeatable across runs. The repository runs the release tool from its locked workspace with uv run --frozen, so the release workflow follows the checked-in tool version rather than resolving a new published version.

References: packages/…/config.py• L25-47 packages/…/CHANGELOG.md• L1-6 .github/…/publish.yml• L104-108 .github/…/publish.yml• L373-379 packages/…/scaffold.py• L332-358 pyproject.toml• L397-405

Downstream handoff

An optional post-release workflow receives a published tag, package, and version on the tag itself. It starts only after the upload and GitHub release have passed verification, so downstream tasks can use the exact tree that was published.

The handoff is the final release action. If it fails, the package remains published and the tag identifies the release that needs a manual retry.

References: packages/…/config.py• L42-48 packages/…/commands.py• L1455-1499 packages/…/scaffold.py• L469-545

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep changelog heading generation and changelog parsing aligned. A heading the tool cannot read makes the version invisible to detection.
  • When package scope, source paths, lockstep membership, publishing exceptions, branch prefixes, or post-release settings change, update [tool.reflex-release] and regenerate the managed workflows.
  • When a package gains an extra-source-dirs path, keep the path inside the repository and make sure its changes trigger the package's news-fragment requirement.
  • When the Towncrier template or its package resource changes, keep template = "reflex_release:changelog.md", the scaffold output, and the packaged resource aligned.
  • When a custom build changes, preserve its five workflow inputs, artifact prefix, artifact file set, and successful matrix result contract.
  • When artifact verification changes, keep distribution name, target version, expected artifact patterns, and the checksum manifest tied to the same upload set.
  • When release tool versions or runtime pins change, keep the locked command, generated workflow pins, and sync --check result aligned.
  • When a validation workflow changes its path filter or required gate, keep skipped jobs reporting a result that satisfies branch protection without hiding a failed validation run.
  • When package build validation changes, keep discovery, artifact transfer, clean-install checks, minimum-dependency checks, and build-packages-gate aligned.
  • When integration or performance coverage changes, keep integration-tests-gate and performance-tests-gate aligned with the jobs they summarize and the branch rules that require them.
  • When the approval path changes, keep the pypi environment, trusted publisher workflow identity, reviewer rules, and allowed publishing branches aligned.
  • When a post-release workflow changes, keep its workflow_dispatch inputs named tag, package, and version and keep it on the default branch.

Important failure modes

TriggerConsequenceGuard
A changelog heading is hand-written or cannot be parsedDetection can publish an unintended version or miss the intended onePull request heading checks and title-format round-trip validation
A release note ends with a fenced code block and uses the default Towncrier templateIssue links can be attached to the closing fence and render as invalid MarkdownThe packaged changelog template places links before the block or in a separate paragraph
A source path is omitted from extra-source-dirsA package change can merge without a news fragment or enter the wrong release scopeConfiguration validation and path-based changelog checks
A lockstep sibling is missing its required tagA package can publish metadata that points to an unavailable exact versionPlanning, detection, and publish-last ordering fail closed
A dependency floor has no satisfying published versionThe package is held back or explicit selection failsPlanning checks published tags and materialization lifts only satisfiable floors
A build emits the wrong package, version, or incomplete artifact setPyPI can receive the wrong distribution or an unrecoverable partial versionMetadata checks, expected-artifact checks, and checksum review before approval
The pypi environment has no required reviewersUpload protection is absentThe publish job refuses to continue without configured reviewers
A build job is skipped even though detection found workThe batch can look green while nothing publishesExplicit success guards and the final release report
A required CI job is filtered out before it reports a checkBranch protection can block a merge even though no test failedIn-workflow change filtering and the always-run gate jobs report one required result
A package artifact cannot install outside the workspaceA release can pass workspace checks but fail for usersClean-environment installation of both wheel and source archive
A benchmark run uses an unstable hash seed or loses its result artifactPerformance comparisons can show unrelated drift or lose release evidenceFixed PYTHONHASHSEED and always-run artifact upload steps
A generated workflow is stale or a custom build contract is missingThe release can fail only when GitHub tries to run itsync --check validates generated files and custom workflow inputs
Upload succeeds but release creation or verification failsThe package is published without a complete release record or downstream handoffTag-after-upload ordering and read-back verification make the state visible and retryable

Key files

FileWhy to read it
pyproject.tomlDefines package scope, Python support, release policy, lockstep order, internal packages, never-publish packages, and the locked release command.
packages/…/CHANGELOG.mdShows the release tool's user-facing record, including the current toolchain pins and recent lockstep and dispatch behavior changes.
packages/…/README.mdExplains the product model, repository setup, release actions, and security boundaries.
packages/…/commands.pyConnects planning, changelog materialization, detection, artifact checks, publication, and release verification.
packages/…/config.pyDefines the configuration model and validates package, source-path, branch, lockstep, custom-build, and post-release contracts.
packages/…/dist.pyDefines the artifact identity and completeness checks before upload.
packages/…/scaffold.pyGenerates workflows and checks that repository-owned workflow contracts are present.
packages/…/changelog.mdDefines the shared changelog rendering rule for issue links and trailing code blocks.
.github/…/dispatch_release.ymlStarts a selected release and turns news fragments into a changelog version or prerelease branch.
.github/…/release_from_changelog.ymlDetects untagged changelog versions, orders lockstep publishing, and reports partial batches.
.github/…/publish.ymlBuilds, validates, gates, uploads, tags, and records one package release.
.github/…/changelog.ymlEnforces news fragments, protects changelog version headings, and checks generated workflow drift.
.github/…/build_packages.ymlBuilds all Python packages and validates clean installation and minimum dependency versions before release work.
.github/…/unit_tests.ymlProvides the cross-platform validation matrix and the stable status gate that protects merges before release work runs.
.github/…/integration_tests.ymlValidates generated apps, documentation, state managers, browser paths, template apps, and runtime startup before release work runs.
.github/…/performance.ymlRuns benchmark, browser, and Lighthouse checks and publishes their validation artifacts.
.github/…/auto_release_internal.ymlShows the push-based path for internal packages that do not use changelogs.
packages/…/dispatch_release.ymlShows the template used to generate release dispatch behavior.
packages/…/release_from_changelog.ymlShows the template used to generate changelog detection, parallel publishing, lockstep ordering, and batch failure reporting.