Menu

1 / 2

From a 500 to a real error: validating comment length across 9 GitLab GraphQL mutations

DEV Community: gitlab·Priyanshu Jha·3 days ago
#CA07LUIr
#devtogitlab#devto#dev#graphql#gitlab
Reading 0:00
15s threshold

Here's a bug you've probably shipped yourself. The model has a validation, the API docs mention the limit, and the API never checks it. Everything works until someone sends input that's too long, and then the user gets "Internal server error" instead of a message they can act on.

This is the story of gitlab-org/gitlab!269616 . It added a length check to the comment argument of nine GraphQL mutations in GitLab's vulnerability management, and it went through four rounds of CI fixes and review. The MR touched 20 files, most of them specs and generated docs.

The issue: a documented limit nobody enforced

The issue was gitlab-org/gitlab#637728 , opened by Lorenz van Herwaarden. It started with a GitLab Duo review comment on an earlier MR.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.