feat(updateserver): adopt platform registry + feedless metadata platforms return N/A over default-joomla config [#367 #811] #830

Merged
jmiller merged 1 commits from feature/updateserver-adopt-registry into dev 2026-07-19 06:12:09 +00:00
Owner

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) and ServeDolibarrJSON now gate via
    services/updateserver.PlatformServesGenerator(platform, "joomla"|"dolibarr")
    — a registry update_generator lookup — instead of hardcoded platform-constant
    comparisons. The both compound platform (no standalone registry entry) is kept
    as an explicit OR so it still serves both feeds.
  • The remaining Serve* handlers (wordpress, composer, prestashop, drupal, whmcs)
    gain a registry-driven IsFeedlessPlatform guard so a feedless metadata platform
    can never leak a feed.

2. IsFeedlessPlatform is now registry-driven (models/updateserver/platform.go)

  • A platform is feedless when the registry gives it feed_format == "none"
    (npm / mcp / go, plus any admin-configured feedless platform). The static
    feedlessPlatforms map is kept only as a fallback for keys unknown to the registry.
  • Note: feed_format (not update_generator) is the authoritative signal — npm/mcp
    carry update_generator == "npm" (their build/publish generator) but feed_format == "none".

3. #811 precedence fix (ResolvePlatform)

update_stream_config.Platform is NOT NULL DEFAULT 'joomla', so every
licensing-enabled repo carries a config row that resolves to joomla even when
its metadata.platform is npm/mcp/go — and it still served a Joomla feed.

New precedence: a registry-recognized feedless metadata.platform now wins over
the config row
, including the default-joomla row. So npm/mcp/go repos return
NotFound 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 config
platform 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-joomla config row. Because the
pragmatic rule is "feedless metadata wins," an explicit non-joomla config (e.g.
dolibarr) combined with npm/mcp/go metadata also yields NotFound — an npm repo
should 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)
  • RepoUpdatePlatform is 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

## 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) and `ServeDolibarrJSON` now gate via `services/updateserver.PlatformServesGenerator(platform, "joomla"|"dolibarr")` — a registry `update_generator` lookup — instead of hardcoded platform-constant comparisons. The `both` compound platform (no standalone registry entry) is kept as an explicit OR so it still serves both feeds. - The remaining `Serve*` handlers (wordpress, composer, prestashop, drupal, whmcs) gain a registry-driven `IsFeedlessPlatform` guard so a feedless metadata platform can never leak a feed. ### 2. `IsFeedlessPlatform` is now registry-driven (`models/updateserver/platform.go`) - A platform is feedless when the registry gives it `feed_format == "none"` (npm / mcp / go, plus any admin-configured feedless platform). The static `feedlessPlatforms` map is kept only as a fallback for keys unknown to the registry. - Note: `feed_format` (not `update_generator`) is the authoritative signal — npm/mcp carry `update_generator == "npm"` (their build/publish generator) but `feed_format == "none"`. ### 3. #811 precedence fix (`ResolvePlatform`) `update_stream_config.Platform` is `NOT NULL DEFAULT 'joomla'`, so every licensing-enabled repo carries a config row that resolves to `joomla` even when its `metadata.platform` is npm/mcp/go — and it still served a Joomla feed. New precedence: **a registry-recognized feedless `metadata.platform` now wins over the config row**, including the default-`joomla` row. So npm/mcp/go repos return NotFound 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 config platform 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-`joomla` config row. Because the pragmatic rule is "feedless metadata wins," an explicit non-joomla config (e.g. `dolibarr`) combined with npm/mcp/go metadata also yields NotFound — an npm repo should 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) - `RepoUpdatePlatform` is 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
jmiller added 1 commit 2026-07-19 05:19:50 +00:00
feat(updateserver): adopt platform registry + feedless metadata platforms return N/A over default-joomla config [#367 #811]
Universal: Auto Version Bump / Version Bump (push) Successful in 15s
Generic: Project CI / Lint & Validate (pull_request) Successful in 44s
Generic: Project CI / Tests (pull_request) Successful in 44s
Universal: PR Check / Branch Policy (pull_request) Has been cancelled
Universal: PR Check / Require Docs Update (pull_request) Has been cancelled
Universal: PR Check / Wiki Update Reminder (pull_request) Has been cancelled
Universal: PR Check / Secret Scan (pull_request) Has been cancelled
Universal: PR Check / Validate PR (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Branch Cleanup / Delete merged branch (pull_request) Has been cancelled
RC Revert / Rename rc/ back to dev/ (pull_request) Has been cancelled
5d0d543acc
Rewire the update server's per-platform serve/NotFound gating onto the
platform registry (modules/setting) so the update-feed generator and
wire format for a platform are looked up from config instead of
hardcoded, and fix #811 where npm/mcp/go repos still served a Joomla
updates.xml.

- routers/web/repo/updateserver.go: ServeUpdatesXML and ServeDolibarrJSON
  now gate via services/updateserver.PlatformServesGenerator (registry
  update_generator lookup) plus the "both" compound platform. The other
  Serve* handlers gain a registry-driven IsFeedlessPlatform guard.
- models/updateserver/platform.go: IsFeedlessPlatform is now registry-
  driven (feed_format == "none" covers npm/mcp/go and any admin-configured
  feedless platform), with the static map kept as a fallback.
- #811 precedence fix in ResolvePlatform: a registry-recognized feedless
  metadata platform now overrides the update_stream_config.Platform row,
  including the `NOT NULL DEFAULT 'joomla'` row every licensing-enabled
  repo carries. Genuine Joomla repos (metadata.platform joomla/empty, not
  feedless) still let the config platform win and serve exactly as before;
  an explicit non-joomla config override is still honored for non-feedless
  metadata.

Not built/deployed: no Go toolchain available in this environment; changes
match existing signatures and gofmt style by hand. Requires forge rebuild
+ redeploy.

Authored-by: Moko Consulting <hello@mokoconsulting.tech>
jmiller marked the pull request as work in progress 2026-07-19 05:20:04 +00:00
jmiller marked the pull request as ready for review 2026-07-19 06:10:58 +00:00
jmiller merged commit 375fccf12d into dev 2026-07-19 06:12:09 +00:00
jmiller deleted branch feature/updateserver-adopt-registry 2026-07-19 06:12:10 +00:00
Sign in to join this conversation.