From 7472ce0d6fba83f5f0b82b35f8abde5127880781 Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Mon, 13 Apr 2026 15:20:37 +0000 Subject: [PATCH] appview/pulls: add created date for pull submission Signed-off-by: Seongmin Lee --- appview/pulls/pulls.go | 48 +++++++++++++++++++++++++++--------------------- 1 file(s) changed, 27 insertion(s)(+), 21 deletion(s)(-) diff --git a/appview/pulls/pulls.go b/appview/pulls/pulls.go --- a/appview/pulls/pulls.go +++ b/appview/pulls/pulls.go @@ -1334,24 +1334,14 @@ s.pages.Notice(w, "pull", "Failed to create pull request. Try again later.") return } - record := tangled.RepoPull{ - Title: title, - Body: &body, - Target: repoPullTarget(repo, targetBranch), - Source: recordPullSource, - CreatedAt: time.Now().Format(time.RFC3339), - Rounds: []*tangled.RepoPull_Round{ - { - CreatedAt: time.Now().Format(time.RFC3339), - PatchBlob: blob.Blob, - }, - }, - } + now := time.Now() + initialSubmission := models.PullSubmission{ Patch: patch, Combined: combined, SourceRev: sourceRev, Blob: *blob.Blob, + Created: time.Now(), } pull := &models.Pull{ Title: title, @@ -1367,6 +1357,20 @@ &initialSubmission, }, PullSource: pullSource, State: models.PullOpen, + Created: now, + } + + record := tangled.RepoPull{ + Title: title, + Body: &body, + Target: repoPullTarget(repo, targetBranch), + Source: recordPullSource, + CreatedAt: time.Now().Format(time.RFC3339), + Rounds: []*tangled.RepoPull_Round{ + initialSubmission.AsRecord(), + }, + Mentions: nil, + References: nil, } _, err = comatproto.RepoPutRecord(r.Context(), client, &comatproto.RepoPutRecord_Input{ @@ -2613,12 +2617,8 @@ rkey := tid.TID() mentions, references := s.mentionsResolver.Resolve(ctx, body) - initialSubmission := models.PullSubmission{ - Patch: fp.Raw, - SourceRev: fp.SHA, - Combined: fp.Raw, - Blob: *blobs[i], - } + now := time.Now() + pull := models.Pull{ Title: title, Body: body, @@ -2629,10 +2629,16 @@ Rkey: rkey, Mentions: mentions, References: references, Submissions: []*models.PullSubmission{ - &initialSubmission, + { + Patch: fp.Raw, + SourceRev: fp.SHA, + Combined: fp.Raw, + Blob: *blobs[i], + Created: now, + }, }, PullSource: pullSource, - Created: time.Now(), + Created: now, State: models.PullOpen, DependentOn: parentAtUri, -- tangled.sh