feat(cli): add dynamic shell completion for flag values (#339)#512
Merged
Conversation
cd3b8db to
07a66e1
Compare
Contributor
Coverage Report ✅
Coverage BadgeMerging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. |
Add CompletableFlag wrapper that co-locates completion values with flag definitions, preventing drift between accepted and suggested values. Flags wired: --intent, --service, --accelerator/--gpu, --os, --platform, --format, --deployer, --min-trust-level.
07a66e1 to
c4b6188
Compare
Contributor
Cross-Review Summary for PR #512Reviewers: Claude Code, Codex, CodeRabbit + Integration Analysis Confirmed Issues
Positive Observations
Cross-review by Claude Code + Codex + CodeRabbit |
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
Closes #339
CompletableFlagwrapper that co-locates completion values with flag definitions, ensuring completions stay in sync with accepted valuescompleteWithAllFlagsto emit flag values when the user TABs after an enum flag--intent,--service,--accelerator/--gpu,--os,--platform,--format,--deployer,--min-trust-levelGetTrustLevels()getter to verifier package (was the only enum type missing one)Test plan
go test -race ./pkg/cli/...— 30 test cases pass including 6 new flag value completion testsgo test -race ./pkg/bundler/verifier/...—TestGetTrustLevelspassesaicr recipe --intent "" --generate-shell-completionoutputsinference,trainingmake qualifypassesType of Change
Component(s) Affected
cmd/aicr,pkg/cli)cmd/aicrd,pkg/api,pkg/server)pkg/recipe)pkg/bundler,pkg/component/*)pkg/collector,pkg/snapshotter)pkg/validator)pkg/errors,pkg/k8s)docs/,examples/)Implementation Notes
Testing
# Commands run (prefer `make qualify` for non-trivial changes) make qualifyRisk Assessment
Rollout notes:
Checklist
make testwith-race)make lint)git commit -S) — GPG signing info