Showing the changes to apps/server/src/sourceControl/gitLabMergeRequests.ts (1 of 30 files). Show all
Unified · Split
| @@ -14,6 +14,7 @@ export interface NormalizedGitLabMergeRequestRecord { · 13 unmodified lines | |||
| 14 | readonly baseRefName: string; | 14 | readonly baseRefName: string; |
| 15 | readonly headRefName: string; | 15 | readonly headRefName: string; |
| 16 | readonly state: "open" | "closed" | "merged"; | 16 | readonly state: "open" | "closed" | "merged"; |
| 17 | readonly isDraft?: boolean; | ||
| 17 | readonly updatedAt: Option.Option<DateTime.Utc>; | 18 | readonly updatedAt: Option.Option<DateTime.Utc>; |
| 18 | readonly isCrossRepository?: boolean; | 19 | readonly isCrossRepository?: boolean; |
| 19 | readonly headRepositoryNameWithOwner?: string | null; | 20 | readonly headRepositoryNameWithOwner?: string | null; |
| @@ -41,6 +42,8 @@ const GitLabMergeRequestSchema = Schema.Struct({ · 21 unmodified lines | |||
| 41 | source_branch: TrimmedNonEmptyString, | 42 | source_branch: TrimmedNonEmptyString, |
| 42 | target_branch: TrimmedNonEmptyString, | 43 | target_branch: TrimmedNonEmptyString, |
| 43 | state: Schema.optional(Schema.NullOr(Schema.String)), | 44 | state: Schema.optional(Schema.NullOr(Schema.String)), |
| 45 | draft: Schema.optional(Schema.Boolean), | ||
| 46 | work_in_progress: Schema.optional(Schema.Boolean), | ||
| 44 | updated_at: Schema.optional(Schema.OptionFromNullOr(Schema.DateTimeUtcFromString)), | 47 | updated_at: Schema.optional(Schema.OptionFromNullOr(Schema.DateTimeUtcFromString)), |
| 45 | source_project_id: Schema.optional(Schema.NullOr(Schema.Number)), | 48 | source_project_id: Schema.optional(Schema.NullOr(Schema.Number)), |
| 46 | target_project_id: Schema.optional(Schema.NullOr(Schema.Number)), | 49 | target_project_id: Schema.optional(Schema.NullOr(Schema.Number)), |
| @@ -108,6 +111,7 @@ function normalizeGitLabMergeRequestRecord( · 61 unmodified lines | |||
| 108 | baseRefName: raw.target_branch, | 111 | baseRefName: raw.target_branch, |
| 109 | headRefName: raw.source_branch, | 112 | headRefName: raw.source_branch, |
| 110 | state: normalizeGitLabMergeRequestState(raw.state), | 113 | state: normalizeGitLabMergeRequestState(raw.state), |
| 114 | ...(raw.draft === true || raw.work_in_progress === true ? { isDraft: true } : {}), | ||
| 111 | updatedAt: raw.updated_at ?? Option.none(), | 115 | updatedAt: raw.updated_at ?? Option.none(), |
| 112 | ...(typeof isCrossRepository === "boolean" ? { isCrossRepository } : {}), | 116 | ...(typeof isCrossRepository === "boolean" ? { isCrossRepository } : {}), |
| 113 | ...(sourceProjectPath ? { headRepositoryNameWithOwner: sourceProjectPath } : {}), | 117 | ...(sourceProjectPath ? { headRepositoryNameWithOwner: sourceProjectPath } : {}), |