Skip to content

[codex] add function invoke aliases#10

Open
tkkhq wants to merge 3 commits into
mainfrom
feat/function-invoke
Open

[codex] add function invoke aliases#10
tkkhq wants to merge 3 commits into
mainfrom
feat/function-invoke

Conversation

@tkkhq

@tkkhq tkkhq commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds volcano functions invoke for invoking deployed functions from the CLI, including direct invocation with --id and alias-aware invocation by name.

Details

  • Adds volcano functions invoke [name] [--id <function_id>] [--payload ...] [--json].
  • Adds per-user function aliases stored in ~/.volcano/config.json, scoped by API URL and project ID so local and cloud mappings can differ.
  • Adds volcano functions alias set/list/delete to manage those aliases without hand-editing config.
  • Preserves existing local/cloud command routing and merges persisted aliases into local synthetic config while keeping local server auth/project metadata.

Validation

  • rtk go test ./internal/config ./internal/api ./internal/function ./internal/cmd/functions ./internal/cmd/root
  • rtk go test ./...

@tkkhq tkkhq requested a review from a team as a code owner June 15, 2026 06:28
Copilot AI review requested due to automatic review settings June 15, 2026 06:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class function invocation support to the Volcano CLI, including per-user, per-target function ID aliases persisted in ~/.volcano/config.json, so users can invoke deployed functions by alias/name/path/ID across local and cloud targets.

Changes:

  • Adds volcano functions invoke with --id, --payload, and --json output support, including alias-aware resolution.
  • Persists function invoke aliases by API URL + project scope and adds volcano functions alias set/list/delete for managing them.
  • Extends the API client with a typed InvokeFunction method and wires local-mode config to include persisted aliases.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/session/session.go Exposes the resolved API URL on ProjectSession for alias scoping.
internal/function/function.go Implements invoke-by-name/alias/ID and alias CRUD logic in the function service.
internal/config/config.go Adds persisted function_aliases storage plus helpers for scope/get/set/delete.
internal/config/config_test.go Adds tests validating alias scoping persistence and cleanup behavior.
internal/cmd/root/root_test.go Adds coverage for local alias usage and cloud help path behavior for invoke.
internal/cmd/local/local.go Merges persisted alias mappings into the synthetic local-mode config.
internal/cmd/functions/invoke.go Introduces the functions invoke Cobra command and payload/output handling.
internal/cmd/functions/invoke_test.go Adds tests for invoke behavior (by ID, by alias, by name) and alias subcommands.
internal/cmd/functions/functions.go Registers the new invoke and alias subcommands under functions.
internal/cmd/functions/alias.go Implements functions alias set/list/delete command UX and output.
internal/api/functions.go Adds InvokeFunction API wrapper and request input type.
internal/api/client_test.go Extends API route-usage tests and error normalization coverage for invoke.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +79 to +82
persisted, err := cliconfig.Load()
if err != nil {
return nil, err
}
Comment on lines +115 to +121
func runAliasDelete(ctx context.Context, opts aliasOptions) error {
if err := clifunction.NewService(opts.deps).DeleteAlias(ctx, opts.alias); err != nil {
return err
}
output.Success(opts.out, "Deleted function alias %q", opts.alias)
return nil
}
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.

2 participants