diff --git a/.github/workflows/companions.yaml b/.github/workflows/companions.yaml index 5ef3bf48..069d0a16 100644 --- a/.github/workflows/companions.yaml +++ b/.github/workflows/companions.yaml @@ -244,3 +244,17 @@ jobs: - name: Verify every embedded tag is in the registry run: ${{ github.workspace }}/bin/codefly companion verify --core-dir "${{ github.workspace }}/core" + + # The published proto companion, pulled fresh on this runner, must render + # a Python client that streams all four RPC shapes. A tag republished + # with different content passes the presence check above and fails here. + - name: Qualify Python client streaming through the published companion + working-directory: cli + env: + CODEFLY_GENERATE_QUALIFY: "1" + GOWORK: "off" + run: go test ./cmd/generate -count=1 -run '^TestGenerateClientPythonStreaming$' + + - name: Name the proto companion image the qualification ran + if: failure() + run: docker images --digests --format '{{.Repository}}:{{.Tag}} {{.Digest}} {{.ID}}' ghcr.io/codefly-dev/proto diff --git a/cmd/generate/contract_surface.go b/cmd/generate/contract_surface.go index 8ec795e2..3c888ff5 100644 --- a/cmd/generate/contract_surface.go +++ b/cmd/generate/contract_surface.go @@ -115,7 +115,7 @@ func loadContractSurfaces(service *resources.Service, endpoints []*basev0.Endpoi // descriptor. A descriptor supplies schemas and options, including transitive // imports; the catalog says which of those methods this listener serves. func endpointProcedures(set *descriptorpb.FileDescriptorSet, endpoint *composition.APIContractEndpoint) ([]string, error) { - methods, err := composition.ProtobufProcedures(set, endpoint.Services) + methods, err := composition.ProtobufProcedures(set, *endpoint) if err != nil { return nil, fmt.Errorf("endpoint %s/%s: %w", endpoint.Service, endpoint.Endpoint, err) } diff --git a/go.mod b/go.mod index 77892c89..2ee4b8b8 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/codefly-dev/authority/libraries/authority-client/go v0.0.0-20261025214748-c9cef7470d20 github.com/codefly-dev/authority/libraries/delivery/go v0.0.0-20261025214748-c9cef7470d20 github.com/codefly-dev/authority/libraries/hop/go v0.0.0-20261025214748-c9cef7470d20 - github.com/codefly-dev/core v0.19.7-0.20261025185759-e501458995d0 + github.com/codefly-dev/core v0.19.7-0.20261026014924-50b50dd2a5da github.com/codefly-dev/golor v0.1.3 github.com/codefly-dev/llm v0.1.7 github.com/codefly-dev/sdk-go/workcontext v0.1.1-0.20261018052022-70dc7a546458 diff --git a/go.sum b/go.sum index 56e7b3aa..d5120d36 100644 --- a/go.sum +++ b/go.sum @@ -176,6 +176,10 @@ github.com/codefly-dev/core v0.19.7-0.20261025175252-88f4434c68c7 h1:sFkQTBSvAjz github.com/codefly-dev/core v0.19.7-0.20261025175252-88f4434c68c7/go.mod h1:1ina3kP+YSAL4tlZvnEYd4P8bFGnJECfkP86ojeeF1A= github.com/codefly-dev/core v0.19.7-0.20261025185759-e501458995d0 h1:YEFvkyokBsUWbHoaoKOi6iJtMrqNNR7HsWdUQGN50TA= github.com/codefly-dev/core v0.19.7-0.20261025185759-e501458995d0/go.mod h1:1ina3kP+YSAL4tlZvnEYd4P8bFGnJECfkP86ojeeF1A= +github.com/codefly-dev/core v0.19.7-0.20261025230614-9386c6bf7521 h1:UP7WCPYMa/K/BQYGdZ95wlCtyRFG+RccBadFVw+qYPs= +github.com/codefly-dev/core v0.19.7-0.20261025230614-9386c6bf7521/go.mod h1:1ina3kP+YSAL4tlZvnEYd4P8bFGnJECfkP86ojeeF1A= +github.com/codefly-dev/core v0.19.7-0.20261026014924-50b50dd2a5da h1:g/I/o/KTL8L2xEDrgJsSO4qLR2oYWJI8PorbVMmKSbM= +github.com/codefly-dev/core v0.19.7-0.20261026014924-50b50dd2a5da/go.mod h1:1ina3kP+YSAL4tlZvnEYd4P8bFGnJECfkP86ojeeF1A= github.com/codefly-dev/golor v0.1.3 h1:xmo+ceyJFRYZdvpWE2fNd0jeaadp/Ibm1BnganiGKOc= github.com/codefly-dev/golor v0.1.3/go.mod h1:sl/u/K1l7J0Pr3xyVZp8fOJYQItKKst1No9JqgzLLoY= github.com/codefly-dev/gortk v0.2.0 h1:7bOlS5valYz2zil+fZctQNcPCYBcPj86abcw9N8h1hQ= diff --git a/pkg/gitops/wire_kits_test.go b/pkg/gitops/wire_kits_test.go index 77ac525f..8b942db0 100644 --- a/pkg/gitops/wire_kits_test.go +++ b/pkg/gitops/wire_kits_test.go @@ -51,11 +51,14 @@ func TestTheModuleContractKitRunsThroughTheRender(t *testing.T) { // (binding-names-calls): each declares what its calls require in its own // published contract, a protobuf one and an OpenAPI one. writeCalleePackages(t, workspace.Dir()) + // roles-grant-bindings holds a role's spelled-out scope at the one + // audience that underwrites it: its documents and replica bindings both + // resolve to documents. for rel, content := range map[string]string{ filepath.Join("modules", "assistant", resources.ModuleConfigurationName): "kind: module\nname: assistant\nservices:\n - name: api\n", filepath.Join("modules", "assistant", "services", "api", resources.ServiceConfigurationName): hostedServiceYAML("api", "assistant") + "module-identity: true\n", filepath.Join("modules", "assistant", "module.package.codefly.yaml"): "schema: codefly/module-package/v1\nid: acme/assistant\nversion: 1.0.0\n", - filepath.Join("configurations", "staging", "assistant.env"): "MODEL_AUDIENCE=model-gateway\nMODEL_RESOURCE_KIND=modelservice.profiles\nMODEL_BINDING=model\nEVIDENCE_AUDIENCE=documents\nEVIDENCE_RESOURCE_KIND=documents.passages\nEVIDENCE_BINDING=evidence\nANNOTATIONS_PREFIX=annotations\n", + filepath.Join("configurations", "staging", "assistant.env"): "MODEL_AUDIENCE=model-gateway\nMODEL_RESOURCE_KIND=modelservice.profiles\nMODEL_BINDING=model\nEVIDENCE_AUDIENCE=documents\nEVIDENCE_RESOURCE_KIND=documents.passages\nEVIDENCE_BINDING=evidence\nANNOTATIONS_PREFIX=annotations\nDOCUMENTS_AUDIENCE=documents\nREPLICA_AUDIENCE=documents\n", } { full := filepath.Join(workspace.Dir(), rel) require.NoError(t, os.MkdirAll(filepath.Dir(full), 0o755))