Frontend sends unsupported includeForked parameter to blobSearch GraphQL query

Summary

Frontend code in scope_sidebar_navigation.vue is sending an unsupported includeForked parameter to the blobSearch GraphQL query, causing GraphQL errors since the backend only accepts excludeForks.

Related to: 2026-02-14: GraphQL query error rate violating ... (gitlab-com/gl-infra/production#21292 - closed) - GraphQL query error rate violating SLO in main stage
Severity: High - Causing 0.6035% GraphQL error rate in production

Steps to reproduce

  1. Navigate to GitLab global search (no group/project context)
  2. Open browser DevTools → Network tab
  3. Perform a blob/code search
  4. Inspect the blobSearch GraphQL request payload

What is the current bug behavior?

The frontend sends a GraphQL query with the unsupported parameter:

{
  search: "test",
  chunkCount: 5,
  groupId: undefined,
  projectId: undefined,
  includeArchived: false,
  includeForked: false,  // ❌ Unsupported parameter
  regex: false
}

Result: Backend rejects the request with a GraphQL error because includeForked is not a valid argument for blobSearch.

What is the expected correct behavior?

The frontend should send the correct parameter:

{
  search: "test",
  chunkCount: 5,
  groupId: undefined,
  projectId: undefined,
  includeArchived: false,
  excludeForks: true,  // ✅ Correct parameter
  regex: false
}

Result: Backend accepts the request and returns search results successfully.

Root Cause

This is a parameter mismatch between the Vue component and the GraphQL query/backend:

  1. GraphQL Query (blob_search_zoekt_count_only.query.graphql line 8) declares:

    $excludeForks: Boolean
  2. Backend (blob_search_resolver.rb line 15) accepts:

    argument :exclude_forks, GraphQL::Types::Boolean, required: false, default_value: true
  3. BUT Frontend (scope_sidebar_navigation.vue line 35) passes:

    includeForked: parseBoolean(this.query.include_forked),  // ❌ Wrong parameter!

Timeline

  • May 13, 2025 (commit d674115dc1c4): GraphQL query updated to use excludeForks
  • May 21, 2025 (commit 67a94f91248d): Backend removed include_forked parameter
  • BUT: scope_sidebar_navigation.vue was never updated
  • Feb 12, 2026: Deployed to production → Incident began

Relevant logs and/or screenshots

Error in production:

  • GraphQL error rate: 0.6035%
  • Alert: ApiServiceGraphqlQueryErrorSLOViolation
  • Source: Small number of customers from two remote IP addresses

GraphQL Error Message:

Field 'includeForked' doesn't exist on type 'Query.blobSearch'

Possible fixes

Fix Location

File: app/assets/javascripts/search/sidebar/components/scope_sidebar_navigation.vue

Line 35 - Change:

includeForked: parseBoolean(this.query.include_forked),

To:

excludeForks: parseBoolean(this.query.exclude_forks),

Rationale:

  • The UI filter (forks_filter/index.vue) writes exclude_forks to URL query params
  • The GraphQL query expects excludeForks
  • The backend accepts exclude_forks
  • All use the same semantics (no logic inversion needed)

Test Updates

File: spec/frontend/search/sidebar/components/scope_sidebar_navigation_spec.js

Lines 153 and 177 - Change:

includeForked: false,

To:

excludeForks: true,

Why Tests Didn't Catch This

The unit tests were validating the wrong behavior. They expected includeForked to be sent:

it('makes graphql query with correct variables for group search', () => {
  expect(blobCountHandler).toHaveBeenCalledWith({
    // ...
    includeForked: false,  // ❌ Test expects wrong parameter
    // ...
  });
});

The tests passed even though the code was sending an unsupported parameter!

Additional Context

Related MRs:

  • !222813 (merged) - Removed orphaned feature flag but missed this issue
  • Original conversion MR that updated GraphQL query but missed Vue component

Incident Reference:

  • INC-7434 - GraphQL query error rate violating SLO in main stage
  • Slack: #inc-7434-graphql-query-error-rate-violating-slo-in-main-stage
  • Runbook: https://runbooks.gitlab.com/api/#alerts

Files Affected:

  • app/assets/javascripts/search/sidebar/components/scope_sidebar_navigation.vue (needs fix)
  • spec/frontend/search/sidebar/components/scope_sidebar_navigation_spec.js (needs fix)

Related Files (for context):

  • app/assets/javascripts/search/graphql/blob_search_zoekt_count_only.query.graphql (already correct)
  • ee/app/graphql/resolvers/search/blob/blob_search_resolver.rb (already correct)
  • app/assets/javascripts/search/sidebar/components/forks_filter/index.vue (already correct)
Assignee Loading
Time tracking Loading