Skip to content

Log when deprecated Jira DVCS endpoints are hit

What does this MR do and why?

This MR introduces logging when the deprecated Jira DVCS endpoints are hit.

This will allow us to gather data about who is using the endpoints.

QA

To make it easier, comment out the authentication of the Jira user agent:

diff --git a/lib/api/v3/github.rb b/lib/api/v3/github.rb
index 7348ed612fce..11359528e743 100644
--- a/lib/api/v3/github.rb
+++ b/lib/api/v3/github.rb
@@ -29,7 +29,7 @@ class Github < ::API::Base
       feature_category :integrations

       before do
-        authorize_jira_user_agent!(request)
+        # authorize_jira_user_agent!(request)
         authenticate!
         reversible_end_of_life!
       end

Tail the integrations_json.log file:

tail -f log/integrations_json.log

Make the following curl request (replace <YOUR TOKEN> with a PAT for your local user):

curl --location 'http://gdk.test:3000/api/v3/user/repos?private_token=<YOUR TOKEN>'

You should not see a new log appear.

Enable the flag:

Feature.enable(:jira_dvcs_end_of_life_amnesty)

Make the curl request again.

You should see a log appear (note, sometimes due to caching of flag the flag might not enable immediately, just try again in a few seconds).

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #362168 (closed)

Edited by Luke Duncalfe

Merge request reports