Monorepo for Tangled tangled.org

knotserver: add format_patch capability

authored by anirudh.fi and committed by Tangled e68aa07c 76c5ddbb

Changed files
+7
appview
state
knotserver
types
+5
appview/state/pull.go
··· 670 return 671 } 672 673 // Handle the PR creation based on the type 674 if isBranchBased { 675 if !caps.PullRequests.BranchSubmissions {
··· 670 return 671 } 672 673 + if !caps.PullRequests.FormatPatch { 674 + s.pages.Notice(w, "pull", "This knot doesn't support format-patch. Unfortunately, there is no fallback for now.") 675 + return 676 + } 677 + 678 // Handle the PR creation based on the type 679 if isBranchBased { 680 if !caps.PullRequests.BranchSubmissions {
+1
knotserver/routes.go
··· 37 38 capabilities := map[string]any{ 39 "pull_requests": map[string]any{ 40 "patch_submissions": true, 41 "branch_submissions": true, 42 "fork_submissions": true,
··· 37 38 capabilities := map[string]any{ 39 "pull_requests": map[string]any{ 40 + "format_patch": true, 41 "patch_submissions": true, 42 "branch_submissions": true, 43 "fork_submissions": true,
+1
types/capabilities.go
··· 2 3 type Capabilities struct { 4 PullRequests struct { 5 PatchSubmissions bool `json:"patch_submissions"` 6 BranchSubmissions bool `json:"branch_submissions"` 7 ForkSubmissions bool `json:"fork_submissions"`
··· 2 3 type Capabilities struct { 4 PullRequests struct { 5 + FormatPatch bool `json:"format_patch"` 6 PatchSubmissions bool `json:"patch_submissions"` 7 BranchSubmissions bool `json:"branch_submissions"` 8 ForkSubmissions bool `json:"fork_submissions"`