Thank you for your interest in contributing! Please check our main documentation repository for comprehensive guides, deployment instructions, and additional resources.
- Getting Started
- Pull Request Guidelines
- Commit Message Format
- PR Title Requirements
- Changelog Fragments
- Development Workflow
- Release Process (Maintainers Only)
Please perform the steps in the contribution guide Using Red Hat Developer Sandbox section.
Click the link below to launch your IDE hosted in the Developer Sandbox:
All pull requests from forks require manual approval from a maintainer before CI runs. This is a security measure to protect against malicious code execution. A maintainer will review and approve your PR, after which automated tests will run.
Pull requests from branches within the main repository run CI automatically.
Before submitting your pull request:
- PR title follows Conventional Commits format (see below)
- Changes are tested locally
- Documentation is updated if needed
- Changelog fragment added for significant changes (see below)
- All pre-commit hooks pass
This project follows Conventional Commits for commit messages and PR titles. This standard enables:
- Automated changelog generation
- Semantic versioning
- Clear and scannable project history
<type>(<scope>): <description>
[optional body]
[optional footer]
- feat: A new feature (triggers minor version bump)
- fix: A bug fix (triggers patch version bump)
- docs: Documentation only changes
- style: Changes that don't affect code meaning (formatting, whitespace, etc.)
- refactor: Code change that neither fixes a bug nor adds a feature
- perf: Performance improvement
- test: Adding or correcting tests
- chore: Changes to build process or auxiliary tools
- ci: Changes to CI configuration files and scripts
- build: Changes that affect the build system or dependencies
The scope provides additional context about what part of the codebase is affected:
roles: Changes to Ansible rolesplaybooks: Changes to playbooksmodules: Changes to modulesci: CI/CD changesdeps: Dependency updates
feat(roles): add VM snapshot management role
fix(mtv_management): handle missing provider credentials
docs: update installation instructions for AAP 2.5
chore(deps): update kubernetes.core to 5.3.0
refactor(validate_migration): simplify validation logic
test(mtv_management): add provider connection tests
For changes that break backward compatibility, add ! after the type/scope or include BREAKING CHANGE: in the footer:
feat(api)!: remove deprecated endpoints
BREAKING CHANGE: The /v1/legacy endpoint has been removed. Use /v2/resources instead.
Breaking changes trigger a major version bump.
CRITICAL: Your PR title MUST follow Conventional Commits format. When your PR is merged (via squash merge), the PR title becomes the commit message, which is used for:
- Generating the CHANGELOG
- Determining the next version number
- Creating release notes
- Maximum length: 72 characters
- Must match:
<type>(<scope>): <description> - Type must be one of: feat, fix, docs, style, refactor, perf, test, chore, ci, build
- Description must be lowercase and concise
✅ GOOD:
feat: add VM backup rolefix(mtv_management): correct provider validationdocs: update README with new requirementschore(deps): bump ansible-core to 2.20.0
❌ BAD:
Update files(no type)feat Add new feature(missing colon)FEAT: ADD NEW FEATURE(wrong case)feat: This is a very long PR title that exceeds the maximum character limit and will fail validation(too long)
A GitHub Action automatically validates PR titles. If your title doesn't match the format, the check will fail and you must update it before merging.
Changelog fragments are automatically generated based on the conventional commit messages. However, contributors may add additional information by crafting their own changelog fragment to help generate release notes.
Add a fragment for:
- New features (
feat) - Bug fixes (
fix) - Breaking changes
- Security fixes
- Significant refactoring
- Important documentation updates
Small changes don't need fragments:
- Typo fixes
- CI configuration tweaks
- Minor README updates
- Code formatting
- Test-only changes
Create a new YAML file in changelogs/fragments/:
# Filename format: <issue_or_pr_number>-<short_description>.yml
cat > changelogs/fragments/123-add-vm-snapshot.yml <<EOF
---
minor_changes:
- "Add VM snapshot management role with create, list, restore, and delete capabilities"
EOFAvailable fragment types (from changelogs/config.yaml):
major_changes: Significant new features or changesminor_changes: New features, enhancementsbreaking_changes: Changes that break compatibility (requires major version bump)deprecated_features: Features marked for removalremoved_features: Previously deprecated features now removedsecurity_fixes: Security-related fixesbugfixes: Bug fixesknown_issues: Documented issues or limitationsdoc_changes: Significant documentation updates
Bug fix fragment:
---
bugfixes:
- "mtv_management - fix credential validation for password-protected providers"Feature fragment with multiple entries:
---
minor_changes:
- "Add support for hot-plugging CPU and memory to VMs"
- "Implement VM template management role"Breaking change fragment:
---
breaking_changes:
- "Remove support for VMware vSphere 6.5. Minimum version is now 6.7."- Fork the repository (external contributors) or create a branch (internal contributors)
- Clone your fork or the main repository
- Install development dependencies:
# Install Ansible collection dependencies
ansible-galaxy collection install -r requirements.yml
# Install Python development dependencies
pip install -r requirements-dev.txt# Run ansible-lint
ansible-lint
# Run YAML linting
yamllint .
# Run molecule tests for a specific role (if applicable)
cd roles/<role-name>
molecule test
# Run all pre-commit hooks
pre-commit run --all-filesThis repository uses pre-commit hooks for code quality. Install them to run checks automatically before each commit:
pip install pre-commit
pre-commit installThe hooks will:
- Lint YAML files with yamllint
- Check for secrets with gitleaks
- Validate Ansible syntax with ansible-lint
- Check for merge conflict markers
- Detect broken symlinks
- Remove trailing whitespace
If a hook fails, fix the issue and commit again. Some hooks can auto-fix issues (like trailing whitespace).
- Create a feature branch:
git checkout -b feat/my-feature - Make your changes
- Run tests locally
- Commit with conventional commit messages
- Push to your fork/branch
- Create a pull request with a conventional commit title
This section is for repository maintainers with release permissions.
This project uses automated releases via GitHub Actions. The release workflow:
- Creates a release PR with updated version and CHANGELOG
- Runs all tests on the release PR
- Publishes to Ansible Galaxy and Red Hat Automation Hub when merged
- Creates a GitHub release with collection artifacts
To trigger releases, you must have:
- Access to the
releaseGitHub Environment (configured in repository settings) - Red Hat Automation Hub credentials (AUTOMATION_HUB_TOKEN secret)
- GitHub App credentials for releases (RELEASE_APP_ID, RELEASE_APP_PRIVATE_KEY secrets)
The collection uses Semantic Versioning (SemVer):
- Major (X.0.0): Breaking changes (incompatible API changes)
- Minor (0.X.0): New features (backward compatible)
- Patch (0.0.X): Bug fixes (backward compatible)
Version bumps are determined automatically from Conventional Commit messages in the changelog:
- Commits with
BREAKING CHANGE:or!→ major bump - Commits with
feat:→ minor bump - Commits with
fix:→ patch bump
Before triggering a release:
- All intended PRs for the release are merged to
main - CI is green on
mainbranch - No known critical bugs or regressions
- Documentation is up to date
- Navigate to Actions → CI workflow
- Click Run workflow (top right)
- Configure inputs:
- Branch:
main(required) - trigger_release: ✅ Check this box
- auto_merge: ⬜ Leave unchecked (recommended for safety)
- Branch:
- Click Run workflow
- The workflow will pause and wait for approval in the
releaseenvironment - Navigate to the workflow run and click Review deployments
- Review the approval request details:
- Who triggered the release
- What inputs were provided
- Current branch and commit
- Approve or reject based on:
- Is
mainbranch in a good state? - Are all tests passing?
- Is this the right time for a release?
- Is
- Click Approve and deploy if everything looks good
After approval, the workflow will:
- Calculate the new version based on commit messages
- Generate updated CHANGELOG
- Create a release PR titled
chore(release): X.Y.Z
Review the release PR carefully:
- Check the version number is correct
- Review CHANGELOG entries for accuracy
- Ensure all expected changes are documented
- Verify CI passes on the release PR
If the release PR has issues:
- Close the PR
- Fix issues on
main - Re-trigger the release workflow
Once CI passes on the release PR:
- Review and approve the PR
- Merge using squash merge (default)
- The workflow automatically:
- Builds the collection artifact (.tar.gz)
- Publishes to Red Hat Automation Hub
- Publishes to Ansible Galaxy (if configured)
- Creates a GitHub release with the artifact attached
- Tags the release commit
For experienced maintainers, you can enable auto-merge:
- When triggering the workflow, check auto_merge: true
- The release PR will merge automatically if CI passes
- Use with caution - you won't get a chance to review the PR before merge
Symptoms: Workflow runs but no PR appears
Solutions:
- Check Actions logs for errors
- Verify you have permissions in the
releaseenvironment - Ensure
mainbranch is up to date - Check GitHub App credentials are configured
Automation Hub:
- Verify AUTOMATION_HUB_TOKEN secret is valid
- Check token has not expired
- Verify namespace and collection name match
Galaxy:
- Verify galaxy.yml metadata is correct
- Check API token is configured
Symptoms: Version calculated incorrectly
Cause: Version is calculated from commit messages since last release
Solutions:
- Close the release PR
- Manually update
galaxy.ymlversion onmain - Commit with message:
chore(release): X.Y.Z - Re-run release workflow
Solutions:
- Do NOT merge the release PR
- Close the release PR
- Fix the failing tests on
main - Wait for CI to pass on
main - Re-trigger the release workflow
Before triggering a release:
- All planned PRs are merged to
main - CI is green on
mainbranch - No known critical bugs
- Documentation is current
- Dependencies are up to date
- Pre-commit hooks pass
- You have release environment access
After triggering:
- Review approval request details
- Approve release in GitHub environment
- Review release PR for correctness
- Verify CI passes on release PR
- Merge release PR
- Verify publication to Automation Hub
- Check GitHub release was created
- Announce release (if needed)
Releases are created on-demand by maintainers. Consider releasing when:
- Critical bug fixes are merged
- Significant new features are ready
- Security fixes are available
- Monthly maintenance window (1st and 15th - when scheduled CI runs)
- User requests for specific fixes/features
There is no fixed release schedule - releases happen when needed.
The release workflow includes multiple security controls:
- Environment approval: Only authorized maintainers can approve releases
- Branch restriction: Releases can only be triggered from
mainbranch - Audit logging: All release triggers are logged with actor information
- Secret protection: Secrets are only exposed after approval
- Concurrency control: Releases run sequentially, never in parallel
Never share release credentials or bypass the approval process.
- General questions: Check the documentation repository
- Bug reports: Open an issue with details and steps to reproduce
- Feature requests: Open an issue describing the use case
- Security issues: See CODE_OF_CONDUCT.md for reporting instructions
Thank you for contributing to OpenShift Virtualization Migration!