[codex] add function invoke aliases#10
Open
tkkhq wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
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 invokewith--id,--payload, and--jsonoutput support, including alias-aware resolution. - Persists function invoke aliases by API URL + project scope and adds
volcano functions alias set/list/deletefor managing them. - Extends the API client with a typed
InvokeFunctionmethod 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 | ||
| } |
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.
Summary
Adds
volcano functions invokefor invoking deployed functions from the CLI, including direct invocation with--idand alias-aware invocation by name.Details
volcano functions invoke [name] [--id <function_id>] [--payload ...] [--json].~/.volcano/config.json, scoped by API URL and project ID so local and cloud mappings can differ.volcano functions alias set/list/deleteto manage those aliases without hand-editing config.Validation
rtk go test ./internal/config ./internal/api ./internal/function ./internal/cmd/functions ./internal/cmd/rootrtk go test ./...