You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/routers/api/v1/repo
wxiaoguang dd8bc1d61d
Refactor issue template parsing and fix API endpoint (#29069) (#29140)
Backport #29069

The old code `GetTemplatesFromDefaultBranch(...) ([]*api.IssueTemplate,
map[string]error)` doesn't really follow Golang's habits, then the
second returned value might be misused. For example, the API function
`GetIssueTemplates` incorrectly checked the second returned value and
always responds 500 error.

This PR refactors GetTemplatesFromDefaultBranch to
ParseTemplatesFromDefaultBranch and clarifies its behavior, and fixes
the API endpoint bug, and adds some tests.

And by the way, add proper prefix `X-` for the header generated in
`checkDeprecatedAuthMethods`, because non-standard HTTP headers should
have `X-` prefix, and it is also consistent with the new code in
`GetIssueTemplates`
1 year ago
..
action.go Refactor secrets modification logic (#26873) 1 year ago
avatar.go Add missing 404 response to Swagger (#27038) 1 year ago
blob.go Add missing 404 response to Swagger (#27038) 1 year ago
branch.go Also sync DB branches on push if necessary (#28361) (#28403) 1 year ago
collaborators.go More `db.DefaultContext` refactor (#27265) (#27347) 1 year ago
commits.go Filter get single commit (#24613) 2 years ago
file.go Add context parameter to some database functions (#26055) 2 years ago
fork.go Reduce usage of `db.DefaultContext` (#27073) 1 year ago
git_hook.go Add missing 404 response to Swagger (#27038) 1 year ago
git_ref.go Implement FSFE REUSE for golang files (#21840) 2 years ago
hook.go Fix comment permissions (#28213) (#28216) 1 year ago
hook_test.go Move web/api context related testing function into a separate package (#26859) 2 years ago
issue.go Fix comment permissions (#28213) (#28216) 1 year ago
issue_attachment.go More refactoring of `db.DefaultContext` (#27083) 1 year ago
issue_comment.go Fix comment permissions (#28213) (#28216) 1 year ago
issue_comment_attachment.go Fix comment permissions (#28213) (#28216) 1 year ago
issue_dependency.go Fix issue dependencies (#27736) (#28776) 1 year ago
issue_label.go Don't let API add 2 exclusive labels from same scope (#27433) (#27460) 1 year ago
issue_pin.go Add missing 404 response to Swagger (#27038) 1 year ago
issue_reaction.go Fix comment permissions (#28213) (#28216) 1 year ago
issue_stopwatch.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
issue_subscription.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
issue_tracked_time.go Add missing 404 response to Swagger (#27038) 1 year ago
key.go Fix comment permissions (#28213) (#28216) 1 year ago
label.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
language.go Implement FSFE REUSE for golang files (#21840) 2 years ago
main_test.go Merge setting.InitXXX into one function with options (#24389) 2 years ago
migrate.go move repository deletion to service layer (#26948) 1 year ago
milestone.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
mirror.go Add `RemoteAddress` to mirrors (#26952) 1 year ago
notes.go api: GetPullRequestCommits: return file list (#27483) (#27539) 1 year ago
patch.go Add missing 404 response to Swagger (#27038) 1 year ago
pull.go api: GetPullRequestCommits: return file list (#27483) (#27539) 1 year ago
pull_review.go More `db.DefaultContext` refactor (#27265) (#27347) 1 year ago
release.go Fix comment permissions (#28213) (#28216) 1 year ago
release_attachment.go Fix comment permissions (#28213) (#28216) 1 year ago
release_tags.go Fix comment permissions (#28213) (#28216) 1 year ago
repo.go Refactor issue template parsing and fix API endpoint (#29069) (#29140) 1 year ago
repo_test.go Move web/api context related testing function into a separate package (#26859) 2 years ago
star.go More refactoring of `db.DefaultContext` (#27083) 1 year ago
status.go Fix `GetCommitStatuses` (#28787) (#28804) 1 year ago
subscriber.go More refactoring of `db.DefaultContext` (#27083) 1 year ago
tag.go Fix comment permissions (#28213) (#28216) 1 year ago
teams.go More refactoring of `db.DefaultContext` (#27083) 1 year ago
topic.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
transfer.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
tree.go Add missing 404 response to Swagger (#27038) 1 year ago
wiki.go Fix an actions schedule bug (#28942) (#28999) 1 year ago