feat(ontology): add PackageFile node and package-file edges

What does this MR do and why?

Completes Phase 2 of Orbit package-registry coverage. The package-file replication tables already stream into ClickHouse, but nothing in the graph consumed them, so package files were invisible. This adds the package-file entity plus its links to the owning package and to the pipeline that produced it. That gives file-level provenance — for example, which specific artifact came out of a given pipeline — and turns already-replicated, dormant data into queryable graph entities. No change to existing graph entities.

Relates to gitlab-org/gitlab#601009 (closed)

Testing

mise ontology:validate passes. Full ontology + indexer suites pass (142 + 431); the new node and edges flow through the plan builder exercised by the every-plan-renders-valid-SQL test. mise schema:generate:ddl diff is limited to the new gl_package_file table plus the version-prefix bump.

Performance Analysis

Additive only: one new node table and two edges materialized from data that is already replicated. No change to any existing entity's extract or storage.

  • This merge request does not introduce any performance regression.
Agent context — long-form analysis

Background

Phase 2's CDC tables (siphon_packages_package_files, siphon_packages_package_file_build_infos) merged earlier but the ontology half never shipped, so the data replicated with no consumer. This is the ontology half; it needs no Rails change because package_file is already registered in the EE redaction service (EE_RESOURCE_CLASSES), so the node returns rows rather than failing closed.

Changes

  • PackageFile node (config/ontology/nodes/packages/package_file.yaml) — sourced from siphon_packages_package_files; properties file_name, size, file_sha256, status (enum: default / pending_destruction / processing / error), created_at, project_id, traversal_path. Redaction resource_type: package_file, ability: read_package.
  • HAS_PACKAGE_FILE edge (config/ontology/edges/has_package_file.yaml) — Package → PackageFile via the package_id foreign key (an incoming FK edge on the node's etl.edges, same shape as HAS_JOB). Registered in schema.yaml.
  • File-level BUILT_BY — a second variant on the existing built_by.yaml (PackageFile → Pipeline), sourced from the siphon_packages_package_file_build_infos join table, alongside the existing Package → Pipeline variant. Same verb/semantic, so no new relationship kind.
  • PackageFile registered under packages.nodes in schema.yaml; SCHEMA_VERSION 75 → 76; config/graph.sql / config/graph_local.sql regenerated.

Naming

HAS_FILE was already taken by an unrelated code-review edge (MergeRequestDiff → MergeRequestDiffFile), so the package containment edge is HAS_PACKAGE_FILE to avoid overloading one relationship kind across domains.

New traversals unlocked

  • Package → HAS_PACKAGE_FILE → PackageFile — the files that make up a package.
  • PackageFile → BUILT_BY → Pipeline — per-artifact (SBOM-style) provenance.
  • PackageFile → IN_PROJECT → Project.

Files

  • config/ontology/nodes/packages/package_file.yaml (new)
  • config/ontology/edges/has_package_file.yaml (new)
  • config/ontology/edges/built_by.yaml (variant + ETL entry)
  • config/ontology/schema.yaml (node + edge registration)
  • config/SCHEMA_VERSION, config/graph.sql, config/graph_local.sql (regenerated)

Merge request reports

Loading
Loading