Skip to content

Send X-Gitlab-Realm header to AI gateway

Matthias Käppler requested to merge mk-realm-header into master

What does this MR do and why?

In order to split SaaS from self-managed traffic when requesting code suggestions, we are currently tracking a gitlab-realm field in the AI service access token payload. We did this because in the first iteration, IDEs would go straight to this service without going through their respective Rails instances first.

Since this has changed and we now want IDEs to target Rails instead, it is simpler and easier to work with an HTTP header field sent by gitlab-rails to the AI service instead. The header field added is X-Gitlab-Realm. It can be used for tracking events like these: gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!282 (merged)

We need to maintain the token field for now since we will allow the old access path for a while longer.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

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

Edited by Matthias Käppler

Merge request reports