Commit 37995c2a authored by Aral Balkan's avatar Aral Balkan

Updated submit so that it displays links to the merge request, comparison, and...

Updated submit so that it displays links to the merge request, comparison, and issue (as better/stat does).
parent 6c907cfd
......@@ -77,7 +77,7 @@ jsonProperty(){
hello(){
echo "\nPreparing to save ${domain} in ${category} with commit message ‘${commitMessage}\n"
echo "\nPreparing to submit a merge request for ${domain} in ${category}\n"
}
......@@ -193,6 +193,18 @@ openMergeRequest(){
# Initially, all merge requests are assigned to me (Aral, id=1). We can review this as we go, if necessary.
local response=$(curl --silent -X POST --header "PRIVATE-TOKEN: ${privateToken}" https://source.ind.ie/api/v3/projects/$contentRepositoryID/merge_requests --data-urlencode "source_branch=${branchName}" --data-urlencode "target_branch=master" --data-urlencode "assignee_id=1" --data-urlencode "title=${issueTitle} Closes #${issueIID}." --data-urlencode "description=${mergeMessage}")
#
# Display the merge request details so that if an admin has entered it, she can immediately
# accept it if she wantß to without having to first run better/stat.
#
iid=$(jsonProperty "$response" 'iid')
echo "\n · Details:\n"
echo " · Request: https://source.ind.ie/better/content/merge_requests/${iid}"
echo " · Compare: https://source.ind.ie/better/content/compare/master...source.ind.ie/better/content/issues/${issueIID}"
echo " · Issue: https://source.ind.ie/better/content/issues/${issueIID}"
# TODO: Check response for failure and alert the person.
# TODO: Should we be checking for existing merge requests and support updating of merge requests?
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment