feat(cli): transcend custom-functions push and list commands - #322
feat(cli): transcend custom-functions push and list commands#322ecton-transcend wants to merge 37 commits into
Conversation
@transcend-io/airgap.js-types
@transcend-io/cli
@transcend-io/design-tokens
@transcend-io/internationalization
@transcend-io/privacy-types
@transcend-io/sdk
@transcend-io/type-utils
@transcend-io/utils
@transcend-io/mcp
@transcend-io/mcp-server-admin
@transcend-io/mcp-server-assessment
@transcend-io/mcp-server-base
@transcend-io/mcp-server-consent
@transcend-io/mcp-server-discovery
@transcend-io/mcp-server-docs
@transcend-io/mcp-server-dsr
@transcend-io/mcp-server-inventory
@transcend-io/mcp-server-preferences
@transcend-io/mcp-server-workflows
commit: |
…instead of employee session + DH
… add --sombraAuth
Automated Change: Auth pivot to customer-ingress signingPer security review feedback on the platform side (#46175), the signing flow no longer exchanges the API key for a Sombra employee session over a Diffie-Hellman channel. The CLI now signs code directly against the Sombra customer-ingress Implementation detailsWhat changed: All DH crypto and the session-exchange helper were removed from the SDK; a |
Automated Change: Per-gateway code signingCustom functions can belong to different Sombra gateways, and a function's JWTs must be signed by its own gateway's keys or they fail verification at execution time. Previously the push signed every function against a single gateway (the Implementation detailsWhat changed: The |
…omFunction gating
…data-silo-id back to manifest
…d on createSombraGotInstance, split syncCustomFunction
… createSombraGotInstance sombraId option
… per-payload failure output
…ck, don't retry codec validation errors
… ecton-custom-functions-cli
… ecton-custom-functions-cli
… ecton-custom-functions-cli
… ecton-custom-functions-cli
The base branch was changed.
Related Issues
Public Changelog
transcend custom-functions push— create and update Transcend custom function code revisions from a manifest file (transcend-functions.yml) in your own repository, designed to run on every CI push. Supports change detection (unchanged functions are skipped), draft + promote flows (--noPromote),--dryRunpreviews,--forcefor env-value rotations,--sombraAuthfor self-hosted Sombra gateways, per-function Sombra gateways (sombra-id), and--updateManifestto record assigned function IDs back into the manifest.transcend custom-functions list— list custom functions with their lifecycle state, active version, pending draft, and IDs.Internal Changelog
io-ts) with variable templating and code-file loading, plus comment-preserving YAML write-back of assigned custom function IDs.Implementation details
Behavior
pushreads the manifest, signs each function's code against the customer ingress of the Sombra gateway the function belongs to (/v1/custom/sign), and saves the pre-signed JWTs via the GraphQL mutations. Entries are matched byidfirst when set, falling back to exact name; ambiguous names fail with an error listing candidate IDs.sombra-id→ existing function's gateway →--sombraId→ primary, with one cached customer-ingress connection per distinct gateway. An entry that pins a different gateway than the existing function fails (a push cannot move functions between gateways).--sombraAuthprovides the default internal key; entries whose self-hosted gateway uses a different key setsombra-auth-envto the name of an environment variable holding that gateway's key (the key itself never lives in the manifest).--sombraAuthtakes the Sombra internal key (X-Sombra-Authorization), required when self-hosting Sombra — the same flag pattern as the existing request commands.--updateManifestwrites assigned IDs back into the manifest via a comment-preserving YAML document edit (newyamldependency, added to the pnpm catalog), so<<parameters.x>>secret placeholders and comments survive.listprints each function's ID, type, lifecycle state, active version, and pending draft.Key files
packages/cli/src/commands/custom-functions/push/impl.tspackages/cli/src/lib/custom-functions/manifest.tsDependencies / rollout
/v1/custom/signroute from the backend pivot (#46175);--dryRunandlistwork without it.Testing
Test-before-promote (added in review)
test-payload(path to a JSON file, resolved relative to the manifest) andtest-payload-type(DATA_POINT|REQUEST_ENRICHER, DSR only). Payloads are loaded and JSON-parsed at manifest read time, with clear errors for missing files and invalid JSON.pushtest-runs each changed function's freshly signed code before pushing: failures are rejected — the failure reason and the run's execution logs are printed, nothing is pushed for that function, the summary counts it as rejected, and the command exits 1. Passing functions push and promote as before; entries without atest-payloadpush with a warning.--skipTestsbypasses testing entirely;--dryRunnever tests (nothing is signed on dry runs).runCustomFunction(main #47383); on older backends the push fails with an upgrade hint — use--skipTeststo bypass.Auto-created DSR integrations (added in review)
data-silo-id: the DSR integration (acustomFunction-catalog data silo) is created automatically before the test run, the function is created and linked on a passing test, and the silo is rolled back (deleted) on a failing test — logged asCreated DSR integration (data silo <id>) .../ a rollback note on rejection.--updateManifestwrite-back is generalized: it now writes both the custom functionidand thedata-silo-idback into the manifest (data-silo-idinserted right afterid, comment-preserving as before), including for existing DSR functions matched by name.extras.dataSiloinjected automatically from the entry's resolved silo, so payload files never hardcode silo IDs. Dry runs note when a DSR integration would also be created.