Repository navigation
fix(code-reviews): route wrapped GitLab PrAT permission errors to Maintainer guidance and stop error-level Sentry capture for action-required failures - #9111
Draft
kfab-cloud[bot] wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When GitLab refuses Project Access Token creation for permission reasons, prepareReviewPayload throws the intended repo-named Maintainer-role guidance, with no raw numeric project id. The dispatcher keeps classifying it as gitlab_project_access_required, failing the review, disabling Code Reviewer, and emailing the owner just as quickly as today. Failures that already classify as action-required are no longer reported to Sentry at error level from prepareReviewPayload. They are still logged, and unclassified failures are still captured.
Why
Sentry KILOCODE-WEB-1RFS (1373 lifetime occurrences, still happening) reports "Failed to create Project Access Token for GitLab code review on <repo>. Error: Cannot create bot token for project 34. You need Maintainer role or higher." from POST /api/webhooks/gitlab → tryDispatchPendingReviews → dispatchReservedReview → prepareReviewPayload. The cause is on the customer side: the connected GitLab credential does not have the Maintainer role, so GitLab returns 403 when we try to create a Project Access Token. The product already handles this. The dispatcher classifies the message as gitlab_project_access_required, fails the review, disables Code Reviewer, and emails the owner. Two code defect…
Planned changes
Some details are abbreviated; see the full plan.
Full plan: https://github.com/Kilo-Org/cloud/blob/kfab/plan/planning-6d908b13-59ef-4fd1-b5b7-f218ce226aee/.plans/kfab/planning-6d908b13-59ef-4fd1-b5b7-f218ce226aee/plan.md
Source issue: #9109
Closes #9109
Factory-managed planning specification. This draft PR contains no product source and is not approval or implementation.