feat(cli): resolve untyped read resource ids#283
Merged
Conversation
|
PR Title: feat(cli): resolve untyped read resource ids Commit: 本 PR 引入了资源 ID 解析功能,允许用户通过完整 ID 或十六进制短 ID 前缀查找 project、agent、run、sandbox、image 和 cache 等资源。核心变更包括:
整体代码结构清晰,分层合理,参数化查询避免了 SQL 注入风险,测试覆盖了主要场景。未发现高严重性安全漏洞或正确性缺陷。 |
3 tasks
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
ResourceService.ResolveIDAPI to locate projects, agents, runs, sandboxes, images, and caches by full or short ID.agent-compose inspect <id>without requiring the resource type, while delegating inspection to the existing typed APIs.agent-compose logs <id>for project, agent, run, and sandbox IDs without requiring a local Compose file.have stable resource IDs.
Testing
go test ./pkg/resources ./pkg/storage/configstore ./pkg/agentcompose/api ./pkg/agentcompose/app ./cmd/agent-composego test -race ./pkg/resources ./pkg/storage/configstore ./pkg/agentcompose/api ./cmd/agent-compose -run 'Test(Locator|FindResource|ResourceHandler| IntegrationCLI(Inspect|Logs)Resolves|E2ECLI(Inspect|Logs)Resolves)' -count=1task linttask buildtask testgit diff --check origin/main...HEADChecklist