Skip to content

Commit

Permalink
YETUS-1218. locate_patch falsely succeeds (#320)
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Dimiduk <[email protected]>
  • Loading branch information
aw-was-here authored Sep 12, 2023
1 parent 6f499b6 commit 6189c9a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
12 changes: 9 additions & 3 deletions precommit/src/main/shell/core.d/patchfiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,14 @@ function locate_patch
"${PATCH_OR_ISSUE}" \
"${INPUT_PATCH_FILE}" \
"${INPUT_DIFF_FILE}"; then
gotit=true
PATCH_SYSTEM=${bugsys}
if [[ -f "${INPUT_PATCH_FILE}" || -f "${INPUT_DIFF_FILE}" ]]; then
gotit=true
PATCH_SYSTEM=${bugsys}
else
# this situation can happen if the bugsystem forced a full build
# so not an error.
yetus_debug "Bugsystem ${bugsys} did not actually download a change."
fi
fi
fi
# did the bug system actually make us change our mind?
Expand All @@ -168,7 +174,7 @@ function locate_patch
# ok, none of the bug systems know. let's see how smart we are
if [[ ${gotit} == false ]]; then
if ! generic_locate_patch "${PATCH_OR_ISSUE}" "${INPUT_PATCH_FILE}"; then
yetus_error "ERROR: Unsure how to process ${PATCH_OR_ISSUE}."
yetus_error "ERROR: Unsure how to process ${PATCH_OR_ISSUE}. Permissions missing?"
cleanup_and_exit 1
fi
PATCH_SYSTEM=generic
Expand Down
2 changes: 2 additions & 0 deletions precommit/src/main/shell/plugins.d/github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,11 @@ function github_locate_patch
case "${input}" in
GHSHA:*)
github_locate_sha_patch "${input}" "${patchout}" "${diffout}"
return $?
;;
*)
github_locate_pr_patch "${input}" "${patchout}" "${diffout}"
return $?
;;
esac
}
Expand Down
2 changes: 2 additions & 0 deletions precommit/src/main/shell/plugins.d/gitlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,11 @@ function gitlab_locate_patch
case "${input}" in
GLSHA:*)
gitlab_locate_sha_patch "${input}" "${patchout}" "${diffout}"
return $?
;;
*)
gitlab_locate_mr_patch "${input}" "${patchout}" "${diffout}"
return $?
;;
esac
}
Expand Down

0 comments on commit 6189c9a

Please sign in to comment.