Repository navigation
fix(orchestration): a module page's entry may be a Connect endpoint - #1246
Merged
Merged
Conversation
componentBackendRoutes forwarded a component's /<alias>/ route only to one http or rest endpoint of its service-entry, so a module whose backend is gRPC + Connect (the platform's standard) could not declare a page: every composition with a host gateway refused it. Connect is HTTP on its own listener, so the host forwards a page's calls to it exactly as to an HTTP endpoint. pageEntryEndpoint now selects the one http, rest or connect endpoint; one rest beside one connect goes to connect (REST is deprecated); none or several is still refused, naming the endpoints the entry declares. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The gap
A module or solution declares a page with
solution.frontend.codefly.yamlbeside itsservice-entry.componentBackendRoutes(pkg/orchestration/host_route_carriers.go) forwarded the component's/<alias>/route only to onehttporrestendpoint of that entry. A module whose backend is gRPC + Connect — the platform's standard since REST was deprecated — could therefore not own a page: every composition with a host gateway refused it ("declares no http or rest endpoint").Real case: obin-ai/module-directory
modules/org-directory/services/directorydeclaresgrpcandconnect. Its page,services/fe-remote(a Module Federation remote exposing./Page), calls the backend through the host's module proxy/v1/<alias>. Declaring the page was blocked on this (obin-ai/module-directory#13).The fix
pageEntryEndpointselects the page's entry endpoint:http,restorconnectendpoint → that one. Connect is HTTP (HTTP/1.1 + JSON) on its own listener, so the carrier routes the page's calls to it exactly as to an HTTP endpoint;restbeside exactly oneconnect→connect, stated in the doc comment (REST is deprecated; Connect serves the same API);httpbesideconnect) → still refused, and the message now names every endpoint the entry declares with its kind, e.g.declares no http, rest or connect endpoint (it declares: grpc (grpc)).Nothing else moves: the carrier, the mesh edges and the cell's consumer edges all read the same derivation (
HostRouteTargets), so a Connect entry gets its carrier, its gateway mesh edge and its cell consumer edge from the existing code.docs/commands.mdstates the rule.Reuse. The existing route derivation, carrier rendering (
hostRouteCarrier) andstandards.CONNECT; no new mechanism. Deliberately not done: routing a module page through the host'smoduleApiBaseinstead (a second path for a job the backend route already does).Tests
TestModulePageGetsACarrierWithoutASolutionConsumernow runs anhttpand agrpc+connectmodule page, in snapshot and run mode; the Connect case gets the…__CONNECTcarrier. Against the old selection rule the Connect cases fail withdeclares no http or rest endpoint(checked).TestAPageEntryIsOneHTTPRestOrConnectEndpoint: grpc+connect → connect; rest+connect → connect; grpc only, nothing, two connect, http+connect → refused, naming the endpoints.TestASolutionBackendIsOneHTTPEndpointOfItsEntry: the refusal messages updated.GOWORK=off go test ./pkg/orchestration/... ./pkg/gitops/...passes;go build ./...,go vet ./pkg/orchestration/,golangci-lint run ./pkg/orchestration/(0 issues).End-to-end proof
On the real case: obin-ai/module-directory
feat/module-page-declaredwithservice-entry: directoryandservices/directory/solution.frontend.codefly.yaml(obin-ai/module-directory#13), composed into platform-obin (a detached worktree of thepocheckout at6cfc960f, withcodefly.local.yamlresolvingorg-directoryto that checkout). The composition was loaded exactly asdeploy gitops renderloads it (common.ResolvePinnedModules,common.LoadWorkspace), and the host gateway's routes were derived byorchestration.HostRouteTargets. The render's carriers, mesh edges and cell consumer edges all read that derivation. The probe was a throwaway program and is not committed.bluelocal7c237690(v0.1.227)REFUSED: component org-directory's entry service directory declares no http or rest endpoint; the host forwards /org-directory/ to one/org-directory/ -> org-directory/directory/connect, beside/wiki/,/proposals/and/robin-builder/-> …/backend/httpWhat I did not verify:
deploy gitops render org-directory --env blue. It builds and pushes the directory image and publishes the page bundle to the blue registry, and that registry was out of bounds for this change.--env local. It reached the image builds and stopped on an unrelated image:authority/localat the pinned authority has a relativereplace ../../../../../libraries/authority-core/go, which does not exist inside the build context. That happens before route derivation./v1/org-directorycalls from the Connect carrier: no composed run was started.Classification
Fix at the owning place: the CLI owns the host route derivation; the refusal was the CLI's rule, not the module's.
🤖 Generated with Claude Code