feat(updateserver): npm/mcp return N-A instead of Joomla feed; derive platform from metadata [#810 #811] #825

Merged
jmiller merged 1 commits from feature/updateserver-npm-mcp into dev 2026-07-19 02:49:06 +00:00
Owner

Summary

Fixes #810 and #811.

#810 — npm/mcp must not emit a Joomla (or any legacy) feed

Every Serve* update-feed handler in routers/web/repo/updateserver.go now gates positively on its own platform constant. Previously ServeUpdatesXML used platform != "" && platform != "joomla" && platform != "both", so an unset platform fell through to GenerateJoomlaXML (the "empty ⇒ joomla" fallback). Now:

  • ServeUpdatesXML serves only for joomla/both.
  • ServeDolibarrJSON serves only for dolibarr/both (previously served for any non-joomla/non-empty platform — tightened).
  • WordPress/Composer/PrestaShop/Drupal/WHMCS unchanged in effect, converted to named constants.
  • npm/mcp (and any unrecognized platform) now return ctx.NotFound(nil).

Added models/updateserver/platform.go with platform constants, IsFeedlessPlatform(npm/mcp), and ResolvePlatform.

#811 — derive effective platform from metadata.platform

The resolved RepoUpdatePlatform context value now comes from updateserver_model.ResolvePlatform(cfgPlatform, metadataPlatform):

  1. explicit update-stream config platform wins;
  2. else derive from repo metadata (RepoMetadata.Platform, read via GetRepoMetadata);
  3. else fall back to joomla.

Applied in both places that set RepoUpdatePlatform: services/context/repo_public_feed.go (feed endpoints) and services/context/repo.go (release-page UI). This stops the two platform stores from drifting and removes the blanket "empty ⇒ joomla" fallback at its root.

Schema / migration

No migration required. UpdateStreamConfig.Platform is a plain string column (NOT NULL DEFAULT 'joomla') with no DB-level enum/CHECK constraint, and RepoMetadata.Platform is a free VARCHAR(50). npm/mcp are enforced at the application layer only.

Files changed

  • models/updateserver/platform.go (new)
  • routers/web/repo/updateserver.go
  • services/context/repo_public_feed.go
  • services/context/repo.go

Build / deploy

Not built/deployed — requires forge rebuild + redeploy; review signatures against the deployed version. No Go toolchain was available in the authoring environment, so gofmt/go vet were not run; formatting was applied manually (tabs, import ordering). The base branch is dev.

https://claude.ai/code/session_015UauDPfYC8S2mdUhoSK8zQ

## Summary Fixes #810 and #811. ### #810 — npm/mcp must not emit a Joomla (or any legacy) feed Every `Serve*` update-feed handler in `routers/web/repo/updateserver.go` now gates **positively** on its own platform constant. Previously `ServeUpdatesXML` used `platform != "" && platform != "joomla" && platform != "both"`, so an **unset** platform fell through to `GenerateJoomlaXML` (the "empty ⇒ joomla" fallback). Now: - `ServeUpdatesXML` serves only for `joomla`/`both`. - `ServeDolibarrJSON` serves only for `dolibarr`/`both` (previously served for *any* non-joomla/non-empty platform — tightened). - WordPress/Composer/PrestaShop/Drupal/WHMCS unchanged in effect, converted to named constants. - `npm`/`mcp` (and any unrecognized platform) now return `ctx.NotFound(nil)`. Added `models/updateserver/platform.go` with platform constants, `IsFeedlessPlatform(npm/mcp)`, and `ResolvePlatform`. ### #811 — derive effective platform from `metadata.platform` The resolved `RepoUpdatePlatform` context value now comes from `updateserver_model.ResolvePlatform(cfgPlatform, metadataPlatform)`: 1. explicit update-stream config platform wins; 2. else derive from repo metadata (`RepoMetadata.Platform`, read via `GetRepoMetadata`); 3. else fall back to `joomla`. Applied in both places that set `RepoUpdatePlatform`: `services/context/repo_public_feed.go` (feed endpoints) and `services/context/repo.go` (release-page UI). This stops the two platform stores from drifting and removes the blanket "empty ⇒ joomla" fallback at its root. ### Schema / migration **No migration required.** `UpdateStreamConfig.Platform` is a plain string column (`NOT NULL DEFAULT 'joomla'`) with no DB-level enum/CHECK constraint, and `RepoMetadata.Platform` is a free `VARCHAR(50)`. `npm`/`mcp` are enforced at the application layer only. ### Files changed - `models/updateserver/platform.go` (new) - `routers/web/repo/updateserver.go` - `services/context/repo_public_feed.go` - `services/context/repo.go` ## Build / deploy **Not built/deployed — requires forge rebuild + redeploy; review signatures against the deployed version.** No Go toolchain was available in the authoring environment, so `gofmt`/`go vet` were not run; formatting was applied manually (tabs, import ordering). The base branch is `dev`. https://claude.ai/code/session_015UauDPfYC8S2mdUhoSK8zQ
jmiller added 1 commit 2026-07-19 02:08:55 +00:00
feat(updateserver): npm/mcp return N-A instead of Joomla feed; derive platform from metadata [#810 #811]
Universal: PR Check / Branch Policy (pull_request) Successful in 5s
Universal: PR Check / Require Docs Update (pull_request) Has been skipped
Universal: PR Check / Wiki Update Reminder (pull_request) Has been skipped
Generic: Project CI / Tests (pull_request) Successful in 36s
Generic: Project CI / Lint & Validate (pull_request) Successful in 39s
Universal: PR Check / Validate PR (pull_request) Successful in 11s
Universal: PR Check / Secret Scan (pull_request) Successful in 53s
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) Failing after 5m10s
RC Revert / Rename rc/ back to dev/ (pull_request) Failing after 7m39s
9a8d9bc504
#810: The update-feed handlers no longer fall back to a Joomla feed for
unset or feedless platforms. Every Serve* handler now gates positively on
its own platform constant, so npm/mcp (and any unrecognized platform)
return NotFound instead of an (empty) Joomla updates.xml. Added npm/mcp as
recognized platform constants and an IsFeedlessPlatform helper.

#811: The effective update-stream platform (RepoUpdatePlatform) is now
resolved via ResolvePlatform(cfgPlatform, metadataPlatform): an explicit
update-stream config platform wins; otherwise it derives from the repo
metadata platform (metadata.platform); only when neither is set does it
fall back to "joomla". This stops the update-stream store and the repo
metadata store from drifting and removes the "empty => joomla" fallback
at its root (services/context/repo_public_feed.go and repo.go).

No schema/migration required: UpdateStreamConfig.Platform is a plain string
column with no DB-level enum/CHECK constraint, so npm/mcp are enforced at
the application layer only.

Authored-by: Moko Consulting
jmiller merged commit 0efb0eb7bc into dev 2026-07-19 02:49:06 +00:00
jmiller deleted branch feature/updateserver-npm-mcp 2026-07-19 02:49:07 +00:00
Sign in to join this conversation.