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 | 14 | readonly baseRefName: string; |
| 15 | 15 | readonly headRefName: string; |
| 16 | 16 | readonly state: "open" | "closed" | "merged"; |
| 17 | + readonly isDraft?: boolean; | |
| 17 | 18 | readonly updatedAt: Option.Option<DateTime.Utc>; |
| 18 | 19 | readonly isCrossRepository?: boolean; |
| 19 | 20 | readonly headRepositoryNameWithOwner?: string | null; |
| @@ -41,6 +42,8 @@ const GitLabMergeRequestSchema = Schema.Struct({ · 21 unmodified lines | ||
| 41 | 42 | source_branch: TrimmedNonEmptyString, |
| 42 | 43 | target_branch: TrimmedNonEmptyString, |
| 43 | 44 | state: Schema.optional(Schema.NullOr(Schema.String)), |
| 45 | + draft: Schema.optional(Schema.Boolean), | |
| 46 | + work_in_progress: Schema.optional(Schema.Boolean), | |
| 44 | 47 | updated_at: Schema.optional(Schema.OptionFromNullOr(Schema.DateTimeUtcFromString)), |
| 45 | 48 | source_project_id: Schema.optional(Schema.NullOr(Schema.Number)), |
| 46 | 49 | target_project_id: Schema.optional(Schema.NullOr(Schema.Number)), |
| @@ -108,6 +111,7 @@ function normalizeGitLabMergeRequestRecord( · 61 unmodified lines | ||
| 108 | 111 | baseRefName: raw.target_branch, |
| 109 | 112 | headRefName: raw.source_branch, |
| 110 | 113 | state: normalizeGitLabMergeRequestState(raw.state), |
| 114 | + ...(raw.draft === true || raw.work_in_progress === true ? { isDraft: true } : {}), | |
| 111 | 115 | updatedAt: raw.updated_at ?? Option.none(), |
| 112 | 116 | ...(typeof isCrossRepository === "boolean" ? { isCrossRepository } : {}), |
| 113 | 117 | ...(sourceProjectPath ? { headRepositoryNameWithOwner: sourceProjectPath } : {}), |