fix(api): deactivate issue api for disabled or external issue-tracker (#8829)

- When the issue unit is disabled for a repository, don't allow issue related APIs.
- Added integration tests.
- Resolves #8408

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8829
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: zokki <zokki.softwareschmiede@gmail.com>
Co-committed-by: zokki <zokki.softwareschmiede@gmail.com>
This commit is contained in:
zokki 2025-09-03 16:13:40 +02:00 committed by Gusted
commit 4247c37300
7 changed files with 252 additions and 75 deletions

View file

@ -36,8 +36,8 @@ func TestBadges(t *testing.T) {
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
repo, _, f := tests.CreateDeclarativeRepo(t, owner, "",
[]unit_model.Type{unit_model.TypeActions},
[]unit_model.Type{unit_model.TypeIssues, unit_model.TypePullRequests, unit_model.TypeReleases},
[]unit_model.Type{unit_model.TypeActions, unit_model.TypeReleases},
[]unit_model.Type{unit_model.TypeIssues, unit_model.TypePullRequests},
[]*files_service.ChangeRepoFile{
{
Operation: "create",