Skip to content

Fix Web IDE usage counter (2nd attempt)

Issue: #555387+

What does this MR do and why?

NOTICE This Merge Request was previously submitted and merged !197964 (merged) then it was reverted !198732 (merged) due to a bug report: gitlab-org/charts/gitlab#6098 (closed). The REST API Commit endpoint sent an HTTP 500 Error response when the HTTP Request was authenticated using a Personal Access Token and the token was included in the Authorization header.

This Merge Request implements a regression test to catch this scenario.

Original description

This change modifies how GitLab tracks when users create code commits through the Web IDE (a browser-based code editor).

The updated logic checks three conditions before recording usage: there must be a valid authentication token, the Web IDE application must be properly configured in the system, and the token must belong specifically to the Web IDE application (not just any application).

why The Web IDE doesn't authenticate HTTP requests to the REST API using the session cookie anymore. It uses OAuth2 tokens and the requests originate on a separate domain as well therefore the session cookie is not available.

References

Screenshots or screen recordings

This change doesn't introduce user-facing changes.

How to set up and validate locally

There aren't behavior changes in this MR.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading