Release: PackageType → ExtensionType rename + deploy fixes #648
@@ -433,6 +433,7 @@ func prepareMigrationTasks() []*migration {
|
||||
newMigration(353, "Add distribution metadata fields to repo manifest", v1_27.AddManifestDistributionFields),
|
||||
newMigration(354, "Add org wiki settings to user table", v1_27.AddOrgWikiSettings),
|
||||
newMigration(355, "Migrate update server metadata to repo manifest", v1_27.MigrateUpdateServerFieldsToManifest),
|
||||
newMigration(356, "Rename package_type to extension_type in repo manifest", v1_27.RenamePackageTypeToExtensionType),
|
||||
}
|
||||
return preparedMigrations
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package v1_27
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
||||
// RenamePackageTypeToExtensionType renames the package_type column to extension_type
|
||||
// in the repo_manifest table for clarity (the field represents the Joomla extension type,
|
||||
// not just packages).
|
||||
func RenamePackageTypeToExtensionType(x *xorm.Engine) error {
|
||||
_, err := x.Exec("ALTER TABLE repo_manifest CHANGE COLUMN package_type extension_type VARCHAR(50) NOT NULL DEFAULT ''")
|
||||
return err
|
||||
}
|
||||
@@ -48,7 +48,7 @@ type RepoMetadata struct {
|
||||
|
||||
// build section
|
||||
Language string `xorm:"VARCHAR(50) 'language'"` // Go, PHP, TypeScript, etc.
|
||||
PackageType string `xorm:"VARCHAR(50) 'package_type'"` // application, library, plugin, module, component, package
|
||||
ExtensionType string `xorm:"VARCHAR(50) 'extension_type'"` // component, module, plugin, package, template, library, file
|
||||
EntryPoint string `xorm:"TEXT 'entry_point'"` // build entry point path
|
||||
|
||||
CreatedUnix timeutil.TimeStamp `xorm:"INDEX CREATED 'created_unix'"`
|
||||
@@ -88,11 +88,11 @@ func cleanJoomlaElement(name string) string {
|
||||
// AutoElementName returns the auto-constructed Joomla element name (e.g. pkg_mokosuitebackup).
|
||||
// The name is lowercased and cleaned to match Joomla's InputFilter::clean('cmd') behavior.
|
||||
func (m *RepoMetadata) AutoElementName() string {
|
||||
if m.Name == "" || m.PackageType == "" {
|
||||
if m.Name == "" || m.ExtensionType == "" {
|
||||
return ""
|
||||
}
|
||||
cleaned := cleanJoomlaElement(m.Name)
|
||||
if prefix, ok := joomlaTypePrefix[m.PackageType]; ok {
|
||||
if prefix, ok := joomlaTypePrefix[m.ExtensionType]; ok {
|
||||
return prefix + cleaned
|
||||
}
|
||||
return cleaned
|
||||
|
||||
@@ -30,7 +30,7 @@ type apiMetadata struct {
|
||||
TargetVersion string `json:"target_version"`
|
||||
PHPMinimum string `json:"php_minimum"`
|
||||
Language string `json:"language"`
|
||||
PackageType string `json:"package_type"`
|
||||
ExtensionType string `json:"extension_type"`
|
||||
EntryPoint string `json:"entry_point"`
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ func GetRepoMetadata(ctx *context.APIContext) {
|
||||
TargetVersion: m.TargetVersion,
|
||||
PHPMinimum: m.PHPMinimum,
|
||||
Language: m.Language,
|
||||
PackageType: m.PackageType,
|
||||
ExtensionType: m.ExtensionType,
|
||||
EntryPoint: m.EntryPoint,
|
||||
})
|
||||
}
|
||||
@@ -122,7 +122,7 @@ func UpdateRepoMetadata(ctx *context.APIContext) {
|
||||
TargetVersion: req.TargetVersion,
|
||||
PHPMinimum: req.PHPMinimum,
|
||||
Language: req.Language,
|
||||
PackageType: req.PackageType,
|
||||
ExtensionType: req.ExtensionType,
|
||||
EntryPoint: req.EntryPoint,
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ func UpdateRepoMetadata(ctx *context.APIContext) {
|
||||
TargetVersion: m.TargetVersion,
|
||||
PHPMinimum: m.PHPMinimum,
|
||||
Language: m.Language,
|
||||
PackageType: m.PackageType,
|
||||
ExtensionType: m.ExtensionType,
|
||||
EntryPoint: m.EntryPoint,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ func ServeChangelogXML(ctx *context.Context) {
|
||||
element = elem
|
||||
elementFromManifest = true
|
||||
}
|
||||
if manifest.PackageType != "" {
|
||||
extType = manifest.PackageType
|
||||
if manifest.ExtensionType != "" {
|
||||
extType = manifest.ExtensionType
|
||||
extTypeFromManifest = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ func saveMetadata(ctx *context.Context) {
|
||||
InfoURL: ctx.FormString("info_url"),
|
||||
TargetVersion: ctx.FormString("target_version"),
|
||||
PHPMinimum: ctx.FormString("php_minimum"),
|
||||
PackageType: ctx.FormString("package_type"),
|
||||
ExtensionType: ctx.FormString("extension_type"),
|
||||
EntryPoint: ctx.FormString("entry_point"),
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ type manifestGovernance struct {
|
||||
|
||||
type manifestBuild struct {
|
||||
Language string `xml:"language"`
|
||||
PackageType string `xml:"package-type"`
|
||||
ExtensionType string `xml:"package-type"`
|
||||
EntryPoint string `xml:"entry-point"`
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ func SyncMetadataFromCommit(ctx context.Context, repo *repo_model.Repository, co
|
||||
TargetVersion: mxml.Distribution.TargetVersion,
|
||||
PHPMinimum: mxml.Distribution.PHPMinimum,
|
||||
Language: mxml.Build.Language,
|
||||
PackageType: mxml.Build.PackageType,
|
||||
ExtensionType: mxml.Build.ExtensionType,
|
||||
EntryPoint: mxml.Build.EntryPoint,
|
||||
}
|
||||
|
||||
|
||||
@@ -195,8 +195,8 @@ func resolveExtensionMetadata(ctx context.Context, repo *repo_model.Repository,
|
||||
if elem := manifest.FullElementName(); elem != "" {
|
||||
m.Element = elem
|
||||
}
|
||||
if manifest.PackageType != "" {
|
||||
m.ExtType = manifest.PackageType
|
||||
if manifest.ExtensionType != "" {
|
||||
m.ExtType = manifest.ExtensionType
|
||||
}
|
||||
if manifest.DisplayName != "" {
|
||||
m.DisplayName = manifest.DisplayName
|
||||
|
||||
Reference in New Issue
Block a user