diff --git a/knotserver/routes.go b/knotserver/routes.go --- a/knotserver/routes.go +++ b/knotserver/routes.go @@ -37,6 +37,7 @@ capabilities := map[string]any{ "pull_requests": map[string]any{ + "format_patch": true, "patch_submissions": true, "branch_submissions": true, "fork_submissions": true, diff --git a/types/capabilities.go b/types/capabilities.go --- a/types/capabilities.go +++ b/types/capabilities.go @@ -2,6 +2,7 @@ type Capabilities struct { PullRequests struct { + FormatPatch bool `json:"format_patch"` PatchSubmissions bool `json:"patch_submissions"` BranchSubmissions bool `json:"branch_submissions"` ForkSubmissions bool `json:"fork_submissions"` diff --git a/appview/state/pull.go b/appview/state/pull.go --- a/appview/state/pull.go +++ b/appview/state/pull.go @@ -670,6 +670,11 @@ return } + if !caps.PullRequests.FormatPatch { + s.pages.Notice(w, "pull", "This knot doesn't support format-patch. Unfortunately, there is no fallback for now.") + return + } + // Handle the PR creation based on the type if isBranchBased { if !caps.PullRequests.BranchSubmissions {