Reference in New Issue
Block a user
Delete Branch "feature/updateserver-adopt-registry"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adopts the dormant platform-registry helpers (added in #826) in the update
server and fixes #811 (npm/mcp/go repos still served a Joomla
updates.xml).Not built/deployed — requires forge rebuild + redeploy; the user builds/deploys.
Changes
1. Registry adoption (
routers/web/repo/updateserver.go)ServeUpdatesXML(Joomla) andServeDolibarrJSONnow gate viaservices/updateserver.PlatformServesGenerator(platform, "joomla"|"dolibarr")— a registry
update_generatorlookup — instead of hardcoded platform-constantcomparisons. The
bothcompound platform (no standalone registry entry) is keptas an explicit OR so it still serves both feeds.
Serve*handlers (wordpress, composer, prestashop, drupal, whmcs)gain a registry-driven
IsFeedlessPlatformguard so a feedless metadata platformcan never leak a feed.
2.
IsFeedlessPlatformis now registry-driven (models/updateserver/platform.go)feed_format == "none"(npm / mcp / go, plus any admin-configured feedless platform). The static
feedlessPlatformsmap is kept only as a fallback for keys unknown to the registry.feed_format(notupdate_generator) is the authoritative signal — npm/mcpcarry
update_generator == "npm"(their build/publish generator) butfeed_format == "none".3. #811 precedence fix (
ResolvePlatform)update_stream_config.PlatformisNOT NULL DEFAULT 'joomla', so everylicensing-enabled repo carries a config row that resolves to
joomlaeven whenits
metadata.platformis npm/mcp/go — and it still served a Joomla feed.New precedence: a registry-recognized feedless
metadata.platformnow wins overthe config row, including the default-
joomlarow. So npm/mcp/go repos returnNotFound instead of a bogus Joomla feed.
Review the metadata-over-default-config precedence.
Joomla-preservation reasoning: a genuine Joomla repo has
metadata.platform == "joomla"(or empty), which is NOT feedless, so the configplatform still wins and the Joomla feed is served exactly as before. An explicit
non-joomla config override is still honored for non-feedless metadata. The only
behavior that changes is that a repo whose metadata says npm/mcp/go no longer
serves a feed just because it carries a default-
joomlaconfig row. Because thepragmatic rule is "feedless metadata wins," an explicit non-joomla config (e.g.
dolibarr) combined with npm/mcp/go metadata also yields NotFound — an npm reposhould not serve a Dolibarr feed.
Build / verification status
No Go toolchain in the authoring environment — unbuilt. Changes were matched to
existing signatures and gofmt style by hand:
services/updateserver.PlatformServesGenerator(platform, generator string) bool(services/updateserver/registry.go:70)updateserver_model.IsFeedlessPlatform(platform string) bool(models/updateserver/platform.go)updateserver_model.ResolvePlatform(cfgPlatform, metadataPlatform string) string(models/updateserver/platform.go)RepoUpdatePlatformis set upstream in services/context/repo.go:718 and services/context/repo_public_feed.go:64.Fixes #811. Refs #367, #810, #826.
https://claude.ai/code/session_015UauDPfYC8S2mdUhoSK8zQ