Repository navigation
refactor(mapping): add evaluate command, deprecate run - #775
Conversation
Adds fga mapping evaluate as the canonical name for the command previously called fga mapping run. run remains functional as an alias but prints a deprecation warning to stderr when invoked, signalling callers to migrate to evaluate. Uses cobra Aliases to share the implementation without duplication, and cmd.CalledAs() to detect the alias at runtime for the warning. Integration tests updated to use evaluate; test 025 added to verify the deprecation warning fires when using run.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review. WalkthroughThe mapping command is renamed from ChangesMapping command
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to The command rename appears ready to merge after normal checks; existing run invocations remain supported with a deprecation warning. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟡 Changes recommended
The README still presents the deprecated alias as the primary command.
1 open finding
What changed in this PR
Makes fga mapping evaluate canonical while retaining run as a deprecated alias.
Changes:
- Renames the Cobra command and flags.
- Emits an alias deprecation warning.
- Updates integration tests and adds alias coverage.
| File | Description |
|---|---|
cmd/mapping/run.go |
Defines evaluate and deprecated run alias. |
cmd/mapping/mapping.go |
Registers the renamed command. |
tests/mapping-test-cases.yaml |
Updates tests and verifies the warning. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Adds
fga mapping evaluateas the canonical name for the command previously calledfga mapping run. The old name remains functional as a cobra alias but prints a deprecation warning to stderr when invoked, giving callers a clear signal to migrate.Uses
Aliases: []string{"run"}on the cobra command so no logic is duplicated, andcmd.CalledAs()inRunEto detect the alias at runtime and emit the warning.Integration tests updated throughout to use
evaluate; test 025 added to verify the deprecation warning fires when invoking viarun.Summary by CodeRabbit
fga mapping evaluate; help text and examples use the new command.fga mapping runremains available as a deprecated alias and displays a warning when used.