Fixing renovate (again).
Some checks failed
Tests / Build and Push CICD Complete Image (push) Has been skipped
Tests / YAML Syntax Check (push) Has been skipped
Tests / TOML Syntax Check (push) Has been skipped
Tests / Mixed Line Ending Check (push) Has been skipped
Tests / TOML Formatting Check (push) Has been skipped
Tests / Ruff Linting (push) Has been skipped
Tests / Ruff Format Check (push) Has been skipped
Tests / Pyright Type Check (push) Has been skipped
Tests / TypeScript Type Check (push) Has been skipped
Tests / TSDoc Lint Check (push) Has been skipped
Tests / Backend Tests (push) Has been skipped
Tests / Frontend Tests (push) Has been skipped
Tests / Backend Doctests (push) Has been skipped
Tests / Integration Tests (push) Has been skipped
Tests / End-to-End Tests (push) Has been skipped
Tests / Build and Push CICD Base Image (push) Failing after 12s
Tests / Trailing Whitespace Check (push) Has been skipped
Tests / End of File Check (push) Has been skipped
Tests / Darglint Docstring Check (push) Has been skipped
Tests / No Docstring Types Check (push) Has been skipped
Tests / ESLint Check (push) Has been skipped
Tests / Prettier Format Check (push) Has been skipped

Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
2025-11-06 07:09:55 -05:00
parent de5fde5460
commit e401d852f4

View File

@@ -44,31 +44,164 @@ jobs:
- name: Setup Node.js for Renovate
run: |
# Install Node.js 24 (required for Renovate 41+)
echo "=== Setting up Node.js 24 for Renovate ==="
# Check existing Node.js
if command -v node &> /dev/null; then
echo "Current Node.js version: $(node --version)"
fi
if command -v npm &> /dev/null; then
echo "Current npm version: $(npm --version)"
fi
# Aggressive cleanup of all Node.js/npm installations
echo "Performing complete Node.js cleanup..."
# Stop any Node.js processes
sudo pkill -f node || true
# Remove all package-managed Node.js installations
sudo apt-get remove -y --purge nodejs npm node || true
sudo apt-get autoremove -y --purge || true
# Remove all manual installations and caches
sudo rm -rf /usr/local/bin/node* /usr/local/bin/npm* || true
sudo rm -rf /usr/local/lib/node* /usr/local/include/node* || true
sudo rm -rf ~/.npm ~/.nvm ~/.node* || true
sudo rm -rf /root/.npm /root/.nvm /root/.node* || true
sudo rm -rf /usr/share/nodejs || true
sudo rm -rf /etc/apt/sources.list.d/nodesource.list* || true
# Clear npm environment variables that might conflict
unset npm_config_prefix npm_config_cache npm_config_globalconfig npm_config_init_module || true
echo "✓ Cleanup completed"
# Install Node.js 24 from NodeSource with error handling
echo "Installing Node.js 24..."
# Remove any existing NodeSource repository
sudo rm -f /etc/apt/sources.list.d/nodesource.list || true
# Add NodeSource repository
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
sudo apt-get install -y nodejs
# Update npm to latest version
npm install -g npm@latest
# Install with DEBIAN_FRONTEND to avoid interactive prompts
echo "Installing Node.js package..."
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
# Verify installation
echo "Node.js version: $(node --version)"
echo "npm version: $(npm --version)"
# Verify and fix installation
echo "=== Verifying Node.js Installation ==="
# Check if versions meet Renovate requirements
NODE_VERSION=$(node --version | cut -d'v' -f2)
if [[ $(echo "$NODE_VERSION 24.10.0" | awk '{print ($1 >= $2)}') == 1 ]]; then
echo "✓ Node.js version $NODE_VERSION meets Renovate requirements"
# Check Node.js
if command -v node &> /dev/null; then
NODE_VERSION=$(node --version)
echo "✓ Node.js installed: $NODE_VERSION"
else
echo "⚠️ Node.js version $NODE_VERSION may not fully support latest Renovate"
echo " Node.js installation failed"
exit 1
fi
# Check npm and fix if needed
if command -v npm &> /dev/null && npm --version &> /dev/null; then
NPM_VERSION=$(npm --version)
echo "✓ npm working: $NPM_VERSION"
else
echo "⚠️ npm not working properly, reinstalling..."
# Method 1: Try to fix npm with the bundled version
if [ -f "/usr/bin/node" ] && [ -f "/usr/lib/node_modules/npm/bin/npm-cli.js" ]; then
echo "Using bundled npm..."
sudo ln -sf /usr/lib/node_modules/npm/bin/npm-cli.js /usr/bin/npm || true
sudo chmod +x /usr/bin/npm || true
fi
# Method 2: If that doesn't work, reinstall npm manually
if ! npm --version &> /dev/null; then
echo "Manual npm installation..."
curl -L https://www.npmjs.com/install.sh | sudo sh
fi
# Method 3: Last resort - use npx to bootstrap npm
if ! npm --version &> /dev/null; then
echo "Using node to run npm directly..."
# Create npm wrapper script
echo '#!/bin/bash' | sudo tee /usr/bin/npm > /dev/null
echo 'exec /usr/bin/node /usr/lib/node_modules/npm/bin/npm-cli.js "$@"' | sudo tee -a /usr/bin/npm > /dev/null
sudo chmod +x /usr/bin/npm
fi
# Final verification
if npm --version &> /dev/null; then
echo "✓ npm recovered successfully: $(npm --version)"
else
echo "❌ npm recovery failed"
exit 1
fi
fi
# Test npm basic functionality
echo "Testing npm functionality..."
if npm config get registry &> /dev/null; then
echo "✓ npm configuration accessible"
else
echo "⚠️ npm configuration issues, but continuing..."
fi
# Check version compatibility for Renovate
NODE_VERSION=$(node --version | cut -d'v' -f2)
echo "=== Version Compatibility Check ==="
echo "Node.js version: $NODE_VERSION"
if [[ $(echo "$NODE_VERSION 24.10.0" | awk '{print ($1 >= $2)}') == 1 ]]; then
echo "✅ Node.js version $NODE_VERSION meets Renovate latest requirements"
echo "RENOVATE_VERSION=latest" >> $GITHUB_ENV
else
echo "⚠️ Node.js version $NODE_VERSION - will use compatible Renovate version"
echo "RENOVATE_VERSION=40.3.2" >> $GITHUB_ENV
fi
- name: Install Renovate
run: |
echo "Installing compatible Renovate version..."
# Use a specific version that works with Node 24.6+
npm install -g renovate@40.3.2
renovate --version
echo "=== Installing Renovate ==="
# Set npm configuration for better reliability
npm config set fund false
npm config set audit false
npm config set progress false
# Use the version determined in previous step
echo "Installing Renovate version: $RENOVATE_VERSION"
# Install with retry logic and better error handling
for i in 1 2 3; do
echo "Renovate installation attempt $i/3..."
# Clear npm cache to avoid issues
npm cache clean --force || true
# Install Renovate with timeout and error handling
if timeout 300 npm install -g "renovate@$RENOVATE_VERSION" --no-audit --no-fund; then
echo "✓ Renovate installation successful on attempt $i"
break
else
echo "⚠️ Renovate installation attempt $i failed"
if [ $i -eq 3 ]; then
echo "❌ All Renovate installation attempts failed"
echo "Checking npm and Node.js status for debugging..."
echo "Node.js version: $(node --version)"
echo "npm version: $(npm --version)"
echo "npm config: $(npm config list || echo 'npm config failed')"
exit 1
fi
echo "Waiting 15 seconds before retry..."
sleep 15
fi
done
# Verify Renovate installation
echo "✓ Renovate version: $(renovate --version)"
echo "✓ Renovate location: $(which renovate)"
- name: Configure Renovate for Gitea
env: