Capture and log entire error message for dev_info request in Jira integration

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

Currently, we do not log the entire error message returned by Jira server/cloud when a dev_info request is denied. Capturing the entire message and logging it will help understand the real reason why the request was denied. Current log only seems to capture the response headers.

Steps to reproduce

  1. Use a bad token for integration. I was using GitLab for Jira app with an expired token and Jira cloud.
  2. Push some commits to trigger some updates on Jira.
  3. Check integrations_json.log.

Example Project

What is the current bug behavior?

What is the expected correct behavior?

Relevant logs and/or screenshots

integrations_json.log

{"severity":"INFO","time":"2022-06-29T04:26:07.869Z","correlation_id":"redacted","message":"response from jira dev_info api","integration":"JiraConnect","project_id":124,"project_path":"<redacted>","jira_response":"{\"date\":[\"Wed, 29 Jun 2022 04:32:58 GMT\"],\"content-type\":[\"text/html;charset=ISO-8859-1\"],\"server\":[\"globaledge-envoy\"],\"timing-allow-origin\":[\"*\"],\"x-envoy-upstream-service-time\":[\"65\"],\"expect-ct\":[\"report-uri=\\\"https://web-security-reports.services.atlassian.com/expect-ct-report/atlassian-proxy\\\", max-age=86400\"],\"strict-transport-security\":[\"max-age=63072000; preload\"],\"x-content-type-options\":[\"nosniff\"],\"x-xss-protection\":[\"1; mode=block\"],\"atl-traceid\":[\"<redacted>\"],\"report-to\":[\"{\\\"group\\\": \\\"endpoint-1\\\", \\\"max_age\\\": 600, \\\"endpoints\\\": [{\\\"url\\\": \\\"https://<redacted>.cloudfront.net\\\"}], \\\"include_subdomains\\\": true}\"],\"nel\":[\"{\\\"report_to\\\": \\\"endpoint-1\\\", \\\"max_age\\\": 600, \\\"include_subdomains\\\": true, \\\"failure_fraction\\\": 0.001}\"],\"vary\":[\"Accept-Encoding\"],\"connection\":[\"close\"],\"transfer-encoding\":[\"chunked\"]}"}

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by 🤖 GitLab Bot 🤖