Backport of 'Stop traversing full dependency graph on ingestion' into 19.5

What does this MR do and why?

This MR backports !257733 (merged) to 19.5. It is one commit with the message and the diff of the default branch squash commit f2be9201.

The graph build now writes only the direct edges to sbom_graph_paths. Sbom::PathFinder reads top-level ancestors from these edges, and the dependency_paths_top_level_ancestors_from_direct_edges flag is removed. The build no longer does the exponential route search in exhaustive mode. The fast_dependency_paths_enabled setting no longer changes the build.

On 19.5 the flag is off by default (!265512 (merged) adds it). After this backport, every instance uses the direct-edge lookup.

This is part of the fix for #593156 (closed) (severity1). On large dependency graphs, Sbom::BuildDependencyGraphWorker jobs run for hours and block other Sidekiq jobs. This affects GitLab Dedicated and self-managed instances. !257733 (merged) is deployed to GitLab.com (first production deploy on 2026-10-30).

This is the third of three backports for #593156 (closed). The first is !262206 (merged), which is merged. This MR is stacked on the second, !265512 (merged). Merge !265512 (merged) first. After that, this MR shows only the !257733 (merged) change.

Testing

On a GDK sandbox, with RAILS_ENV=test, with this change applied to 19-5-stable-ee at 78cb54d1. The merge into the current 19-5-stable-ee (3360899a) has no conflicts.

Spec Result
path_finder_spec, build_dependency_graph_spec, build_dependency_graph_worker_spec, dependency_paths_resolver_spec, project_security_settings_spec (request), project_security_setting_spec (model) 153 examples, 0 failures, 6 pending

The 6 pending examples are the shared granular token permission examples, which skip themselves.

  • rubocop on the changed files reports no offenses.
  • rake gitlab:openapi:v3:check_docs reports that the OpenAPI docs are up to date.
  • git grep dependency_paths_top_level_ancestors_from_direct_edges returns no results.

Pushed with pre-push hooks skipped (LEFTHOOK=0). The hooks in lefthook.yml compute their file list from git merge-base origin/master HEAD, so on a stable branch they lint every file where 19.5 differs from master. The checks that apply to this change ran on a GDK sandbox instead (see Testing).

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

  • This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
  • The MR that fixed the bug on the default branch has been deployed to GitLab.com (not applicable for documentation or spec changes).
  • The MR title is descriptive (e.g. "Backport of 'title of default branch MR'"). This is important, since the title will be copied to the patch blog post.
  • Required labels have been applied to this merge request
  • This MR has been approved by a maintainer (only one approval is required).
  • Ensure the E2E Omnibus GitLab EE pipeline (triggered by thee2e:test-on-omnibus-ee job) has succeeded. If it has failed (or shows warnings), investigate the failures. If you determine the failures are unrelated, you may proceed. If you need assistance investigating, request help in the #s_developer_experience Slack channel to confirm the failures are unrelated to the merge request.

Note to the merge request author and maintainer

If you have questions about the patch release process, please:

Edited by Lucas Charles

Merge request reports

Loading
Loading