Monorepo for Tangled tangled.org

appview: db: pulls: add method for getting any pulls on a repo #475

merged opened by ptr.pet targeting master from [deleted fork]: repo-feed
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:dfl62fgb7wtjj3fcbb72naae/sh.tangled.repo.pull/3lw7rerhbql22
+9 -1
Interdiff #1 โ†’ #2
+9 -1
appview/db/pulls.go
··· 419 419 inClause := strings.TrimSuffix(strings.Repeat("?, ", len(pulls)), ", ") 420 420 submissionsQuery := fmt.Sprintf(` 421 421 select 422 - id, pull_id, round_number, patch, source_rev 422 + id, pull_id, round_number, patch, created, source_rev 423 423 from 424 424 pull_submissions 425 425 where ··· 445 445 for submissionsRows.Next() { 446 446 var s PullSubmission 447 447 var sourceRev sql.NullString 448 + var createdAt string 448 449 err := submissionsRows.Scan( 449 450 &s.ID, 450 451 &s.PullId, 451 452 &s.RoundNumber, 452 453 &s.Patch, 454 + &createdAt, 453 455 &sourceRev, 454 456 ) 455 457 if err != nil { 456 458 return nil, err 457 459 } 458 460 461 + createdTime, err := time.Parse(time.RFC3339, createdAt) 462 + if err != nil { 463 + return nil, err 464 + } 465 + s.Created = createdTime 466 + 459 467 if sourceRev.Valid { 460 468 s.SourceRev = sourceRev.String 461 469 }

History

3 rounds 5 comments
sign up or login to add to the discussion
1 commit
expand
87dc65a1
appview: db: pulls: add method for getting any pulls on a repo
expand 1 comment

submission created times were not being read from db, fixed

pull request successfully merged
1 commit
expand
32e27b7b
appview: db: pulls: add method for getting any pulls on a repo
expand 0 comments
ptr.pet submitted #0
1 commit
expand
6be75693
appview: db: pulls: add method for getting any pulls on a repo
expand 4 comments

why not use GetPulls with filters instead? we can additionally utilize things like comments and rounds in the feed.

right; i was going for no comments / rounds at first but that makes more sense!

(i think comments would be too noisy, thats best left to notifications IMO, but rounds would be fine)

removed that and modified GetPulls a bit and using that