From eafd5320e3eaffebb01cdf0758d6c423329b83df Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sun, 31 May 2026 13:41:35 -0500 Subject: [PATCH 1/2] fix(build): remove unused imports causing compile errors Co-Authored-By: Claude Opus 4.6 (1M context) --- routers/web/repo/issue_new.go | 1 - routers/web/repo/issue_view.go | 1 - routers/web/user/home.go | 1 - routers/web/user/notification.go | 1 - 4 files changed, 4 deletions(-) diff --git a/routers/web/repo/issue_new.go b/routers/web/repo/issue_new.go index 07d7a74f20..8fc5afa035 100644 --- a/routers/web/repo/issue_new.go +++ b/routers/web/repo/issue_new.go @@ -22,7 +22,6 @@ import ( user_model "code.mokoconsulting.tech/MokoConsulting/MokoGitea/models/user" "code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/base" "code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/container" - "code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/git" issue_template "code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/issue/template" "code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/log" "code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/setting" diff --git a/routers/web/repo/issue_view.go b/routers/web/repo/issue_view.go index 444d1c0944..7ab1be62f0 100644 --- a/routers/web/repo/issue_view.go +++ b/routers/web/repo/issue_view.go @@ -23,7 +23,6 @@ import ( "code.mokoconsulting.tech/MokoConsulting/MokoGitea/models/unit" user_model "code.mokoconsulting.tech/MokoConsulting/MokoGitea/models/user" "code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/emoji" - "code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/git" "code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/log" "code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/markup" "code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/markup/markdown" diff --git a/routers/web/user/home.go b/routers/web/user/home.go index 065c1fd489..bda0d526ab 100644 --- a/routers/web/user/home.go +++ b/routers/web/user/home.go @@ -39,7 +39,6 @@ import ( "code.mokoconsulting.tech/MokoConsulting/MokoGitea/routers/web/shared/user" "code.mokoconsulting.tech/MokoConsulting/MokoGitea/services/context" feed_service "code.mokoconsulting.tech/MokoConsulting/MokoGitea/services/feed" - issue_service "code.mokoconsulting.tech/MokoConsulting/MokoGitea/services/issue" pull_service "code.mokoconsulting.tech/MokoConsulting/MokoGitea/services/pull" "github.com/ProtonMail/go-crypto/openpgp" diff --git a/routers/web/user/notification.go b/routers/web/user/notification.go index 95c3bd4f14..f9f8606a15 100644 --- a/routers/web/user/notification.go +++ b/routers/web/user/notification.go @@ -23,7 +23,6 @@ import ( "code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/templates" "code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/util" "code.mokoconsulting.tech/MokoConsulting/MokoGitea/services/context" - issue_service "code.mokoconsulting.tech/MokoConsulting/MokoGitea/services/issue" pull_service "code.mokoconsulting.tech/MokoConsulting/MokoGitea/services/pull" ) -- 2.52.0 From e998c494b2bd82ce61e3d933eb516fd7828d6bbf Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sun, 31 May 2026 13:46:06 -0500 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20resolve=20tech-debt=20batch=207=20?= =?UTF-8?q?=E2=80=94=20dead=20routes,=20stale=20FIXMEs,=20feed=20revision?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - chore: remove stale mustNotBeArchived FIXME (CanEnableEditor no longer exists) - fix(routes): remove dead /cherry-pick/{sha} route — replaced by /_cherrypick/ - fix(feed): use full ref name instead of ShortName for file feed revision Co-Authored-By: Claude Opus 4.6 (1M context) --- CHANGELOG.md | 3 +++ routers/api/v1/api.go | 1 - routers/web/feed/file.go | 2 +- routers/web/web.go | 2 -- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd1be8502e..361958f37f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,9 @@ been added to each release, please refer to the [blog](https://blog.gitea.com). * chore: remove stale TODO from OAuth2 regenerate secret (already implemented) (#332) * chore: remove stale pull request test stub TODOs (#328) * chore: remove stale GetProjectsMode TODO + * chore: remove stale mustNotBeArchived/mustEnableEditor FIXME from API + * fix(routes): remove dead legacy /cherry-pick/{sha} route (replaced by /_cherrypick/) + * fix(feed): use full ref name instead of ShortName for file feed revision * BUGFIXES * fix(build): use slices.Collect for maps.Values (Go 1.23+ compat) * fix(licenses): remove duplicate DeleteLicenseKey declaration diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 59dd7dcb5a..be8f883809 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -731,7 +731,6 @@ func mustEnableWiki(ctx *context.APIContext) { } } -// FIXME: for consistency, maybe most mustNotBeArchived checks should be replaced with mustEnableEditor func mustNotBeArchived(ctx *context.APIContext) { if ctx.Repo.Repository.IsArchived { ctx.APIError(http.StatusLocked, fmt.Errorf("%s is archived", ctx.Repo.Repository.FullName())) diff --git a/routers/web/feed/file.go b/routers/web/feed/file.go index 791773ee06..d507cfea54 100644 --- a/routers/web/feed/file.go +++ b/routers/web/feed/file.go @@ -22,7 +22,7 @@ func ShowFileFeed(ctx *context.Context, repo *repo.Repository, formatType string } commits, err := ctx.Repo.GitRepo.CommitsByFileAndRange( git.CommitsByFileAndRangeOptions{ - Revision: ctx.Repo.RefFullName.ShortName(), // FIXME: legacy code used ShortName + Revision: ctx.Repo.RefFullName.String() File: fileName, Page: 1, }) diff --git a/routers/web/web.go b/routers/web/web.go index 5298c5ada4..bf55b889ca 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -1748,8 +1748,6 @@ func registerWebRoutes(m *web.Router, webAuth *AuthMiddleware) { m.Get("/commit/{sha:([a-f0-9]{7,64})$}", repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.Diff) m.Get("/commit/{sha:([a-f0-9]{7,64})$}/load-branches-and-tags", repo.LoadBranchesAndTags) - // FIXME: this route `/cherry-pick/{sha}` doesn't seem useful or right, the new code always uses `/_cherrypick/` which could handle branch name correctly - m.Get("/cherry-pick/{sha:([a-f0-9]{7,64})$}", repo.SetEditorconfigIfExists, context.RepoRefByDefaultBranch(), repo.CherryPick) }, repo.MustBeNotEmpty) m.Get("/rss/branch/*", context.RepoRefByType(git.RefTypeBranch), webAuth.AllowBasic, feedEnabled, feed.RenderBranchFeedRSS) -- 2.52.0