|
|
|
@ -11,7 +11,7 @@ set -eu
|
|
|
|
|
|
|
|
|
|
readonly PROGNAME=`/usr/bin/basename $0`
|
|
|
|
|
readonly PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
|
|
|
|
|
readonly REVISION="1.3.0"
|
|
|
|
|
readonly REVISION="1.3.2"
|
|
|
|
|
|
|
|
|
|
repo=""
|
|
|
|
|
login_old=""
|
|
|
|
@ -46,7 +46,6 @@ INFORMATION
|
|
|
|
|
- issue-ids are checked; titles are not checked
|
|
|
|
|
- assignments in new repo are checked
|
|
|
|
|
- the --wait time slows down the script to reduce e-mail-sending-speed
|
|
|
|
|
- the title is not fetched due to complications with tea and "quotes"
|
|
|
|
|
- Troubleshooting
|
|
|
|
|
- "Error: could not edit issue:"
|
|
|
|
|
- please check, if the assigned person(s) have the right to be assigned (are they in the Organisation? Collaborators?)
|
|
|
|
@ -71,7 +70,7 @@ INSTALLATION AND PREPARATION
|
|
|
|
|
USAGE
|
|
|
|
|
SWITCHES
|
|
|
|
|
-h | --help print this help
|
|
|
|
|
-c | --colour disable colour output
|
|
|
|
|
-c | --colour | --color disable colour output
|
|
|
|
|
--GO stop dry mode
|
|
|
|
|
|
|
|
|
|
PARAMETERS
|
|
|
|
@ -99,7 +98,7 @@ checkCommand()
|
|
|
|
|
# PARAMETERS
|
|
|
|
|
#
|
|
|
|
|
if [[ "$@" == "" ]] ; then error_in_or_out_not_specified ; fi
|
|
|
|
|
readonly TEMP=$(getopt -o h,r:o:n:w:c --long help,GO,colour,repo:,login_old:,login_new:,wait: -n "${PROGNAME}" -- "$@")
|
|
|
|
|
readonly TEMP=$(getopt -o h,r:o:n:w:c --long help,GO,colour,color,repo:,login_old:,login_new:,wait: -n "${PROGNAME}" -- "$@")
|
|
|
|
|
eval set -- "${TEMP}"
|
|
|
|
|
while true ; do
|
|
|
|
|
case "$1" in
|
|
|
|
@ -107,7 +106,7 @@ while true ; do
|
|
|
|
|
print_help
|
|
|
|
|
exit 0
|
|
|
|
|
;;
|
|
|
|
|
--colour|-c)
|
|
|
|
|
--colour|--color|-c)
|
|
|
|
|
use_colour=false
|
|
|
|
|
;;
|
|
|
|
|
--repo|-r)
|
|
|
|
@ -160,8 +159,8 @@ checkCommand tr
|
|
|
|
|
|
|
|
|
|
# check access and get data
|
|
|
|
|
echo "# checking access to OLD (\"$login_old\") and NEW (\"$login_new\")"
|
|
|
|
|
readonly json_old=$(tea issues list --output json --login "$login_old" --repo "$repo" --state all --fields index,author,assignees)
|
|
|
|
|
readonly json_new=$(tea issues list --output json --login "$login_new" --repo "$repo" --state all --fields index,author,assignees)
|
|
|
|
|
readonly json_old=$(tea issues list --output json --login "$login_old" --repo "$repo" --state all --limit 99999 --fields index,author,assignees)
|
|
|
|
|
readonly json_new=$(tea issues list --output json --login "$login_new" --repo "$repo" --state all --limit 99999 --fields index,author,assignees)
|
|
|
|
|
|
|
|
|
|
echo "# running consistency checks"
|
|
|
|
|
readonly json_old_ids=$(echo "$json_old" | jq ".[] | .index" | sort -n)
|
|
|
|
@ -185,7 +184,7 @@ echo "# processing data"
|
|
|
|
|
while IFS="¬"; read -r index author assignees; do
|
|
|
|
|
assignees=$(echo "$assignees" | tr ' ' ,)
|
|
|
|
|
|
|
|
|
|
echo "… #$index - by \"$author\" assigned to \"$assignees\""
|
|
|
|
|
echo -n "… #$index - by \"$author\" assigned to \"$assignees\""
|
|
|
|
|
|
|
|
|
|
# comment for the original author
|
|
|
|
|
if [ $dry_run = false ]; then
|
|
|
|
@ -193,25 +192,19 @@ while IFS="¬"; read -r index author assignees; do
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# assignment
|
|
|
|
|
t="OK"
|
|
|
|
|
if [[ -n $assignees ]]; then
|
|
|
|
|
if [ $dry_run = false ]; then
|
|
|
|
|
tea issue edit --login "$login_new" --repo "$repo" --add-assignees "$assignees" "$index" >/dev/null
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
t="OK"
|
|
|
|
|
else
|
|
|
|
|
t="OK (no assignee)"
|
|
|
|
|
fi
|
|
|
|
|
if [ $use_colour = true ]; then
|
|
|
|
|
echo -e " → \e[1m\e[48;5;22m$t\e[0m"
|
|
|
|
|
else
|
|
|
|
|
echo " → $t"
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
t="INFO: added comment, no assignee"
|
|
|
|
|
if [ $use_colour = true ]; then
|
|
|
|
|
echo -e " → \e[1m\e[48;5;172m$t\e[0m"
|
|
|
|
|
else
|
|
|
|
|
echo -e " → $t"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
sleep $wait_time
|
|
|
|
|
|
|
|
|
|