Skip to content

Align CLI fallback routing warnings#111

Merged
etbyrd merged 1 commit into
mainfrom
fix/function-fallback-routing-wording
May 19, 2026
Merged

Align CLI fallback routing warnings#111
etbyrd merged 1 commit into
mainfrom
fix/function-fallback-routing-wording

Conversation

@etbyrd
Copy link
Copy Markdown
Member

@etbyrd etbyrd commented May 19, 2026

Summary

  • Make the CLI function test warning helper mirror server routing: same-domain function endpoints suppress fallback function endpoints.
  • Update CLI templates and test-function API docs from catch-all terminology to fallback terminology.
  • Regenerate OpenAPI API clients/docs for Node, Python, and Go.

Why

Fallback endpoints only receive managed-domain mail when the inbound domain has no enabled domain-scoped endpoint. The old CLI wording and warning logic could imply multiple functions would receive the same test email when server routing would only deliver to scoped endpoints.

Validation

  • pnpm --dir cli-node exec vitest run tests/oclif/functions-test-function.test.ts tests/oclif/functions-init.test.ts
  • make cli-check
  • COREPACK_ENABLE_AUTO_PIN=0 make node-check
  • make python-check
  • make go-check
  • COREPACK_ENABLE_AUTO_PIN=0 make shared-check
  • git diff --check

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 19, 2026

Greptile Summary

This PR aligns CLI warning logic and documentation with actual server routing behavior: when same-domain function endpoints exist for an inbound domain, fallback endpoints are now suppressed in the warning helper, matching what the server would do. All "catch-all" terminology across CLI templates, OpenAPI specs, and generated SDK code (Node, Go, Python) is replaced with "fallback."

  • Logic change in findMatchingFunctionEndpoints: endpoints are now bucketed into domain-scoped and fallback lists; domain matches take priority and suppress fallbacks, eliminating misleading multi-function warnings when only one endpoint would actually fire in production.
  • Documentation and terminology: the testFunction API description is updated across YAML, JSON codegen, and all generated SDK files to accurately explain scoped vs. fallback domain selection.
  • Tests: existing tests are updated to reflect the new suppression behavior, and two new test cases cover the fallback-only and fallback warning-formatting paths.

Confidence Score: 5/5

Safe to merge — changes are a small, well-tested logic fix in the CLI warning helper and a consistent documentation update across generated SDK files.

The routing-suppression logic in findMatchingFunctionEndpoints is straightforward and verified by three test scenarios (domain suppresses fallback, fallback-only, unknown domain). All generated files are consistent with the source YAML. No runtime-affecting code changed outside the CLI warning path.

No files require special attention.

Important Files Changed

Filename Overview
cli-node/src/oclif/commands/functions-test-function.ts Core logic change: findMatchingFunctionEndpoints now splits endpoints into domain vs. fallback buckets and returns domain matches when any exist, suppressing fallbacks — correctly mirroring server routing. Terminology updated from "catch-all" to "fallback".
cli-node/tests/oclif/functions-test-function.test.ts Tests updated and expanded: first test now verifies fallbacks are suppressed when same-domain endpoints exist; two new tests cover fallback-only and warning-formatting scenarios; all expected scopes updated from "catch-all" to "fallback".
cli-node/src/oclif/function-templates.ts Comment-only update: loop-protection documentation updated from "catch-all" to "fallback" terminology.
cli-node/tests/oclif/functions-init.test.ts Comment-only updates in test descriptions, replacing "catch-all" with "fallback" for consistency.
openapi/primitive-api.yaml Documentation update for testFunction operation: replaces "catch-all routing receives identically" with accurate description of scoped vs. fallback domain selection logic.
openapi/primitive-api.codegen.json Mirrors the YAML description update for testFunction in the codegen JSON artifact.
packages/api-core/src/api/sdk.gen.ts Generated TypeScript SDK: JSDoc comment for testFunction updated to match revised OpenAPI description.
packages/api-core/src/openapi/openapi.generated.ts Generated file: inline OpenAPI document string updated to reflect new testFunction description.
packages/api-core/src/openapi/operations.generated.ts Generated file: operation manifest description for testFunction updated to new fallback-aware wording.
sdk-go/api/oas_client_gen.go Generated Go client: doc comment for TestFunction / Invoker interface updated to new description in two locations.
sdk-go/api/oas_handlers_gen.go Generated Go handler: doc comment for handleTestFunctionRequest updated to new description.
sdk-go/api/oas_server_gen.go Generated Go server: Handler interface doc comment for TestFunction updated to new description.
sdk-go/api/oas_unimplemented_gen.go Generated Go unimplemented stub: doc comment updated to new description.
sdk-python/src/primitive/api/api/functions/test_function.py Generated Python SDK: docstring for test_function updated to new fallback-aware description.

Reviews (1): Last reviewed commit: "Align CLI fallback routing warnings" | Re-trigger Greptile

@etbyrd etbyrd added this pull request to the merge queue May 19, 2026
Merged via the queue into main with commit 2e3476f May 19, 2026
12 checks passed
@etbyrd etbyrd deleted the fix/function-fallback-routing-wording branch May 19, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant