g1t/crates/contracts/src/projects.rs
Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Projects: what a workspace builds and runs, first on every page | 1 | //! The projects service, as the Rust services call it: a project is what a |
| 2 | //! workspace builds and runs, with one source. Mirrors | |
| 3 | //! `packages/contracts/src/projects.ts`, as far as Rust callers need it. | |
| 4 | ||
| 5 | use serde::{Deserialize, Serialize}; | |
| 6 | ||
| 7 | /// `by_repo`: the projects built from a repository, its primary one first; | |
| 8 | /// a repository from before projects is given its own. Returns | |
| 9 | /// `Vec<ProjectRef>`. | |
| 10 | #[derive(Debug, Serialize, Deserialize)] | |
| 11 | #[serde(rename_all = "camelCase")] | |
| 12 | pub struct ByRepoArgs { | |
| 13 | pub repo_id: String, | |
| 14 | } | |
| 15 | ||
| 16 | /// A project, as much of it as other services need. | |
| 17 | #[derive(Clone, Debug, Serialize, Deserialize)] | |
| 18 | #[serde(rename_all = "camelCase")] | |
| 19 | pub struct ProjectRef { | |
| 20 | pub id: String, | |
| 21 | pub workspace: String, | |
| 22 | pub slug: String, | |
| 23 | /// The project its repository's workflows read secrets from. | |
| 24 | #[serde(default)] | |
| 25 | pub primary: bool, | |
| 26 | } |