Monorepo for Tangled tangled.org

appview: repo: implement generating feed #476

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/3lw7rerhbqm22
+16 -13
Interdiff #3 โ†’ #4
+16 -13
appview/repo/repo.go
··· 315 return nil, err 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 - 331 var state string 332 if pull.State == db.PullOpen { 333 state = "opened" ··· 348 }, 349 } 350 feed.Items = append(feed.Items, item) 351 } 352 353 for _, issue := range issues {
··· 315 return nil, err 316 } 317 318 var state string 319 if pull.State == db.PullOpen { 320 state = "opened" ··· 335 }, 336 } 337 feed.Items = append(feed.Items, item) 338 + 339 + for _, round := range pull.Submissions { 340 + if round == nil || round.RoundNumber == 0 { 341 + continue 342 + } 343 + item := &feeds.Item{ 344 + Title: fmt.Sprintf("[PR #%d] %s (round #%d)", pull.PullId, pull.Title, round.RoundNumber), 345 + Description: fmt.Sprintf("@%s submitted changes (at round #%d) on PR #%d in %s", owner.Handle, round.RoundNumber, pull.PullId, f.OwnerSlashRepo()), 346 + Link: &feeds.Link{Href: fmt.Sprintf("%s/%s/pulls/%d/round/%d/", rp.config.Core.AppviewHost, f.OwnerSlashRepo(), pull.PullId, round.RoundNumber)}, 347 + Created: round.Created, 348 + Author: &feeds.Author{ 349 + Name: fmt.Sprintf("@%s", owner.Handle), 350 + }, 351 + } 352 + feed.Items = append(feed.Items, item) 353 + } 354 } 355 356 for _, issue := range issues {
appview/repo/router.go

This file has not been changed.

History

5 rounds 4 comments
sign up or login to add to the discussion
1 commit
expand
bd1694e2
appview: repo: implement generating feed
expand 1 comment

including submissions in the feed now aswell

pull request successfully merged
1 commit
expand
7e9f0eea
appview: repo: implement generating feed
expand 0 comments
1 commit
expand
2851773b
appview: repo: implement generating feed
expand 0 comments
1 commit
expand
381c1840
appview: repo: implement generating feed
expand 2 comments

for the feed title, can we change it to be of the format [Issue] <Issue Title> and [PR] <Pull title>?

made the title that, moved the existing one as description

ptr.pet submitted #0
1 commit
expand
aea5b04f
appview: repo: implement generating feed
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