Monorepo for Tangled tangled.org

appview/pulls: directly pass diff and diff opts into main PR page #968

merged opened by oppi.li targeting master from op/vyrymqtwolsn
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:qfpnj4og54vl56wngdriaxug/sh.tangled.repo.pull/3mcjiyey6pa22
+16 -5
Diff #0
+2
appview/pages/pages.go
··· 1106 MergeCheck types.MergeCheckResponse 1107 ResubmitCheck ResubmitResult 1108 Pipelines map[string]models.Pipeline 1109 1110 OrderedReactionKinds []models.ReactionKind 1111 Reactions map[models.ReactionKind]models.ReactionDisplayData
··· 1106 MergeCheck types.MergeCheckResponse 1107 ResubmitCheck ResubmitResult 1108 Pipelines map[string]models.Pipeline 1109 + Diff *types.NiceDiff 1110 + DiffOpts types.DiffOpts 1111 1112 OrderedReactionKinds []models.ReactionKind 1113 Reactions map[models.ReactionKind]models.ReactionDisplayData
+1 -1
appview/pages/templates/layouts/repobase.html
··· 1 {{ define "title" }}{{ .RepoInfo.FullName }}{{ end }} 2 3 {{ define "content" }} 4 - <section id="repo-header" class="mb-4 p-2 dark:text-white"> 5 <div class="text-lg flex flex-col sm:flex-row items-start gap-4 justify-between"> 6 <!-- left items --> 7 <div class="flex flex-col gap-2">
··· 1 {{ define "title" }}{{ .RepoInfo.FullName }}{{ end }} 2 3 {{ define "content" }} 4 + <section id="repo-header" class="mb-2 py-2 px-4 dark:text-white"> 5 <div class="text-lg flex flex-col sm:flex-row items-start gap-4 justify-between"> 6 <!-- left items --> 7 <div class="flex flex-col gap-2">
+11 -2
appview/pulls/pulls.go
··· 235 defs[l.AtUri().String()] = &l 236 } 237 238 - s.pages.RepoSinglePull(w, pages.RepoSinglePullParams{ 239 LoggedInUser: user, 240 RepoInfo: s.repoResolver.GetRepoInfo(r, user), 241 Pull: pull, ··· 246 MergeCheck: mergeCheckResponse, 247 ResubmitCheck: resubmitResult, 248 Pipelines: m, 249 250 OrderedReactionKinds: models.OrderedReactionKinds, 251 Reactions: reactionMap, 252 UserReacted: userReactions, 253 254 LabelDefs: defs, 255 - }) 256 } 257 258 func (s *Pulls) mergeCheck(r *http.Request, f *models.Repo, pull *models.Pull, stack models.Stack) types.MergeCheckResponse {
··· 235 defs[l.AtUri().String()] = &l 236 } 237 238 + patch := pull.LatestSubmission().CombinedPatch() 239 + diff := patchutil.AsNiceDiff(patch, pull.TargetBranch) 240 + var diffOpts types.DiffOpts 241 + if d := r.URL.Query().Get("diff"); d == "split" { 242 + diffOpts.Split = true 243 + } 244 + 245 + log.Println(s.pages.RepoSinglePull(w, pages.RepoSinglePullParams{ 246 LoggedInUser: user, 247 RepoInfo: s.repoResolver.GetRepoInfo(r, user), 248 Pull: pull, ··· 253 MergeCheck: mergeCheckResponse, 254 ResubmitCheck: resubmitResult, 255 Pipelines: m, 256 + Diff: &diff, 257 + DiffOpts: diffOpts, 258 259 OrderedReactionKinds: models.OrderedReactionKinds, 260 Reactions: reactionMap, 261 UserReacted: userReactions, 262 263 LabelDefs: defs, 264 + })) 265 } 266 267 func (s *Pulls) mergeCheck(r *http.Request, f *models.Repo, pull *models.Pull, stack models.Stack) types.MergeCheckResponse {
+2 -2
spindle/models/models.go
··· 53 StatusKindRunning, 54 } 55 FinishStates [4]StatusKind = [4]StatusKind{ 56 - StatusKindCancelled, 57 StatusKindFailed, 58 - StatusKindSuccess, 59 StatusKindTimeout, 60 } 61 ) 62
··· 53 StatusKindRunning, 54 } 55 FinishStates [4]StatusKind = [4]StatusKind{ 56 StatusKindFailed, 57 StatusKindTimeout, 58 + StatusKindCancelled, 59 + StatusKindSuccess, 60 } 61 ) 62

History

2 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
appview/pulls: directly pass diff and diff opts into main PR page
3/3 success
expand
expand 0 comments
pull request successfully merged
oppi.li submitted #0
1 commit
expand
appview/pulls: directly pass diff and diff opts into main PR page
3/3 success
expand
expand 0 comments