Container Building and Publishing
Automatically build and publish container images to container registries.Configuration
Global Docker Registry Access:Build Triggers
Containers are built automatically when:- PR is opened or synchronized - Build container for testing
- PR is merged to protected branch - Build and push to registry
- New release is created - Build and push with release tag (if
release: true)
Manual Container Build
Trigger container builds via comment commands:Build Process
- Clone repository at PR commit SHA
- Run
podman buildwith configured args and build-args - Tag image with configured tag
- Push to configured registry (if not a draft PR)
- Report build status via GitHub check run
Multi-registry Support
Support for multiple container registries:- Docker Hub (
docker.io) - GitHub Container Registry (
ghcr.io) - Quay.io (
quay.io) - Any OCI-compliant registry
Container Build Requirements
- Dockerfile in repository root
- Podman or Docker available in webhook server environment
- Registry credentials configured
- Privileged mode enabled (for containerized deployments)
PyPI Package Publishing
Automatically publish Python packages to PyPI when new releases are created.Configuration
Publishing Workflow
- Trigger: New GitHub release is created
- Process:
- Clone repository at release tag
- Build package using
python -m build - Upload to PyPI using
twine upload - Report status via GitHub check run
Requirements
- Valid
pyproject.tomlorsetup.pyin repository root - PyPI API token with upload permissions
- Package version matches release tag
Error Handling
- Build failures reported as failed check run
- Upload failures logged and reported
- Existing package versions handled gracefully
Tox Testing Integration
Run Python tests using tox with branch-specific test environments.Configuration
Basic Configuration:How It Works
- PR opened/synchronized: Server identifies target branch
- Environment selection: Uses configured tox environments for that branch
- Test execution: Runs
tox -e <environments>in cloned repository - Result reporting: Reports pass/fail via GitHub check run
Manual Test Triggering
Tox Configuration File
Your repository must contain atox.ini file:
Test Results
- Test output captured and displayed in check run details
- Failed tests include full traceback
- Test summary shows passed/failed/skipped counts
Pre-commit Hook Validation
Automatically validate code quality using pre-commit hooks.Configuration
Validation Process
- Trigger: PR opened, synchronized, or manual retest
- Execution:
- Clone repository
- Install pre-commit hooks
- Run
pre-commit run --all-files - Report results via check run
Manual Validation
Pre-commit Configuration
Your repository needs a.pre-commit-config.yaml file:
Common Pre-commit Hooks
- Code formatters: black, ruff-format, prettier
- Linters: ruff, pylint, eslint, shellcheck
- Type checkers: mypy, pyright
- Security: bandit, safety, detect-secrets
- Git hooks: trailing-whitespace, check-merge-conflict
Test Commands
Comprehensive test automation via comment commands.Available Test Commands
| Command | Description | Example |
|---|---|---|
/retest all | Run all configured tests | /retest all |
/retest tox | Run tox tests | /retest tox |
/retest build-container | Rebuild container | /retest build-container |
/retest python-module-install | Test package installation | /retest python-module-install |
/retest pre-commit | Run pre-commit checks | /retest pre-commit |
Python Module Installation Test
Validates that your Python package can be installed:- Clone repository
- Create clean virtual environment
- Run
pip install .orpip install -e . - Verify installation succeeded
- Report results
Permission Requirements
Most test commands require user to be in repository OWNERS file:/retestcommands: Requires OWNERS membership/build-and-push-container: Requires OWNERS membership- Automated tests on PR events: No permission required
Branch Protection Integration
Integrate CI/CD checks with GitHub branch protection rules.Required Status Checks Configuration
Default Status Checks
Branch Protection Rules
Check Run Reporting
All CI/CD operations report status via GitHub Check Runs:- Queued: Check run created and queued
- In Progress: Test/build running
- Success: Operation completed successfully
- Failure: Operation failed with error details
Check Run Details
Detailed output includes:- Command executed
- Full console output
- Error messages and tracebacks
- Timing information
- Links to artifacts (if applicable)
Performance Optimization
The webhook server optimizes CI/CD performance:Repository Cloning Optimization
- Smart cloning: Only clone when needed for check_run events
- Early exit: Skip clone for non-completed check runs
- Shallow clones: Use
--depth=1for faster clones - Can-be-merged optimization: Skip clone for failed can-be-merged checks
- 90-95% reduction in unnecessary cloning
- Saves 5-30 seconds per skipped clone
- Reduced resource usage
- Lower server load