Monorepo for Tangled
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

appview/pulls: add created date for pull submission

Signed-off-by: Seongmin Lee <git@boltless.me>

authored by

Seongmin Lee and committed by tangled.org 7472ce0d d404bb76

+27 -21
+27 -21
appview/pulls/pulls.go
··· 1334 1334 return 1335 1335 } 1336 1336 1337 - record := tangled.RepoPull{ 1338 - Title: title, 1339 - Body: &body, 1340 - Target: repoPullTarget(repo, targetBranch), 1341 - Source: recordPullSource, 1342 - CreatedAt: time.Now().Format(time.RFC3339), 1343 - Rounds: []*tangled.RepoPull_Round{ 1344 - { 1345 - CreatedAt: time.Now().Format(time.RFC3339), 1346 - PatchBlob: blob.Blob, 1347 - }, 1348 - }, 1349 - } 1337 + now := time.Now() 1338 + 1350 1339 initialSubmission := models.PullSubmission{ 1351 1340 Patch: patch, 1352 1341 Combined: combined, 1353 1342 SourceRev: sourceRev, 1354 1343 Blob: *blob.Blob, 1344 + Created: time.Now(), 1355 1345 } 1356 1346 pull := &models.Pull{ 1357 1347 Title: title, ··· 1367 1357 }, 1368 1358 PullSource: pullSource, 1369 1359 State: models.PullOpen, 1360 + Created: now, 1361 + } 1362 + 1363 + record := tangled.RepoPull{ 1364 + Title: title, 1365 + Body: &body, 1366 + Target: repoPullTarget(repo, targetBranch), 1367 + Source: recordPullSource, 1368 + CreatedAt: time.Now().Format(time.RFC3339), 1369 + Rounds: []*tangled.RepoPull_Round{ 1370 + initialSubmission.AsRecord(), 1371 + }, 1372 + Mentions: nil, 1373 + References: nil, 1370 1374 } 1371 1375 1372 1376 _, err = comatproto.RepoPutRecord(r.Context(), client, &comatproto.RepoPutRecord_Input{ ··· 2613 2617 2614 2618 mentions, references := s.mentionsResolver.Resolve(ctx, body) 2615 2619 2616 - initialSubmission := models.PullSubmission{ 2617 - Patch: fp.Raw, 2618 - SourceRev: fp.SHA, 2619 - Combined: fp.Raw, 2620 - Blob: *blobs[i], 2621 - } 2620 + now := time.Now() 2621 + 2622 2622 pull := models.Pull{ 2623 2623 Title: title, 2624 2624 Body: body, ··· 2629 2629 Mentions: mentions, 2630 2630 References: references, 2631 2631 Submissions: []*models.PullSubmission{ 2632 - &initialSubmission, 2632 + { 2633 + Patch: fp.Raw, 2634 + SourceRev: fp.SHA, 2635 + Combined: fp.Raw, 2636 + Blob: *blobs[i], 2637 + Created: now, 2638 + }, 2633 2639 }, 2634 2640 PullSource: pullSource, 2635 - Created: time.Now(), 2641 + Created: now, 2636 2642 State: models.PullOpen, 2637 2643 2638 2644 DependentOn: parentAtUri,