[Knowledge Graph] Publish Rust Crate

Problem to Solve: Sharing Rust Crates Across Knowledge Graph Projects

The Knowledge Graph initiative requires sharing of core Rust libraries—specifically, the Gitalisk (Repository Service v2) (&17515) and One Parser (gitlab-code-parser) (&17516) projects—across multiple downstream consumers, most notably the Knowledge Graph Core Indexer (&17517) crate.

Context

  • The Knowledge Graph architecture is composed of several Rust crates, each living in its own repository:
  • These crates may also need to be consumed by other projects (e.g., CLI tools, server-side workers, language server extensions).
  • Ideally, we can have:
    • Reproducible builds
    • Cross-team collaboration
    • Automated CI/CD and release management
    • (bonus) Enabling external contributors and open-source adoption

Investigation: Solution Options

We need to investigate and decide on the best approach(es) for sharing and consuming Rust crates across GitLab projects. Options include:

  1. Git dependencies with tags

    • Pros: Works today, supports workspaces, no registry setup required.
    • Cons: Limited discoverability, manual tag management, not ideal for open-source or wide adoption.
  2. GitLab Cargo Registry

    • Pros: Registry-style workflow, versioning, discoverability, and access control.
    • Cons: Not yet production-ready.
  3. crates.io

    • Pros: Standard for open-source Rust, best for community adoption.
    • Cons: Requires GitHub login for publishing, public by default.
  4. Other workarounds (e.g., gitlab-cargo-shim, generic registry scripts)

    • Pros: Can enable private/internal registry-like workflows.
    • Cons: Extra setup, not standard

Next Steps

  • Investigate the requirements, pros, and cons of each option for sharing gitlab-code-parser and gitalisk with the Knowledge Graph Core Indexer and other consumers.
  • Consider hybrid approaches (e.g., git tags for now, registry later).
  • Document the recommended approach and update CI/CD to support it.
Edited by Michael Angelo Rivera