Backport of 'Stop traversing full dependency graph on ingestion' into 19.4
What does this MR do and why?
This MR backports !257733 (merged) to 19.4. It is one commit with the message of the default branch squash commit f2be9201. The 19.5 backport is !267009 (merged).
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.
The cherry-pick had conflicts only in the description of the fast_dependency_paths_enabled API parameter, in ee/lib/api/project_security_settings.rb and doc/api/openapi/openapi_v3.yaml, because 19.4 has older wording for it. I kept the 19.4 wording of the other parameters and took the new description for fast_dependency_paths_enabled. openapi_v3.yaml was regenerated with rake gitlab:openapi:v3:generate, which also renames one generated request body schema. The resulting path_finder.rb, build_dependency_graph.rb, graph_path.rb, path_finder_spec.rb and build_dependency_graph_spec.rb are identical to 19.5 after !267009 (merged).
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. A GitLab Dedicated customer on 19.4 is affected (INC-15911). !257733 (merged) is deployed to GitLab.com (first production deploy on 2026-10-30).
This is the third of three 19.4 backports for #593156 (closed). This MR is stacked on the second, the !257548 (merged) backport (!267603 (merged)). The first, the !257547 (merged) backport (!267578 (merged)), is merged. Merge !267603 (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-4-stable-ee at ad668d36 (on top of the !257547 (merged) and !257548 (merged) backports):
| 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), graph_path_spec |
159 examples, 0 failures, 6 pending |
rubocopon the changed files reports no offenses.rake gitlab:openapi:v3:check_docsreports that the OpenAPI docs are up to date.git grep dependency_paths_top_level_ancestors_from_direct_edgesreturns no results.
Pushed with all pre-push hooks passing. The hooks in lefthook.yml compute their file list from git merge-base origin/master HEAD, so on a stable branch they would lint every file where 19.4 differs from master. A local, gitignored lefthook-local.yml pointed that merge base at origin/19-4-stable-ee instead, so the hooks checked only this change. The push was made from a worktree outside the main GDK checkout, so RuboCop used only the 19.4 cops and configuration.
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
- severity label and bug subtype labels (if applicable)
- If this MR fixes a bug that affects customers, the customer label has been applied.
- This MR has been approved by a maintainer (only one approval is required).
- Ensure the
E2E Omnibus GitLab EEpipeline (triggered by thee2e:test-on-omnibus-eejob) 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:
- Refer to the patch release runbook for engineers and maintainers for guidance.
- Ask questions on the
#releasesSlack channel (internal only). - Once the backport has been merged, the commit changes will be automatically deployed to a release environment that can be used for manual validation. See after merging runbook for details.