Signed-off-by: dusk y.bera003.06@protonmail.com
+22
-4
appview/repo/repo.go
+22
-4
appview/repo/repo.go
···
314
314
if err != nil {
315
315
return nil, err
316
316
}
317
+
318
+
for _, round := range pull.Submissions {
319
+
item := &feeds.Item{
320
+
Title: fmt.Sprintf("[PR #%d] %s (round #%d)", pull.PullId, pull.Title, round.RoundNumber),
321
+
Description: fmt.Sprintf("@%s submitted changes (at round #%d) on PR #%d in %s", owner.Handle, round.RoundNumber, pull.PullId, f.OwnerSlashRepo()),
322
+
Link: &feeds.Link{Href: fmt.Sprintf("%s/%s/pulls/%d", rp.config.Core.AppviewHost, f.OwnerSlashRepo(), pull.PullId)},
323
+
Created: pull.Created,
324
+
Author: &feeds.Author{
325
+
Name: fmt.Sprintf("@%s", owner.Handle),
326
+
},
327
+
}
328
+
feed.Items = append(feed.Items, item)
329
+
}
330
+
317
331
var state string
318
332
if pull.State == db.PullOpen {
319
333
state = "opened"
320
334
} else {
321
335
state = pull.State.String()
322
336
}
337
+
mergedAtRounds := ""
338
+
if pull.State == db.PullMerged {
339
+
mergedAtRounds = fmt.Sprintf(" (on round #%d)", pull.LastRoundNumber())
340
+
}
323
341
item := &feeds.Item{
324
-
Title: fmt.Sprintf("[PR] %s", pull.Title),
325
-
Description: fmt.Sprintf("@%s %s pull request on %s", owner.Handle, state, f.OwnerSlashRepo()),
342
+
Title: fmt.Sprintf("[PR #%d] %s", pull.PullId, pull.Title),
343
+
Description: fmt.Sprintf("@%s %s pull request #%d%s in %s", owner.Handle, state, pull.PullId, mergedAtRounds, f.OwnerSlashRepo()),
326
344
Link: &feeds.Link{Href: fmt.Sprintf("%s/%s/pulls/%d", rp.config.Core.AppviewHost, f.OwnerSlashRepo(), pull.PullId)},
327
345
Created: pull.Created,
328
346
Author: &feeds.Author{
···
344
362
state = "closed"
345
363
}
346
364
item := &feeds.Item{
347
-
Title: fmt.Sprintf("[Issue] %s", issue.Title),
348
-
Description: fmt.Sprintf("@%s %s issue on %s", owner.Handle, state, f.OwnerSlashRepo()),
365
+
Title: fmt.Sprintf("[Issue #%d] %s", issue.IssueId, issue.Title),
366
+
Description: fmt.Sprintf("@%s %s issue #%d in %s", owner.Handle, state, issue.IssueId, f.OwnerSlashRepo()),
349
367
Link: &feeds.Link{Href: fmt.Sprintf("%s/%s/issues/%d", rp.config.Core.AppviewHost, f.OwnerSlashRepo(), issue.IssueId)},
350
368
Created: issue.Created,
351
369
Author: &feeds.Author{
appview/repo/router.go
appview/repo/router.go
This file has not been changed.
History
5 rounds
4 comments
expand 1 comment
pull request successfully merged
expand 0 comments
expand 0 comments
expand 1 comment
this is pretty simple for now (only puts pull and issue creation in), like the profile timeline since i assume this could use the same code as notifications code later for keeping track of pulls / issues being closed etc etc
including submissions in the feed now aswell