Skip to content

Log project_id and project_path if present in authentication failures

Stan Hu requested to merge sh-log-project-auth-failures into main

In gitlab-org/gitlab-vscode-extension#758 (closed), I noticed recently that many of my code suggestions were failing with Forbidden by auth provider error messages. This appears to happen when the VSCode extension doesn't have an association between the GitLab project and the repository. As a result, project_id was -1, and project_path was blank.

The Model Gateway doesn't actually care about those values, but it seems that the VSCode extension may be attempting to use Code Suggestions even though the project wasn't associated.

That made me wonder if that's the most common authentication failure mode here. This commit logs the values as meta.project_id and meta.project_path when an authentication error occurs to see if this is a common problem.

Edited by Stan Hu

Merge request reports