]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
script: ceph-backport.sh adds redmine key to api requests 63565/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 28 May 2025 20:33:44 +0000 (16:33 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 28 May 2025 20:33:48 +0000 (16:33 -0400)
the ceph-backport.sh script recently started failing with:

> ceph-backport.sh: DEBUG: Considering Redmine issue: https://tracker.ceph.com/issues/70374 - is it in the Backport tracker?
> ceph-backport.sh: DEBUG:
> ceph-backport.sh: ERROR: Issue https://tracker.ceph.com/issues/70374 is not a Backport

because the command `curl --silent https://tracker.ceph.com/issues/70374.json`
now fails with `HTTP/2 401` (Unauthorized) and returns an empty string

the command succeeds after adding my redmine key as a query param like
some of the other redmine requests

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/script/ceph-backport.sh

index 80c4ecb087b5c8d6f822eae453cf709cd1f61266..4aa4ef55059e751620f69304727d1f2f341ba81a 100755 (executable)
@@ -917,7 +917,7 @@ function number_to_url {
 
 function populate_original_issue {
     if [ -z "$original_issue" ] ; then
-        original_issue=$(curl --silent "${redmine_url}.json?include=relations" |
+        original_issue=$(curl --silent "${redmine_url}.json?include=relations&key=$redmine_key" |
             jq '.issue.relations[] | select(.relation_type | contains("copied_to")) | .issue_id')
         original_issue_url="$(number_to_url "redmine" "${original_issue}")"
     fi
@@ -926,7 +926,7 @@ function populate_original_issue {
 function populate_original_pr {
     if [ "$original_issue" ] ; then
         if [ -z "$original_pr" ] ; then
-            original_pr=$(curl --silent "${original_issue_url}.json" |
+            original_pr=$(curl --silent "${original_issue_url}.json?key=$redmine_key" |
                           jq -r '.issue.custom_fields[] | select(.id | contains(21)) | .value')
             original_pr_url="$(number_to_url "github" "${original_pr}")"
         fi
@@ -1553,7 +1553,7 @@ fi
 redmine_url="$(number_to_url "redmine" "${issue}")"
 debug "Considering Redmine issue: $redmine_url - is it in the Backport tracker?"
 
-remote_api_output="$(curl --silent "${redmine_url}.json")"
+remote_api_output="$(curl --silent "${redmine_url}.json?key=$redmine_key")"
 debug $remote_api_output
 tracker="$(echo "$remote_api_output" | jq -r '.issue.tracker.name')"
 if [ "$tracker" = "Backport" ]; then