From 125eefc65005b1bff2dcc04eec4232751e26e37c Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sun, 5 Jul 2026 00:06:48 -0500 Subject: [PATCH] fix: repair build (renamed org-visibility helper) + gofmt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two pre-existing issues surfaced when the org-governance series was compiled locally with a real Go toolchain (go1.26.3) for the first time: - routers/api/v1/api.go:519 called organization.HasOrgOrUserVisible, which no longer exists — it was renamed to IsOwnerVisibleToDoer (models/organization/ org.go:548, identical signature). This one missed call site meant the whole routers/api/v1 package (and therefore the server binary) failed `go build`. With the rename, `go build ./...` is clean. - gofmt: api.go (a mis-indented commented-out /projects route block) and release.go (import sort: repo before updateserver) were gofmt-dirty. Fixed with gofmt -w on the two files this change already touches. Not part of #727, but blocks building/releasing the fork; found while validating the dev -> main promotion (#733). Claude-Session: https://claude.ai/code/session_01Wsno14cxE49MstXFs9G5KT --- routers/api/v1/api.go | 48 ++++++++++++++++++------------------- services/release/release.go | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index a39d93e934..855fac6acb 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -516,7 +516,7 @@ func reqOrgVisible() func(ctx *context.APIContext) { ctx.APIErrorInternal(errors.New("reqOrgVisible: unprepared context")) return } - if !organization.HasOrgOrUserVisible(ctx, ctx.Org.Organization.AsUser(), ctx.Doer) { + if !organization.IsOwnerVisibleToDoer(ctx, ctx.Org.Organization.AsUser(), ctx.Doer) { ctx.APIErrorNotFound() return } @@ -1698,29 +1698,29 @@ func Routes() *web.Router { Patch(reqToken(), reqRepoWriter(unit.TypeIssues, unit.TypePullRequests), bind(api.EditMilestoneOption{}), repo.EditMilestone). Delete(reqToken(), reqRepoWriter(unit.TypeIssues, unit.TypePullRequests), repo.DeleteMilestone) }) -// m.Group("/projects", func() { -// m.Combo("").Get(repo.ListProjects). -// Post(reqToken(), reqRepoWriter(unit.TypeProjects), bind(api.CreateProjectOption{}), repo.CreateProject) -// m.Group("/{id}", func() { -// m.Combo("").Get(repo.GetProject). -// Patch(reqToken(), reqRepoWriter(unit.TypeProjects), bind(api.EditProjectOption{}), repo.EditProject). -// Delete(reqToken(), reqRepoWriter(unit.TypeProjects), repo.DeleteProject) -// m.Post("/{action}", reqToken(), reqRepoWriter(unit.TypeProjects), repo.ChangeProjectStatus) -// m.Group("/columns", func() { -// m.Combo("").Get(repo.ListProjectColumns). -// Post(reqToken(), reqRepoWriter(unit.TypeProjects), bind(api.CreateProjectColumnOption{}), repo.CreateProjectColumn) -// m.Group("/{columnId}", func() { -// m.Delete("", reqToken(), reqRepoWriter(unit.TypeProjects), repo.DeleteProjectColumn) -// m.Combo("/issues").Get(repo.ListProjectColumnIssues). -// Post(reqToken(), reqRepoWriter(unit.TypeProjects), bind(api.AddProjectColumnIssueOption{}), repo.AddIssueToColumn) -// }) -// }) -// m.Group("/issues/{issueId}", func() { -// m.Patch("/move", reqToken(), reqRepoWriter(unit.TypeProjects), bind(api.MoveProjectColumnIssueOption{}), repo.MoveIssueOnColumn) -// m.Delete("", reqToken(), reqRepoWriter(unit.TypeProjects), repo.RemoveIssueFromProject) -// }) -// }) -// }) + // m.Group("/projects", func() { + // m.Combo("").Get(repo.ListProjects). + // Post(reqToken(), reqRepoWriter(unit.TypeProjects), bind(api.CreateProjectOption{}), repo.CreateProject) + // m.Group("/{id}", func() { + // m.Combo("").Get(repo.GetProject). + // Patch(reqToken(), reqRepoWriter(unit.TypeProjects), bind(api.EditProjectOption{}), repo.EditProject). + // Delete(reqToken(), reqRepoWriter(unit.TypeProjects), repo.DeleteProject) + // m.Post("/{action}", reqToken(), reqRepoWriter(unit.TypeProjects), repo.ChangeProjectStatus) + // m.Group("/columns", func() { + // m.Combo("").Get(repo.ListProjectColumns). + // Post(reqToken(), reqRepoWriter(unit.TypeProjects), bind(api.CreateProjectColumnOption{}), repo.CreateProjectColumn) + // m.Group("/{columnId}", func() { + // m.Delete("", reqToken(), reqRepoWriter(unit.TypeProjects), repo.DeleteProjectColumn) + // m.Combo("/issues").Get(repo.ListProjectColumnIssues). + // Post(reqToken(), reqRepoWriter(unit.TypeProjects), bind(api.AddProjectColumnIssueOption{}), repo.AddIssueToColumn) + // }) + // }) + // m.Group("/issues/{issueId}", func() { + // m.Patch("/move", reqToken(), reqRepoWriter(unit.TypeProjects), bind(api.MoveProjectColumnIssueOption{}), repo.MoveIssueOnColumn) + // m.Delete("", reqToken(), reqRepoWriter(unit.TypeProjects), repo.RemoveIssueFromProject) + // }) + // }) + // }) // Repo custom fields (repo-scoped key-value metadata) m.Group("/custom-fields", func() { m.Get("", repo.GetRepoCustomFields) diff --git a/services/release/release.go b/services/release/release.go index ee679d900a..8458c909fe 100644 --- a/services/release/release.go +++ b/services/release/release.go @@ -11,8 +11,8 @@ import ( "code.mokoconsulting.tech/MokoConsulting/MokoGitea/models/db" git_model "code.mokoconsulting.tech/MokoConsulting/MokoGitea/models/git" - updateserver_model "code.mokoconsulting.tech/MokoConsulting/MokoGitea/models/updateserver" repo_model "code.mokoconsulting.tech/MokoConsulting/MokoGitea/models/repo" + updateserver_model "code.mokoconsulting.tech/MokoConsulting/MokoGitea/models/updateserver" user_model "code.mokoconsulting.tech/MokoConsulting/MokoGitea/models/user" "code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/container" "code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/git" -- 2.52.0