Skip to content

Integration tests: download marketplace modules on demand instead of bundling .mpk (unblocks agent-editor demo) #647

Description

@ako

Goal

Replace the marketplace .mpk files bundled in mx-modules/ with on-demand marketplace downloads during integration testing, now that mxcli marketplace download/install exists. This removes binary blobs from the repo and — more importantly — unblocks integration-testing the agent-editor demo (27/28), whose 7-module dependency is too large to bundle.

Current mechanism

mdl/executor/roundtrip_doctype_test.go runs each doctype script against a fresh project and, for scripts in scriptModuleDeps, imports a bundled .mpk via mx module-import:

var scriptModuleDeps = map[string][]string{
    "05-database-connection-examples.mdl": {"ExternalDatabaseConnector-v6.2.3.mpk"},
    "13-business-events-examples.mdl":     {"BusinessEvents_3.12.0.mpk"},
}

27/28 (agent editor) are not in the map — their 7 modules aren't bundled, so they can't be integration-tested with full references today.

Proposed approach — hybrid resolver (not a hard replacement)

A module resolver backed by a pinned manifest (contentId + exact version):

resolve(module) -> local .mpk:
  1. cache hit (gitignored cache / CI cache)              -> use it
  2. else MENDIX_PAT set -> marketplace download --version <pinned> -> cache
  3. else bundled .mpk exists                              -> offline fallback
  4. else skip test with a clear reason
  • PAT-gated so contributors without a token still run the suite (fallback/skip).
  • Manifest replaces hardcoded .mpk filenames; version bump = one-line edit.
  • Wire 27/28 into the manifest with the 7 agent-stack content-ids.

Resolved content-ids (verified live 2026-06)

  • External Database Connector = content 219862 (NOT 2888 — 2888 is the separate "Database Connector"). Version 6.2.3 is available (min Mendix 11.4.0), so the exact bundled version is reproducible: marketplace download 219862 --version 6.2.3.
  • BusinessEvents (BusinessEvents_3.12.0.mpk) — content-id TBD (not surfaced by client-side search; needs raw-API lookup).
  • Agent stack (7) — GenAICommons, MxGenAIConnector, AgentCommons, AgentEditorCommons, MCPClient, ConversationalUI, Encryption — content-ids TBD.

Open decisions

  • CI auth: is a MENDIX_PAT CI secret acceptable? If not, download-backed tests stay opt-in (local, MENDIX_PAT-gated) and CI keeps bundled modules.
  • Scope: hybrid resolver for all three, agent-demo only, or full removal of mx-modules/*.mpk.
  • Cache location: gitignored dir vs CI cache key.

Caveats

  • Network/availability dependency on marketplace.mendix.com + CDN (flake risk).
  • mx module-import needs version-matched mxbuild; downloaded module minSupportedMendixVersion must be compatible with the test's Mendix version.
  • Old versions can be unpublished over time — pin to available versions and keep the bundled fallback until proven.

References

  • docs/11-proposals/PROPOSAL_marketplace_modules.md (Phase B / download shipped)
  • mdl/executor/roundtrip_doctype_test.go (scriptModuleDeps)
  • Agent 7-module dependency: .claude/skills/mendix/agents.md, mdl-examples/doctype-tests/27/28

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions