Skip to content

Commit a575776

Browse files
authored
Merge pull request #340 from Sakib25800/document-database-fields
Add doc comments to database model fields
2 parents 42de55f + e19b668 commit a575776

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/database/mod.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,15 @@ impl Display for BuildStatus {
304304
#[sqlx(type_name = "build")]
305305
pub struct BuildModel {
306306
pub id: PrimaryKey,
307+
/// The GitHub repository this build belongs to.
307308
pub repository: GithubRepoName,
309+
/// The branch where this build is running (e.g., "automation/bors/try").
308310
pub branch: String,
311+
/// The SHA of the commit being built.
309312
pub commit_sha: String,
313+
/// Current status of the build (pending, success, failure, etc.).
310314
pub status: BuildStatus,
315+
/// The base commit SHA that this build is merged with (e.g., main branch HEAD).
311316
pub parent: String,
312317
pub created_at: DateTime<Utc>,
313318
}
@@ -316,19 +321,33 @@ pub struct BuildModel {
316321
#[derive(Debug)]
317322
pub struct PullRequestModel {
318323
pub id: PrimaryKey,
324+
/// The GitHub repository this PR belongs to.
319325
pub repository: GithubRepoName,
326+
/// The GitHub pull request number.
320327
pub number: PullRequestNumber,
328+
/// The title of the pull request in GitHub.
321329
pub title: String,
330+
/// The GitHub username of the PR author.
322331
pub author: String,
332+
/// List of GitHub usernames assigned to this PR.
323333
pub assignees: Vec<String>,
334+
/// The GitHub PR state: open, closed, draft, or merged.
324335
pub pr_status: PullRequestStatus,
336+
/// The target branch this PR will be merged into.
325337
pub base_branch: String,
338+
/// GitHub's determination of PR mergeability.
326339
pub mergeable_state: MergeableState,
340+
/// Approval status including approver and approved commit SHA.
327341
pub approval_status: ApprovalStatus,
342+
/// Temporary permissions granted to the PR author by a reviewer (try or review).
328343
pub delegated_permission: Option<DelegatedPermission>,
344+
/// Priority for merge queue ordering. Higher priority PRs are merged first.
329345
pub priority: Option<i32>,
346+
/// Rollup mode determining if this PR can be included in rollup builds.
330347
pub rollup: Option<RollupMode>,
348+
/// The (latest) try build associated with this PR, if any.
331349
pub try_build: Option<BuildModel>,
350+
/// The (latest) auto merge build associated with this PR, if any.
332351
pub auto_build: Option<BuildModel>,
333352
pub created_at: DateTime<Utc>,
334353
}
@@ -359,7 +378,9 @@ impl PullRequestModel {
359378
#[sqlx(type_name = "TEXT")]
360379
#[sqlx(rename_all = "lowercase")]
361380
pub enum WorkflowType {
381+
/// GitHub Actions workflow.
362382
Github,
383+
/// External CI system workflow.
363384
External,
364385
}
365386

@@ -379,11 +400,17 @@ pub enum WorkflowStatus {
379400
/// Represents a workflow run, coming either from Github Actions or from some external CI.
380401
pub struct WorkflowModel {
381402
pub id: PrimaryKey,
403+
/// The build this workflow is associated with.
382404
pub build: BuildModel,
405+
/// The name of the workflow (e.g., "CI", "Tests").
383406
pub name: String,
407+
/// URL to view this workflow run on GitHub or external CI.
384408
pub url: String,
409+
/// Unique identifier for this workflow run.
385410
pub run_id: RunId,
411+
/// Whether this is a GitHub Actions workflow or external CI.
386412
pub workflow_type: WorkflowType,
413+
/// Current status of the workflow (pending, success, failure).
387414
pub status: WorkflowStatus,
388415
pub created_at: DateTime<Utc>,
389416
}
@@ -474,7 +501,9 @@ impl From<PullRequest> for UpsertPullRequestParams {
474501
/// Represents a repository configuration.
475502
pub struct RepoModel {
476503
pub id: PrimaryKey,
504+
/// The GitHub repository name in "owner/repo" format.
477505
pub name: GithubRepoName,
506+
/// State of the repository tree (open or closed with priority threshold).
478507
pub tree_state: TreeState,
479508
pub created_at: DateTime<Utc>,
480509
}

0 commit comments

Comments
 (0)