Skip to content

feat: independent release automation + surface gateway spec version#12

Merged
njbrake merged 3 commits into
mainfrom
feat/release-coordination
Jun 11, 2026
Merged

feat: independent release automation + surface gateway spec version#12
njbrake merged 3 commits into
mainfrom
feat/release-coordination

Conversation

@njbrake

@njbrake njbrake commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

Implements the two per-SDK items from #9: independent release automation and surfacing the gateway spec version.

Surface the gateway spec version

  • The gateway codegen now stamps the spec version into the generated core as otari/_client/_spec_version.py. The package re-exports it as otari.__spec_version__ so callers can tell which gateway spec this SDK targets.
  • The marker file is seeded here byte-for-byte to match the codegen output, so the build works today and the next regeneration PR is a no-op for it.
  • Added tests/unit/test_spec_version.py to guard the wiring.

Release automation (release-please)

  • Adds release-please-config.json, .release-please-manifest.json (seeded at the current 0.1.0), and .github/workflows/release-please.yml.
  • The SDK is now versioned independently of the gateway. Merges to main accumulate into a release PR (version bump in pyproject.toml + CHANGELOG.md); merging it tags the release and publishes to PyPI in the same workflow run, gated on release_created.
  • Removes the old publish.yml; its publish job moves into the release-please workflow, so no PAT is needed to chain off the release event. Trusted-publisher OIDC (environment: pypi, id-token: write) is preserved.

Prerequisites for the maintainer

  • Repo setting "Allow GitHub Actions to create and approve pull requests" must be enabled for release-please to open its release PR.
  • Version bumps are driven by Conventional Commits going forward.

Test plan

  • uv run ruff check .
  • uv run mypy src/
  • uv run pytest tests/unit (112 passed)

Fixes #9
Part of mozilla-ai/otari#133

🤖 Generated with Claude Code

njbrake and others added 3 commits June 11, 2026 11:59
The gateway codegen now stamps the spec version into the generated core
(otari._client._spec_version). Re-export it from the package so callers can
tell which gateway spec this SDK targets. The marker is seeded here to match
the codegen output byte-for-byte, so the next regeneration is a no-op for it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the manual "create a GitHub release by hand" flow with release-please.
Merges to main accumulate into a release PR that bumps the version and updates
CHANGELOG.md; merging it tags the release and publishes to PyPI in the same
workflow run (gated on release_created), so no PAT is needed to chain off the
release event. Removes the old publish.yml, whose job moves into the publish
step here.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Document how this SDK is released: conventional commits drive a release-please
release PR; merging it tags and publishes. Covers the repo's registry, secret,
version file, the one-time repo setting, and the retry path, and links to the
gateway compatibility doc for the cross-repo policy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@njbrake njbrake marked this pull request as ready for review June 11, 2026 12:36
@njbrake njbrake requested review from khaledosman and tbille June 11, 2026 12:36
@khaledosman khaledosman requested a review from Copilot June 11, 2026 14:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces independent release automation for the Python SDK via release-please, and surfaces the gateway spec version targeted by the generated client core as otari.__spec_version__.

Changes:

  • Re-export generated gateway spec version marker as otari.__spec_version__ and add a unit test to guard the wiring.
  • Add release-please configuration and a unified Release workflow that opens release PRs and publishes to PyPI on release creation.
  • Remove the legacy release-event-driven PyPI publish workflow in favor of release-please-driven publishing.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/unit/test_spec_version.py Adds a unit test asserting otari.__spec_version__ matches the generated marker.
src/otari/_client/_spec_version.py Adds the generated spec-version marker file (seeded placeholder).
src/otari/__init__.py Re-exports __spec_version__ from the generated core at the package root.
RELEASE.md Documents the new release-please-driven release process and prerequisites.
release-please-config.json Configures release-please for a Python package release flow.
.release-please-manifest.json Seeds the release-please manifest at version 0.1.0.
.github/workflows/release-please.yml Adds release-please automation and a publish job gated on release_created.
.github/workflows/publish.yml Removes the old publish-on-release workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/otari/__init__.py
Comment on lines +21 to +24
# Gateway/spec version the generated core was built from, stamped into the core by
# the gateway codegen pipeline. Surfaced here so callers can check which gateway
# spec this SDK targets (see https://github.com/mozilla-ai/otari spec compatibility).
from otari._client._spec_version import __spec_version__ as __spec_version__
Comment on lines +40 to +46
- uses: astral-sh/setup-uv@v6

- name: Build package
# release-please already committed the version bump to pyproject.toml on
# main, so the build picks it up with no tag-to-file patching needed.
run: uv build

@njbrake njbrake merged commit 21b9b5b into main Jun 11, 2026
4 checks passed
@njbrake njbrake deleted the feat/release-coordination branch June 11, 2026 14:52
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.

Add independent release automation + surface gateway spec version

3 participants