Skip to content

ci: support release candidate publishing - #309

Open
jplbrun wants to merge 4 commits into
mainfrom
feat/afsdk-4181-rc-release
Open

ci: support release candidate publishing#309
jplbrun wants to merge 4 commits into
mainfrom
feat/afsdk-4181-rc-release

Conversation

@jplbrun

@jplbrun jplbrun commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Disclaimer: Do not include SAP-internal or customer-specific information in this PR (e.g. internal system URLs, customer names, tenant IDs, or confidential configurations). This is a public repository.

Description

Hardens and documents the existing support for publishing release candidates (RCs) to PyPI, and updates the version bump automation to understand PEP 440 pre-release versions.

Previously, the version-bump check used sort -V, which incorrectly treats 1.0.0rc1 as newer than the final 1.0.0. For source-changing PRs, this could misclassify an RC-to-final promotion as a regression. The release workflow also did not verify that the package version’s pre-release status matched the GitHub Release setting.

This PR:

  • Replaces sort -V with check_version_bump.py, which uses PEP 440 ordering so RC-to-final promotions are accepted and regressions remain rejected.
  • Adds validate_prerelease.py, which fails before building when the package version and GitHub Release disagree on pre-release status.
  • Adds unit tests for both scripts under tests/ci/.
  • Documents the RC cycle and installation process in docs/RELEASE.md.

Related Issue

N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Dependency update

How to Test

  1. Run the script unit tests: uv run pytest tests/ci/test_versioning_scripts.py -v.
  2. Confirm the version-bump check accepts 1.0.0rc1 -> 1.0.0 and rejects 1.0.0 -> 1.0.0rc1 (regression).
  3. Confirm validate_release.py rejects a tag/version mismatch and a pre-release-flag mismatch, and accepts matching metadata for both an RC and a stable version.

Expected result: the RC-to-final bump is accepted, mismatched release metadata fails before publishing, and correct metadata passes.

Checklist

  • I have read the Contributing Guidelines
  • I have verified that my changes solve the issue
  • I have added/updated automated tests to cover my changes
  • All tests pass locally
  • I have verified that my code follows the Code Guidelines
  • I have updated documentation (if applicable)
  • I have added type hints for all public APIs
  • My code does not contain sensitive information (credentials, tokens, etc.)
  • I have followed Conventional Commits for commit messages

Breaking Changes

None

Additional Notes

N/A

@jplbrun jplbrun changed the title ci: support release candidate publishing and PEP 440 release validation ci: support release candidate publishing Sep 8, 2026
@jplbrun
jplbrun marked this pull request as ready for review September 8, 2026 13:48
@jplbrun
jplbrun requested a review from a team as a code owner September 8, 2026 13:48
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