gitea/services/issue
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`
2024-02-14 01:32:31 +00:00
..
assignee.go Move notification interface to services layer (#26915) 2023-09-05 18:37:47 +00:00
assignee_test.go Use more specific test methods (#24265) 2023-04-22 17:56:27 -04:00
comments.go More `db.DefaultContext` refactor (#27265) (#27347) 2023-09-29 13:35:01 +00:00
commit.go Add context parameter to some database functions (#26055) 2023-07-22 22:14:27 +08:00
commit_test.go Replace 'userxx' with 'orgxx' in all test files when the user type is org (#27052) 2023-09-14 02:59:53 +00:00
content.go More `db.DefaultContext` refactor (#27265) (#27347) 2023-09-29 13:35:01 +00:00
issue.go Avoid run change title process when the title is same (#27467) (#27558) 2023-10-10 09:01:46 +02:00
issue_test.go Use more specific test methods (#24265) 2023-04-22 17:56:27 -04:00
label.go Next round of `db.DefaultContext` refactor (#27089) 2023-09-16 14:39:12 +00:00
label_test.go Next round of `db.DefaultContext` refactor (#27089) 2023-09-16 14:39:12 +00:00
main_test.go move repository deletion to service layer (#26948) 2023-09-08 04:51:15 +00:00
milestone.go Move notification interface to services layer (#26915) 2023-09-05 18:37:47 +00:00
milestone_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
status.go Move notification interface to services layer (#26915) 2023-09-05 18:37:47 +00:00
template.go Refactor issue template parsing and fix API endpoint (#29069) (#29140) 2024-02-14 01:32:31 +00:00