Skip to main content
Thank you for your interest in contributing to OpenShift Python Wrapper! This guide will help you get started with contributing code, documentation, and other improvements to the project.

Project Maintainers

See the OWNERS file for the current list of project maintainers.

Getting Started

Before contributing, familiarize yourself with the project:
  1. Read the README for an overview
  2. Review existing issues
  3. Check the pull requests to see ongoing work

Development Setup

Prerequisites

  • Python 3.9 or higher
  • uv package manager
  • Git

Clone and Install

Clone the repository and install dependencies:
git clone https://github.com/RedHatQE/openshift-python-wrapper.git
cd openshift-python-wrapper
uv sync

Pre-commit Setup

Before submitting any pull request, install prek for code quality checks:
prek install
This sets up pre-commit hooks that run:
  • Ruff: Code formatting and linting
  • Flake8: Style checking
  • mypy: Type checking
  • detect-secrets: Security scanning
  • gitleaks: Secret detection
  • Various other checks (trailing whitespace, merge conflicts, etc.)
The hooks will automatically run when you commit changes.

Code Quality Standards

Type Hints

All new code must include type hints. Type checking is enforced using mypy.
def create_pod(name: str, namespace: str) -> Pod:
    return Pod(name=name, namespace=namespace)

Code Style

The project uses:
  • Line length: 120 characters
  • Formatter: Ruff
  • Linter: Ruff + Flake8
Your code will be automatically formatted by pre-commit hooks.

Issues

Creating Issues

If you find a bug or have a feature request:
  1. Search existing issues first
  2. If none exist, create a new issue
  3. Use the appropriate issue template
  4. Provide clear description and reproduction steps

Pull Requests Auto-create Issues

If you open a pull request to fix a problem, an issue will be automatically created.

Pull Requests

Fork and Branch Workflow

  1. Fork the repository to your GitHub account
  2. Clone your fork locally
  3. Create a branch for your changes:
    git checkout -b feature/your-feature-name
    
  4. Make your changes and commit them
  5. Push to your fork:
    git push origin feature/your-feature-name
    
  6. Open a pull request from your fork to the main repository

Pull Request Guidelines

  • Fill out all required fields in the PR template
  • Keep the title descriptive and concise
  • Reference related issues using #issue-number
  • Ensure all pre-commit checks pass
  • Add tests for new functionality
  • Update documentation as needed

PR Dependencies

The project uses dpulls for PR dependencies. To make your PR depend on another: Add this to your PR description:
depends on #123

Cherry-picking to Release Branches

If a fix is needed in a released version:
  1. Wait for your PR to be merged to main
  2. Add a comment to the PR:
    /cherry-pick v4.11
    
  3. This will create a new PR targeting the specified branch

Code Review Process

  1. Maintainers will review your PR
  2. Address any feedback or requested changes
  3. Once approved, maintainers will merge your PR
  4. Your changes will be included in the next release

What to Contribute

  • Bug fixes: Fix issues in existing code
  • New resources: Add support for new Kubernetes/OpenShift resources
  • Features: Enhance existing functionality
  • Tests: Improve test coverage
  • Documentation: Improve or add documentation
  • Examples: Add usage examples

Next Steps

Adding Resources

Learn how to add new Kubernetes/OpenShift resources

Testing

Understand the testing framework and add tests

Releasing

Learn about the release process

Build docs developers (and LLMs) love