feat: migrate update_stream_config metadata to org-level custom fields #492

Open
opened 2026-06-05 01:00:00 +00:00 by jmiller · 0 comments
Owner

Summary

Replace the hardcoded metadata columns in update_stream_config with org-level repo-scoped custom fields. The Update Server feed generator and all related workflows will read from custom field values instead of the dedicated config table columns.

Scope

This is a multi-phase migration that touches MokoGitea code, moko-platform workflows, and all Joomla/Dolibarr repo manifests.

Phase 1: Create Custom Fields for All Metadata

Add org-level repo-scoped custom fields matching the update_stream_config columns:

Custom Field Replaces Column Type
Platform platform dropdown: joomla, dolibarr, generic
Extension Name extension_name text
Display Name display_name text
Extension Type extension_type dropdown: package, plugin, module, component, template, library
Target Version target_version text
PHP Minimum php_minimum text
Support URL support_url url
Download Gating download_gating dropdown: none, prerelease, all
Key Prefix key_prefix text

Fields already created: Platform, Package Type (maps to Extension Type), Language, Entry Point, Standards Version

Fields still needed: Extension Name, Display Name, Target Version, PHP Minimum, Support URL, Download Gating, Key Prefix

Phase 2: Populate Values from Existing Config

For every repo with an update_stream_config row, copy the column values into the corresponding custom field values via SQL or API.

Phase 3: Update Feed Generator

Refactor services/updateserver/joomla.go (GenerateJoomlaXML) to read metadata from custom field values instead of UpdateStreamConfig:

// Before
cfg := licenses.GetEffectiveConfig(ctx, repo.OwnerID, repo.ID)
element := cfg.ExtensionName

// After
metadata, _ := issues_model.GetCustomFieldValuesMap(ctx, repo.ID)
element := metadata[fieldIDs.ExtensionName]

Same for Dolibarr, WordPress, Composer, PrestaShop, Drupal, WHMCS generators.

Phase 4: Update Licensing Settings UI

The repo Settings > Update Server page currently has form fields for extension_name, display_name, etc. These should be removed since the data now lives in Settings > Metadata.

Keep only licensing-specific settings in Update Server:

  • Enable Update Server (toggle)
  • Require Key (toggle)
  • Feed Visibility
  • Stream Mode / Custom Streams

Phase 5: Refactor moko-platform

Manifest Reader

  • cli/manifest_read.php currently reads .mokogitea/manifest.xml
  • Update to read from Gitea API: GET /api/v1/repos/{owner}/{repo}/metadata
  • Fall back to manifest.xml if API unavailable

Workflows

  • auto-release.yml uses manifest.xml for platform detection
  • Update to use Gitea API metadata endpoint
  • pr-check.yml validates manifest.xml format
  • Update to validate custom field values via API
  • repo-health.yml checks for manifest.xml presence
  • Update to check for metadata completeness via API

Bulk Sync

  • automation/sync-all-repos.sh pushes manifest.xml to all repos
  • Replace with API calls to set metadata custom fields

Phase 6: Remove Old Columns

Once all consumers are migrated:

  1. Remove columns from update_stream_config: extension_name, display_name, description, extension_type, maintainer, maintainer_url, info_url, target_version, php_minimum, support_url, key_prefix
  2. Remove corresponding form fields from templates
  3. Remove Go struct fields from UpdateStreamConfig
  4. Migration to drop columns

Phase 7: Deprecate manifest.xml

  • Remove .mokogitea/manifest.xml from all repos
  • Remove manifest.xml template from moko-platform
  • Update moko-platform standards docs
  • Remove manifest validation from pr-check workflow

Testing Checklist

  • All update XML feeds generate correctly from custom fields
  • Joomla update checker receives correct metadata
  • Repo Settings > Metadata page shows all fields
  • API GET/PUT metadata works for all repos
  • moko-platform workflows use API instead of manifest.xml
  • No regression in license key validation
  • No regression in download gating

Dependencies

  • #483 (org-level custom fields) - DONE
  • Custom fields API - DONE
  • Repo metadata settings page - DONE

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

## Summary Replace the hardcoded metadata columns in `update_stream_config` with org-level repo-scoped custom fields. The Update Server feed generator and all related workflows will read from custom field values instead of the dedicated config table columns. ## Scope This is a multi-phase migration that touches MokoGitea code, moko-platform workflows, and all Joomla/Dolibarr repo manifests. ## Phase 1: Create Custom Fields for All Metadata Add org-level repo-scoped custom fields matching the `update_stream_config` columns: | Custom Field | Replaces Column | Type | |---|---|---| | Platform | `platform` | dropdown: joomla, dolibarr, generic | | Extension Name | `extension_name` | text | | Display Name | `display_name` | text | | Extension Type | `extension_type` | dropdown: package, plugin, module, component, template, library | | Target Version | `target_version` | text | | PHP Minimum | `php_minimum` | text | | Support URL | `support_url` | url | | Download Gating | `download_gating` | dropdown: none, prerelease, all | | Key Prefix | `key_prefix` | text | Fields already created: Platform, Package Type (maps to Extension Type), Language, Entry Point, Standards Version Fields still needed: Extension Name, Display Name, Target Version, PHP Minimum, Support URL, Download Gating, Key Prefix ## Phase 2: Populate Values from Existing Config For every repo with an `update_stream_config` row, copy the column values into the corresponding custom field values via SQL or API. ## Phase 3: Update Feed Generator Refactor `services/updateserver/joomla.go` (`GenerateJoomlaXML`) to read metadata from custom field values instead of `UpdateStreamConfig`: ```go // Before cfg := licenses.GetEffectiveConfig(ctx, repo.OwnerID, repo.ID) element := cfg.ExtensionName // After metadata, _ := issues_model.GetCustomFieldValuesMap(ctx, repo.ID) element := metadata[fieldIDs.ExtensionName] ``` Same for Dolibarr, WordPress, Composer, PrestaShop, Drupal, WHMCS generators. ## Phase 4: Update Licensing Settings UI The repo Settings > Update Server page currently has form fields for extension_name, display_name, etc. These should be removed since the data now lives in Settings > Metadata. Keep only licensing-specific settings in Update Server: - Enable Update Server (toggle) - Require Key (toggle) - Feed Visibility - Stream Mode / Custom Streams ## Phase 5: Refactor moko-platform ### Manifest Reader - `cli/manifest_read.php` currently reads `.mokogitea/manifest.xml` - Update to read from Gitea API: `GET /api/v1/repos/{owner}/{repo}/metadata` - Fall back to manifest.xml if API unavailable ### Workflows - `auto-release.yml` uses manifest.xml for platform detection - Update to use Gitea API metadata endpoint - `pr-check.yml` validates manifest.xml format - Update to validate custom field values via API - `repo-health.yml` checks for manifest.xml presence - Update to check for metadata completeness via API ### Bulk Sync - `automation/sync-all-repos.sh` pushes manifest.xml to all repos - Replace with API calls to set metadata custom fields ## Phase 6: Remove Old Columns Once all consumers are migrated: 1. Remove columns from `update_stream_config`: extension_name, display_name, description, extension_type, maintainer, maintainer_url, info_url, target_version, php_minimum, support_url, key_prefix 2. Remove corresponding form fields from templates 3. Remove Go struct fields from `UpdateStreamConfig` 4. Migration to drop columns ## Phase 7: Deprecate manifest.xml - Remove `.mokogitea/manifest.xml` from all repos - Remove manifest.xml template from moko-platform - Update moko-platform standards docs - Remove manifest validation from pr-check workflow ## Testing Checklist - [ ] All update XML feeds generate correctly from custom fields - [ ] Joomla update checker receives correct metadata - [ ] Repo Settings > Metadata page shows all fields - [ ] API GET/PUT metadata works for all repos - [ ] moko-platform workflows use API instead of manifest.xml - [ ] No regression in license key validation - [ ] No regression in download gating ## Dependencies - #483 (org-level custom fields) - DONE - Custom fields API - DONE - Repo metadata settings page - DONE --- _Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>_
Sign in to join this conversation.
No labels
Status
Type Feature
Status
Priority
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoGitea#492