Created
January 27, 2026 06:46
-
-
Save liweinan/1c16388052387032931c1846035d8052 to your computer and use it in GitHub Desktop.
Analyze installer versions and their corresponding commits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Analyze installer versions and their corresponding commits | |
| # Similar to release image analysis, but for installer repository | |
| set -e | |
| INSTALLER_REPO="${1:-/Users/weli/works/oc-swarm/installer}" | |
| echo "==========================================" | |
| echo "Installer Version Analysis" | |
| echo "==========================================" | |
| echo "Repository: $INSTALLER_REPO" | |
| echo "" | |
| cd "$INSTALLER_REPO" | |
| # Method 1: Check release branches | |
| echo "=== Method 1: Release Branches ===" | |
| for branch in release-4.16 release-4.17 release-4.18 release-4.19 release-4.20; do | |
| if git show-ref --verify --quiet refs/remotes/origin/$branch; then | |
| commit=$(git rev-parse origin/$branch) | |
| date=$(git log -1 --format="%cd" --date=short origin/$branch) | |
| echo "$branch: $commit ($date)" | |
| fi | |
| done | |
| echo "" | |
| # Method 2: Check if bug commit exists in each branch | |
| echo "=== Method 2: Bug Commit (4068682841) Check ===" | |
| BUG_COMMIT="4068682841" | |
| for branch in release-4.16 release-4.17 release-4.18 release-4.19 release-4.20; do | |
| if git branch -r --contains "$BUG_COMMIT" 2>/dev/null | grep -q "$branch"; then | |
| echo "$branch: ❌ Contains bug commit" | |
| else | |
| echo "$branch: ✅ No bug (safe)" | |
| fi | |
| done | |
| echo "" | |
| # Method 3: Find commits that mention version numbers | |
| echo "=== Method 3: Version-related Commits ===" | |
| for version in 4.16 4.17 4.18 4.19 4.20; do | |
| echo "--- Version $version ---" | |
| git log --all --oneline --grep="$version" --grep="release.*$version" -i -3 --format="%h %ad %s" --date=short | head -3 || echo " (no specific commits found)" | |
| done | |
| echo "" | |
| # Method 4: Check default release image in code | |
| echo "=== Method 4: Default Release Image in Code ===" | |
| if [ -f "pkg/asset/releaseimage/default.go" ]; then | |
| echo "Current default release image:" | |
| grep -A 2 "defaultReleaseImageOriginal" pkg/asset/releaseimage/default.go | head -3 || echo " (not found)" | |
| else | |
| echo " File not found" | |
| fi | |
| echo "" | |
| # Method 5: Analyze by checking when release image changed | |
| echo "=== Method 5: Release Image Changes ===" | |
| git log --all --oneline --grep="release.*4\.[12]" -i --format="%h %ad %s" --date=short -- pkg/asset/releaseimage/default.go | head -10 || echo " (no changes found)" | |
| echo "" | |
| # Method 6: Check tags | |
| echo "=== Method 6: Version Tags ===" | |
| git tag | grep -E "^v?4\.(1[6-9]|20)" | sort -V | tail -10 | |
| echo "" | |
| # Method 7: Find commits before bug introduction | |
| echo "=== Method 7: Commits Before Bug Introduction (2025-08-14) ===" | |
| BUG_DATE="2025-08-14" | |
| for branch in release-4.16 release-4.17 release-4.18 release-4.19; do | |
| if git show-ref --verify --quiet refs/remotes/origin/$branch; then | |
| last_before_bug=$(git log origin/$branch --before="$BUG_DATE" --oneline -1 --format="%h %ad %s" --date=short 2>/dev/null || echo "") | |
| if [ -n "$last_before_bug" ]; then | |
| echo "$branch: $last_before_bug" | |
| fi | |
| fi | |
| done | |
| echo "" | |
| echo "==========================================" | |
| echo "Summary" | |
| echo "==========================================" | |
| echo "To find installer commit for a specific OpenShift version:" | |
| echo "1. Check release branch: git checkout release-4.19 && git log -1" | |
| echo "2. Check release image: oc adm release info quay.io/openshift-release-dev/ocp-release:4.19.0-x86_64 --image-for=openshift-install" | |
| echo "3. Check if bug exists: git branch -r --contains 4068682841 | grep release-4.19" | |
| echo "==========================================" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using the test script to test against a commit that contains the problem: