Skip to content

Commit 86cf831

Browse files
committed
Improve error handling when forking fails
Related ticket: https://progress.opensuse.org/issues/187356
1 parent 9cac153 commit 86cf831

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

_common

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,11 @@ log-warn() (
407407
colorize "err" "WARNING" "[warn] $*"
408408
)
409409

410+
log-error() (
411+
set +x
412+
colorize "err" "ERROR" "[error] $*"
413+
)
414+
410415
debug_osc() (
411416
set +x
412417
log-debug "### osc $*"

os-autoinst-obs-auto-submit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ make_git_submit_request() {
102102
# For `git push` to work (done below) you need to deploy an SSH key on the Gitea instance.
103103
# Checkout https://opensuse-commander.readthedocs.io/en/latest/git-obs-quickstart.html for details.
104104
forked_repo=$($git_obs repo fork "pool/$package" 2>&1 > /dev/null | perl -ne 'print for /Fork .*: (.*)/g')
105+
if [[ -z $forked_repo ]]; then
106+
log-error "Unable to create fork, try to run 'git-obs repo fork pool/$package' manually for debugging"
107+
[[ -e $HOME/.config/tea/config.yml ]] || \
108+
log-info "Also, be sure you have followed https://opensuse-commander.readthedocs.io/en/latest/git-obs-quickstart.html"
109+
return 1
110+
fi
105111

106112
# enter a working copy of the fork and switch to the branch the submission should be based on
107113
$git_obs repo clone --no-ssh-strict-host-key-checking "$forked_repo" || return $?

0 commit comments

Comments
 (0)