Repository navigation
chore: gate Link commands with canUseLink - #286
Conversation
There was a problem hiding this comment.
Code Review
This pull request gates the link command behind the canUseLink feature flag, conditionally adding it to the root command only when the flag is enabled. It also updates the README to document this behavior and introduces a comprehensive test suite in cmd/root_test.go to verify the command gating under various flag configurations. There are no review comments, and I have no feedback to provide.
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation consistently gates command discovery and execution with comprehensive focused tests.
Review effort: Balanced
Findings: None
What changed in this PR
Gates the Link CLI command behind the existing canUseLink feature flag.
Changes:
- Conditionally registers
link, defaulting to unavailable. - Adds coverage for enabled, disabled, missing, and invalid flags.
- Documents Link availability requirements.
| File | Description |
|---|---|
README.md |
Documents feature-gated availability. |
cmd/root.go |
Conditionally registers the Link command. |
cmd/root_test.go |
Tests gating across flag and invocation scenarios. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Gate Link commands with canUseLink
Summary
linkonly when the existing OpenFeature client evaluatescanUseLinkas true. The default remains false.link --helpand QR creation.Validation
go test -coverprofile=/tmp/hx-gate-unit-coverage.txt -covermode=atomic ./cmd/... ./internal/... ./pkg/...passed.go vet ./...,go build -o /tmp/hx-gated ., formatting, and diff checks passed.help linkreports an unknown help topic..gitignoreedit is excluded from this PR.Related issues
Related pull requests