-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
automationAutomation improvementsAutomation improvementspriority: criticalMust be fixed immediatelyMust be fixed immediatelyquadrant: q1Urgent & Important (Do First)Urgent & Important (Do First)type: processProcess and workflow improvementsProcess and workflow improvements
Description
Problem
Current release process:
- Run unit tests ✅
- Publish to PyPI ✅
- Hope nothing breaks ❌
Result: Bugs reach production
Solution
Automated pre-release validation that MUST pass before PyPI publish:
#!/bin/bash
# scripts/pre_release_validation.sh
set -e
echo "Pre-Release Validation for SDK v${VERSION}"
echo "========================================"
# 1. Unit tests
echo "Running unit tests..."
pytest tests/unit/ -v || exit 1
# 2. Integration tests
echo "Running integration tests against production API..."
pytest tests/integration/ --integration -v || exit 1
# 3. Performance tests
echo "Running performance benchmarks..."
pytest tests/performance/ --performance -v || exit 1
# 4. Endpoint validation
echo "Validating all endpoints exist..."
python scripts/validate_endpoints.py || exit 1
# 5. Build test
echo "Building package..."
python -m build || exit 1
# 6. Install and smoke test
echo "Installing built package..."
pip install dist/*.whl
python -c "import oilpriceapi; print(oilpriceapi.__version__)" || exit 1
echo ""
echo "✅ All validation checks passed"
echo "Ready to publish to PyPI"Pre-Release Checklist
Code Quality
- All unit tests pass
- All integration tests pass
- All performance tests pass
- Code coverage >80%
- No linting errors
- No type errors (mypy)
Integration Validation
- Test against production API
- All endpoints return expected responses
- Response times within expected ranges:
- 1 day query: <5s
- 1 week query: <15s
- 1 month query: <30s
- 1 year query: <90s
- Timeout handling works correctly
- Error handling works correctly
Documentation
- CHANGELOG.md updated
- Version bumped in all locations
- README.md updated if needed
- Migration guide if breaking changes
- Examples tested and working
Package Build
- Package builds successfully
- Wheel installs cleanly
- Import works after install
- Version matches expected
Post-Release Monitoring (24h)
- PyPI package available
- Installation works:
pip install oilpriceapi - Monitor error rates
- Check download stats
- Monitor support tickets
Automation
# .github/workflows/pre-release.yml
name: Pre-Release Validation
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run pre-release validation
env:
TEST_API_KEY: ${{ secrets.TEST_API_KEY }}
run: |
chmod +x scripts/pre_release_validation.sh
./scripts/pre_release_validation.sh
- name: Create release checklist issue
if: success()
run: |
gh issue create \
--title "Release v${{ github.event.inputs.version }} - Complete Checklist" \
--body-file .github/release_checklist_template.md \
--label "release"Acceptance Criteria
- Pre-release script created and tested
- Script runs all validation checks
- Script fails fast on any check failure
- GitHub workflow created
- Release checklist template created
- Documentation updated with release process
Estimated Effort
Time: 2 hours
Complexity: Low
Success Metrics
- Zero releases with P0 bugs
- All releases pass validation before publish
- Release process takes <30 minutes total
Usage
# Before publishing to PyPI
./scripts/pre_release_validation.sh
# If all checks pass
twine upload dist/*coderabbitai
Metadata
Metadata
Assignees
Labels
automationAutomation improvementsAutomation improvementspriority: criticalMust be fixed immediatelyMust be fixed immediatelyquadrant: q1Urgent & Important (Do First)Urgent & Important (Do First)type: processProcess and workflow improvementsProcess and workflow improvements