Skip to content

Cargo Registry MVC: Implement config.json Endpoint

This MR contains an API skeleton for cargo registry APIs. Cargo will use these APIs internally during cargo publish and cargo install. Refer to this discussion for more context: #33060 (comment 2308404360)

At this stage, I think this MR is more or less ready for a review. Thanks!

AI Generated Summary

This merge request adds support for Cargo package management to the project. It introduces a new package type called "cargo" and creates API endpoints for handling Cargo-related operations. The changes include:

  1. Adding a new enum value for cargo packages in the Package model.
  2. Creating a feature flag for the Cargo package manager.
  3. Mounting a new API endpoint for Cargo project packages.
  4. Implementing API routes for Cargo-specific operations, such as getting configuration, uploading new crates, downloading crates, and accessing the crate index.

These changes lay the groundwork for integrating Cargo package management into the existing package registry system, allowing users to work with Rust projects and dependencies within the platform.

Testing

curl -s --header "Authorization: Bearer \<personal-access-token\>" "http://gdk.test:3000/api/v4/projects/\<project_id\>/packages/cargo/config.json"

This should return the corresponding config.json for the project.

Edited by Chandra Kiran G

Merge request reports

Loading