Skip to main content
OpenShift Python Wrapper uses semantic versioning and automated release tooling to publish new versions.
Only maintainers with write access can create releases. This guide is for maintainers or those interested in understanding the release process.

Release Strategy

The project maintains multiple release branches corresponding to OpenShift versions:
  • main - Active development, latest features
  • v4.11 - OpenShift 4.11 compatible releases
  • v4.12 - OpenShift 4.12 compatible releases
  • v4.13 - OpenShift 4.13 compatible releases
  • etc.

Prerequisites

GitHub Token

Export your GitHub personal access token:
The token needs:
  • repo scope for creating releases
  • write:packages scope if publishing packages

Install release-it

Install release-it and the bumper plugin:

Creating a Release

Release from Main

To create a release from the main branch:
Follow the interactive prompts:
  1. Select version: Choose patch, minor, or major version bump
  2. Review changes: Confirm the changelog and version updates
  3. Publish: Confirm publishing to GitHub and PyPI

Release from Version Branch

To create a release for a specific OpenShift version (e.g., 4.11):
Always create releases from the branch you want to release, not from main.

Semantic Versioning

The project follows Semantic Versioning (MAJOR.MINOR.PATCH):

Version Bump Guidelines

MAJOR version (x.0.0) - Incompatible API changes:
  • Breaking changes to existing APIs
  • Removal of deprecated features
  • Major refactoring affecting compatibility
MINOR version (0.x.0) - Backward-compatible functionality:
  • New resource support
  • New features and enhancements
  • Deprecations (but not removals)
PATCH version (0.0.x) - Backward-compatible bug fixes:
  • Bug fixes
  • Documentation updates
  • Internal improvements

Examples

  • 4.11.14.11.2 (patch): Bug fix release
  • 4.11.24.12.0 (minor): New features added
  • 4.12.55.0.0 (major): Breaking changes

Release Workflow

1. Prepare the Release

Before running release-it:
  1. Ensure all tests pass:
  2. Run pre-commit checks:
  3. Review merged PRs since last release:
  4. Update documentation if needed

2. Run release-it

The tool will:
  • Prompt for version bump (patch/minor/major)
  • Generate changelog from git commits
  • Update version in pyproject.toml and other files
  • Create a git tag
  • Push changes and tag to GitHub
  • Create a GitHub release
  • Publish to PyPI (if configured)

3. Verify the Release

After releasing:
  1. Check GitHub releases:
  2. Check PyPI:
  3. Test installation:

Cherry-picking to Release Branches

When a fix needs to be included in a released version:

Automated Cherry-pick

  1. After your PR is merged to main, add a comment:
  2. This creates a new PR targeting the v4.11 branch
  3. Review and merge the cherry-pick PR
  4. Create a patch release from the version branch:

Manual Cherry-pick

If automated cherry-pick fails:

Release Configuration

The project uses .release-it.json for release configuration. Common settings include:

PyPI Publishing

Automated Publishing

If configured, release-it can automatically publish to PyPI:

Manual Publishing

To manually publish to PyPI:

TestPyPI

Test releases on TestPyPI first:

Post-Release Tasks

Update Documentation

After releasing:
  1. Update installation docs with new version
  2. Update changelog on ReadTheDocs
  3. Announce release in relevant channels

Documentation Hosting

Documentation is hosted on ReadTheDocs:
  • Automatically builds on new releases
  • Maintains docs for each version
  • Serves latest stable version by default

Hotfix Releases

For critical bugs requiring immediate release:
  1. Create hotfix branch from version branch:
  2. Apply the fix:
  3. Merge to version branch:
  4. Create patch release:
  5. Backport to main if needed:

Rollback a Release

If a release has critical issues:

Delete GitHub Release

  1. Go to Releases page
  2. Click on the problematic release
  3. Click “Delete release”
  4. Delete the corresponding git tag:

Yank from PyPI

You cannot delete packages from PyPI, but you can yank them:
  1. Go to PyPI project page
  2. Select the version
  3. Click “Options” → “Yank release”
  4. Provide a reason
Yanked releases won’t be installed by default but remain available.

Troubleshooting

release-it Command Not Found

Ensure release-it is installed globally:

Authentication Failed

Check your GitHub token:

Version Bump Failed

Ensure working directory is clean:

PyPI Upload Failed

Verify PyPI credentials:

Best Practices

  1. Always release from clean working directory
  2. Test thoroughly before releasing
  3. Review changelog before confirming
  4. Announce major releases to users
  5. Maintain version branches for supported releases
  6. Cherry-pick critical fixes to active version branches
  7. Document breaking changes clearly
  8. Use semantic versioning consistently
  9. Test on TestPyPI before production release
  10. Monitor issues after release for problems

Additional Resources