Conversation
…ervice name - Add --project-id flag to `service list` so it can be used without setting context - Enhance `template search` to also match service names within templates (ranked lower than title/description matches) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
WalkthroughAdds explicit project ID flag support with context fallback logic to the service list command. Introduces relevance scoring for template search results based on keyword matching. Extends Template model with Services field and updates related utility function signatures accordingly. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/cmd/service/list/list.go (1)
52-56: Redundant context fetch.Line 19 already initializes
opts.projectIDfromf.Config.GetContext().GetProject().GetID()during command construction. The re-fetch on lines 54-56 will retrieve the same value, making this block unnecessary.♻️ Suggested simplification
func runListInteractive(f *cmdutil.Factory, opts *Options) error { - // if project id is not set by flag, fetch from context - if opts.projectID == "" { - opts.projectID = f.Config.GetContext().GetProject().GetID() - } - // if project id is still not set, prompt to select one if _, err := f.ParamFiller.Project(&opts.projectID); err != nil { return err }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/cmd/service/list/list.go` around lines 52 - 56, The block in runListInteractive that re-fetches opts.projectID from f.Config.GetContext().GetProject().GetID() is redundant because opts.projectID is already initialized during command construction; remove the conditional that checks if opts.projectID == "" and the assignment inside it to avoid duplicate context reads and simplify the function while keeping any flag-provided projectID handling intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@internal/cmd/service/list/list.go`:
- Around line 52-56: The block in runListInteractive that re-fetches
opts.projectID from f.Config.GetContext().GetProject().GetID() is redundant
because opts.projectID is already initialized during command construction;
remove the conditional that checks if opts.projectID == "" and the assignment
inside it to avoid duplicate context reads and simplify the function while
keeping any flag-provided projectID handling intact.
4 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
--project-idflag toservice listso it can be used directly without setting context first (e.g.zeabur service list --project-id <id>)template searchto also match service names within templates — e.g. searching "mysql" will return templates that include a MySQL service, ranked below direct title/description matchesTest plan
zeabur service list --project-id <id>works without setting contextzeabur template search mysqlreturns templates containing MySQL services🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
--project-idflag to explicitly specify a project ID for non-interactive workflowsImprovements