fix(server): settle threads using actual pull request terminal timestamps (#9934)

This commit is contained in:
maria authored and GitHub committed 2026-09-05 21:29:41 -04:00
1 parent bd16b86d50
commit 050690d1bc
30 files changed
+197 -48

No files matched your search

@@ -15,6 +15,8 @@ export interface NormalizedGitLabMergeRequestRecord {
readonly headRefName: string;
readonly state: "open" | "closed" | "merged";
readonly isDraft?: boolean;
readonly closedAt?: string | null;
readonly mergedAt?: string | null;
readonly updatedAt: Option.Option<DateTime.Utc>;
readonly isCrossRepository?: boolean;
readonly headRepositoryNameWithOwner?: string | null;
@@ -44,6 +46,8 @@ const GitLabMergeRequestSchema = Schema.Struct({
state: Schema.optional(Schema.NullOr(Schema.String)),
draft: Schema.optional(Schema.Boolean),
work_in_progress: Schema.optional(Schema.Boolean),
closed_at: Schema.optional(Schema.NullOr(Schema.String)),
merged_at: Schema.optional(Schema.NullOr(Schema.String)),
updated_at: Schema.optional(Schema.OptionFromNullOr(Schema.DateTimeUtcFromString)),
source_project_id: Schema.optional(Schema.NullOr(Schema.Number)),
target_project_id: Schema.optional(Schema.NullOr(Schema.Number)),
@@ -112,6 +116,8 @@ function normalizeGitLabMergeRequestRecord(
headRefName: raw.source_branch,
state: normalizeGitLabMergeRequestState(raw.state),
...(raw.draft === true || raw.work_in_progress === true ? { isDraft: true } : {}),
closedAt: raw.closed_at ?? null,
mergedAt: raw.merged_at ?? null,
updatedAt: raw.updated_at ?? Option.none(),
...(typeof isCrossRepository === "boolean" ? { isCrossRepository } : {}),
...(sourceProjectPath ? { headRepositoryNameWithOwner: sourceProjectPath } : {}),