Backport of 'Add traversal_path sbom_component_versions to CH' to 19.2
What does this MR do and why?
Backport of !245559 (merged) ("Add traversal_path sbom_component_versions to CH", merged to master as 1acf752c).
GitLab Knowledge Graph (gkg 0.91 and later) selects and orders by traversal_path on siphon_sbom_component_versions when it builds the has_vulnerability edge. On 19.2 that table exists without the column, so the query dies:
Code: 47. DB::Exception: Unknown expression or function identifier
`traversal_path` ... FROM siphon_sbom_component_versionsThe blast radius is wider than SBOM data. The per-minute incremental dispatch runs every entity in one UNION ALL statement, so one unknown identifier fails the whole statement and no entity indexes incrementally. Only the hourly sweep survives, taking indexing freshness from one minute to one hour. Dedicated tenants on 19.2 cannot index SBOM data into the Knowledge Graph at all.
This recreates the table with the column (organization-scoped, populated from organization_traversal_paths_dict, which already exists on 19.2) and adds the siphon_sbom_component_versions_pg_pkey_ordered lookup table plus its materialized view for dedup.
One operational note for the release: the migration is DROP + CREATE, so existing rows in that table are discarded and Siphon does not re-snapshot automatically.
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:test-on-omnibus-eejob has succeeded, or if it has failed, 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.