Skip to content

Commit ba2fb02

Browse files
[rocm-libraries] ROCm/rocm-libraries#5691 (commit 2fbb1fc)
[CK] MICI: Revert "add self healing to ref repo" The check may not be working as intended, causing premature deletion of reference repositories
1 parent f799260 commit ba2fb02

1 file changed

Lines changed: 1 addition & 33 deletions

File tree

Jenkinsfile

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -62,44 +62,12 @@ def cloneUpdateRefRepo() {
6262
echo "rocm-libraries repo exists at ${refRepoPath}, performing git remote update..."
6363
echo "locking on label: ${lockLabel}"
6464
lock(lockLabel) {
65-
// Sanity check: detect corrupt refs that would break git fetch
66-
int showRefStatus = sh(
67-
script: """
68-
set +e
69-
cd ${refRepoPath}
70-
git show-ref > /dev/null 2>&1
71-
echo \$? > .git/.last-show-ref-status
72-
""",
73-
returnStatus: true,
74-
label: "pre-update ref sanity check"
75-
)
76-
77-
def showRefExit = sh(
78-
script: "cat ${refRepoPath}/.git/.last-show-ref-status || echo 1",
79-
returnStdout: true
80-
).trim() as Integer
81-
82-
if (showRefExit != 0) {
83-
echo "Ref repo at ${refRepoPath} appears corrupt (git show-ref failed). Recreating mirror clone..."
84-
sh(
85-
script: """
86-
set -ex
87-
rm -rf ${refRepoPath}
88-
mkdir -p ${refRepoPath}
89-
git clone --mirror https://github.com/ROCm/rocm-libraries.git ${refRepoPath}
90-
""",
91-
label: "reclone ref repo after corruption"
92-
)
93-
}
94-
9565
def fetchCommand = """
9666
set -ex
9767
cd ${refRepoPath}
9868
git remote prune origin
99-
git remote update --prune
100-
git fsck --no-progress --connectivity-only
69+
git remote update
10170
"""
102-
10371
sh(script: fetchCommand, label: "update ref repo")
10472
}
10573
echo "Completed git ref repo fetch, lock released"

0 commit comments

Comments
 (0)