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
+22 -4
Interdiff #2 โ†’ #3
+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

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
ptr.pet submitted #3
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