Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ci: release workflow with Trusted Publishing + Python runtime CI#133

Merged
hardbyte merged 2 commits into
mainfrom
ci/release-workflow
May 6, 2026
Merged

ci: release workflow with Trusted Publishing + Python runtime CI#133
hardbyte merged 2 commits into
mainfrom
ci/release-workflow

Conversation

@hardbyte
Copy link
Copy Markdown
Contributor

@hardbyte hardbyte commented May 6, 2026

Summary

  • New release.yml triggered by v* tags. Adapted from the awa repo's release.yml.
    • Version-consistency gate across all five Cargo.tomls and reflectapi-python-runtime/pyproject.toml — fails fast on drift.
    • Publishes the five Rust crates to crates.io in dependency order (reflectapi-schemareflectapi-derivereflectapi-schema-codegenreflectapireflectapi-cli) using crates.io Trusted Publishing (OIDC via rust-lang/crates-io-auth-action@v1) — no long-lived CARGO_REGISTRY_TOKEN in the repo.
    • Builds the pure-Python reflectapi-runtime sdist + wheel (hatchling) and publishes to PyPI Trusted Publishing.
    • Cuts a GitHub Release with auto-generated notes; tags containing alpha|beta|rc are flagged as pre-releases.
  • CI gains a python-runtime job that runs pytest on the runtime on every PR — currently the SSE tests never run in CI because the existing job is Rust-only.

Before the first tag

A release GitHub Environment needs to exist as the trusted publisher on:

  • crates.io — one trusted-publisher entry per crate (reflectapi, reflectapi-cli, reflectapi-derive, reflectapi-schema, reflectapi-schema-codegen); repo thepartly/reflectapi, workflow release.yml, environment release.
  • PyPI — project reflectapi-runtime, repo thepartly/reflectapi, workflow release.yml, environment release.

After that, git tag v0.17.2-alpha.1 && git push origin v0.17.2-alpha.1 cuts a pre-release end-to-end.

Test plan

  • Merge this PR
  • Configure crates.io and PyPI trusted publishers + the release GitHub Environment
  • Push v0.17.2-alpha.1 and confirm the workflow runs cleanly through to a GitHub pre-release

Release workflow (release.yml) is triggered by v* tags and:
- gates everything on a version-consistency check across the five
  Cargo.toml files and reflectapi-python-runtime/pyproject.toml
- publishes the five Rust crates to crates.io in dependency order using
  Trusted Publishing (rust-lang/crates-io-auth-action@v1) — no
  long-lived CARGO_REGISTRY_TOKEN secret required
- builds the pure-Python reflectapi-runtime sdist + wheel via hatchling
  and publishes to PyPI via Trusted Publishing (pypa/gh-action-pypi-publish)
- cuts a GitHub Release with auto-generated notes; alpha/beta/rc tags
  are flagged as pre-releases automatically
- uploads the wheel + sdist as release assets

CI gains a python-runtime job that runs the runtime test suite (pytest)
on every push and pull request. Adapted from the awa repo's release.yml.

Before the first tag, the repo needs a 'release' GitHub Environment
configured as the trusted publisher for both crates.io (one entry per
crate) and PyPI (project: reflectapi-runtime, workflow: release.yml,
environment: release).
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.

Once credits are available, reopen this pull request to trigger a review.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 75941e902e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +59 to +63
("reflectapi/Cargo.toml", cargo_version("reflectapi/Cargo.toml")),
("reflectapi-derive/Cargo.toml", cargo_version("reflectapi-derive/Cargo.toml")),
("reflectapi-schema/Cargo.toml", cargo_version("reflectapi-schema/Cargo.toml")),
("reflectapi-schema-codegen/Cargo.toml", cargo_version("reflectapi-schema-codegen/Cargo.toml")),
("reflectapi-cli/Cargo.toml", cargo_version("reflectapi-cli/Cargo.toml")),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Check internal dependency versions before publishing

For patch releases, this gate can still pass with stale intra-workspace dependency requirements: e.g. after bumping each [package].version to 0.17.2 for tag v0.17.2, reflectapi could still declare reflectapi-derive = "0.17.1" because Cargo’s default ^0.17.1 requirement accepts the local 0.17.2 during CI, but the published crate would keep depending on the already-released 0.17.1. Since the workflow later publishes with --no-verify, this can ship a mixed-version release even though the “version consistency” job succeeded; please also validate the internal dependency version fields for these workspace crates.

Useful? React with 👍 / 👎.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

📖 Documentation Preview: https://reflectapi-docs-preview-pr-133.partly.workers.dev

Updated automatically from commit 15c9580

…green

The new python-runtime CI job exposed 16 pre-existing failures unrelated
to SSE work. Fix them at the root rather than deselecting:

- Auth tests called auth.auth_flow(request) and discarded the generator,
  so the request mutation never ran. Wrap calls in next(...) so the
  yield body executes (16 sites across test_auth_negative_cases.py and
  test_edge_cases.py).
- hypothesis_strategies.strategy_for_type fell through to st.none() for
  bare collection types (dict, list, tuple, set) because get_origin()
  returns None for the unparameterised classes. Pydantic then rejected
  the generated None on a non-Optional field. Add explicit handling for
  the bare collections.
- test_make_request_with_json_data_still_works asserted 'headers' was
  absent from build_request kwargs, but the runtime passes headers=None
  when no headers model is supplied. Both forms mean 'no headers';
  relax the assertion to accept either.
@hardbyte hardbyte merged commit 4c994b0 into main May 6, 2026
5 checks passed
@hardbyte hardbyte deleted the ci/release-workflow branch May 6, 2026 08:28
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.

1 participant