Skip to content

Update 1 code files; Update configuration #1520

Update 1 code files; Update configuration

Update 1 code files; Update configuration #1520

name: "🔄 UV Self-Downgrades → Auto-Revert"
on:
workflow_dispatch:
push:
branches: ['development']
jobs:
uv-revert-test:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 🏁 Checkout code
uses: actions/checkout@v4
- name: 🐍 Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: 🔧 Install Redis for omnipkg
run: |
sudo apt-get update
sudo apt-get install -y redis-server
sudo systemctl start redis-server
redis-cli ping
- name: 📦 Install omnipkg
run: |
python -m pip install --upgrade pip
pip install -e .
- name: ⚙️ Configure omnipkg for non-interactive use
run: |
python - << 'EOF'
import sys, site, json, os
from pathlib import Path
site_packages_path = site.getsitepackages()[0]
python_executable_path = sys.executable
project_root = Path(os.environ['GITHUB_WORKSPACE'])
config_data = {
'site_packages_path': site_packages_path,
'multiversion_base': str(Path(site_packages_path) / '.omnipkg_versions'),
'python_executable': python_executable_path,
'builder_script_path': str(project_root / 'omnipkg' / 'package_meta_builder.py'),
'redis_host': 'localhost',
'redis_port': 6379,
'redis_key_prefix': 'omnipkg:pkg:',
'paths_to_index': [str(Path(python_executable_path).parent), '/usr/local/bin', '/usr/bin', '/bin', '/usr/sbin', '/sbin'],
'auto_cleanup': True,
'cleanup_threshold_days': 30
}
config_dir = Path.home() / '.config' / 'omnipkg'
config_dir.mkdir(parents=True, exist_ok=True)
with open(config_dir / 'config.json', 'w') as f:
json.dump(config_data, f, indent=2)
print(f'omnipkg config created')
print(json.dumps(config_data, indent=2))
EOF
- name: 🚀 Install uv using omnipkg — establish good state + snapshot
id: install_uv_latest
run: |
omnipkg install uv==0.8.13 2>&1 | tee /tmp/initial_uv_install_output.txt
if [ ${PIPESTATUS[0]} -ne 0 ]; then exit 1; fi
echo "Initial uv version:"
uv --version
echo "Waiting for background snapshot to complete..."
sleep 3
echo "omnipkg snapshot created - ready to revert uv interference"
- name: 💥 Force UV to downgrade itself
id: uv_self_downgrade
run: |
uv pip install uv==0.7.13 --system > /tmp/uv_downgrade_output.txt 2>&1
cat /tmp/uv_downgrade_output.txt
echo "Current uv version after downgrade:"
uv --version
- name: 🚑 Run omnipkg revert
id: omnipkg_revert
run: |
omnipkg revert --yes
if [ $? -eq 0 ]; then
echo "revert_success=true" >> $GITHUB_OUTPUT
echo "omnipkg revert completed successfully."
else
echo "revert_success=false" >> $GITHUB_OUTPUT
exit 1
fi
- name: ✅ Verify final UV version after revert
run: |
echo "UV version after revert:"
uv --version
echo "omnipkg info uv:"
omnipkg info uv
- name: 📊 Generate Report
if: always()
run: |
echo "# 🔄 UV Revert Test Report" > uv_revert_test_report.md
echo "**Status:** \`${{ job.status }}\`" >> uv_revert_test_report.md
echo "" >> uv_revert_test_report.md
echo "## Initial install" >> uv_revert_test_report.md
echo '```' >> uv_revert_test_report.md
cat /tmp/initial_uv_install_output.txt 2>/dev/null || echo "N/A"
echo '```' >> uv_revert_test_report.md
echo "## UV downgrade" >> uv_revert_test_report.md
echo '```' >> uv_revert_test_report.md
cat /tmp/uv_downgrade_output.txt 2>/dev/null || echo "N/A"
echo '```' >> uv_revert_test_report.md
- name: 📤 Upload report
uses: actions/upload-artifact@v4
with:
name: uv-revert-test-report
path: uv_revert_test_report.md
retention-days: 30