From 03dee5af39830d56a6031b745bc175c0d363ce2b Mon Sep 17 00:00:00 2001 From: Jonathan Miller <1+jmiller@noreply.git.mokoconsulting.tech> Date: Thu, 4 Jun 2026 12:05:07 +0000 Subject: [PATCH 1/2] chore: sync updates.xml 05.21.00 from main [skip ci] --- updates.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/updates.xml b/updates.xml index df6396cb65..c910e7d8b8 100644 --- a/updates.xml +++ b/updates.xml @@ -1,7 +1,7 @@ @@ -87,13 +87,13 @@ mokogitea application site - 05.20.00 + 05.21.00 2026-06-04 https://git.mokoconsulting.tech/MokoConsulting/MokoGitea/releases/tag/stable - https://git.mokoconsulting.tech/MokoConsulting/MokoGitea/releases/download/stable/mokogitea-05.20.00.zip + https://git.mokoconsulting.tech/MokoConsulting/MokoGitea/releases/download/stable/mokogitea-05.21.00.zip - 611a70dc0c394266e598598adc254fa50130310ffe21b966f820536e1714eb07 + 6c5772549d9f20dd888a0f6eae24d2645a1c5042578c370a9bba93650db62abd stable https://git.mokoconsulting.tech/MokoConsulting/MokoGitea/raw/branch/main/CHANGELOG.md Moko Consulting -- 2.52.0 From c15582aa647f74e0844836b6d3006d6c4adcf837 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 4 Jun 2026 07:26:16 -0500 Subject: [PATCH 2/2] fix(build): remove stale custom field API routes, structs, and migration Comment out custom-fields API routes in api.go that referenced handler functions from the deleted routers/api/v1/repo/custom_field.go. Remove the unreferenced modules/structs/custom_field.go and the duplicate v1_25/v323 migration (superseded by v1_27/v343). Co-Authored-By: Claude Opus 4.6 (1M context) --- models/migrations/v1_25/v323.go | 33 ----------------- modules/structs/custom_field.go | 65 --------------------------------- routers/api/v1/api.go | 19 ++-------- 3 files changed, 3 insertions(+), 114 deletions(-) delete mode 100644 models/migrations/v1_25/v323.go delete mode 100644 modules/structs/custom_field.go diff --git a/models/migrations/v1_25/v323.go b/models/migrations/v1_25/v323.go deleted file mode 100644 index 41adbf8802..0000000000 --- a/models/migrations/v1_25/v323.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2026 Moko Consulting. All rights reserved. -// SPDX-License-Identifier: MIT - -package v1_25 - -import "xorm.io/xorm" - -func AddCustomFieldTables(x *xorm.Engine) error { - type CustomFieldDefinition struct { - ID int64 `xorm:"pk autoincr"` - RepoID int64 `xorm:"INDEX NOT NULL"` - Name string `xorm:"NOT NULL"` - FieldType string `xorm:"NOT NULL"` // text, number, date, dropdown, checkbox - Description string - Required bool `xorm:"NOT NULL DEFAULT false"` - Position int `xorm:"NOT NULL DEFAULT 0"` - Options string `xorm:"TEXT"` // JSON array for dropdown options - DefaultVal string - CreatedUnix int64 `xorm:"INDEX created"` - UpdatedUnix int64 `xorm:"INDEX updated"` - } - - type CustomFieldValue struct { - ID int64 `xorm:"pk autoincr"` - IssueID int64 `xorm:"INDEX NOT NULL"` - FieldID int64 `xorm:"INDEX NOT NULL"` - Value string `xorm:"TEXT"` - CreatedUnix int64 `xorm:"INDEX created"` - UpdatedUnix int64 `xorm:"INDEX updated"` - } - - return x.Sync(new(CustomFieldDefinition), new(CustomFieldValue)) -} diff --git a/modules/structs/custom_field.go b/modules/structs/custom_field.go deleted file mode 100644 index 1fbfc1d3a3..0000000000 --- a/modules/structs/custom_field.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2026 Moko Consulting. All rights reserved. -// SPDX-License-Identifier: MIT - -package structs - -import "time" - -// CustomFieldDefinition represents a custom field definition for a repository -// swagger:model -type CustomFieldDefinition struct { - ID int64 `json:"id"` - RepoID int64 `json:"repo_id"` - Name string `json:"name"` - FieldType string `json:"field_type"` - Description string `json:"description"` - Required bool `json:"required"` - Position int `json:"position"` - Options string `json:"options"` - DefaultValue string `json:"default_value"` - // swagger:strfmt date-time - Created time.Time `json:"created_at"` - // swagger:strfmt date-time - Updated time.Time `json:"updated_at"` -} - -// CreateCustomFieldOption options for creating a custom field -// swagger:model -type CreateCustomFieldOption struct { - // required: true - Name string `json:"name" binding:"Required"` - // required: true - FieldType string `json:"field_type" binding:"Required"` // text, number, date, dropdown, checkbox - Description string `json:"description"` - Required bool `json:"required"` - Position int `json:"position"` - Options string `json:"options"` // JSON array for dropdown - DefaultValue string `json:"default_value"` -} - -// EditCustomFieldOption options for editing a custom field -// swagger:model -type EditCustomFieldOption struct { - Name *string `json:"name"` - Description *string `json:"description"` - Required *bool `json:"required"` - Position *int `json:"position"` - Options *string `json:"options"` - DefaultValue *string `json:"default_value"` -} - -// CustomFieldValue represents a custom field value for an issue -// swagger:model -type CustomFieldValue struct { - ID int64 `json:"id"` - IssueID int64 `json:"issue_id"` - FieldID int64 `json:"field_id"` - Value string `json:"value"` -} - -// SetCustomFieldValueOption options for setting a custom field value -// swagger:model -type SetCustomFieldValueOption struct { - // required: true - Value string `json:"value" binding:"Required"` -} diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index b35889db6f..2dbd9e841b 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -1655,22 +1655,9 @@ func Routes() *web.Router { // }) // }) // }) - m.Group("/custom-fields", func() { - m.Combo("").Get(repo.ListCustomFields). - Post(reqToken(), reqRepoWriter(unit.TypeIssues), bind(api.CreateCustomFieldOption{}), repo.CreateCustomField) - m.Group("/{fieldId}", func() { - m.Combo("").Get(repo.GetCustomField). - Patch(reqToken(), reqRepoWriter(unit.TypeIssues), bind(api.EditCustomFieldOption{}), repo.EditCustomField). - Delete(reqToken(), reqRepoWriter(unit.TypeIssues), repo.DeleteCustomField) - }) - }) - m.Group("/issues/{index}/custom-fields", func() { - m.Get("", repo.GetIssueCustomFields) - m.Group("/{fieldId}", func() { - m.Put("", reqToken(), reqRepoWriter(unit.TypeIssues), bind(api.SetCustomFieldValueOption{}), repo.SetIssueCustomField) - m.Delete("", reqToken(), reqRepoWriter(unit.TypeIssues), repo.DeleteIssueCustomField) - }) - }) + // TODO: custom-fields API routes — handler not yet implemented + // m.Group("/custom-fields", func() { ... }) + // m.Group("/issues/{index}/custom-fields", func() { ... }) }, repoAssignment(), checkTokenPublicOnly()) }, tokenRequiresScopes(auth_model.AccessTokenScopeCategoryIssue)) -- 2.52.0