Skip to content

refactor(mapping): add evaluate command, deprecate run - #775

Merged
ewanharris merged 2 commits into
mainfrom
feat/mapping-evaluate-command
Oct 8, 2026
Merged

ewanharris merged 2 commits into
mainfrom
feat/mapping-evaluate-command

Conversation

@ewanharris

@ewanharris ewanharris commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Adds fga mapping evaluate as the canonical name for the command previously called fga 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, and cmd.CalledAs() in RunE to 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 via run.

Summary by CodeRabbit

  • Command Updates
    • The mapping evaluation command is now fga mapping evaluate; help text and examples use the new command.
    • fga mapping run remains available as a deprecated alias and displays a warning when used.
    • Existing mapping evaluation options and behavior are unchanged.

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.
Copilot AI balanced review requested due to automatic review settings October 8, 2026 15:34
@ewanharris
ewanharris requested a review from a team as a code owner October 8, 2026 15:34
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4eca8fe4-7778-4fbf-8a70-56f7aa6fc152

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d3d542b8-6dde-4c1a-a884-62f5a4f2bff1
📥 Commits

Reviewing files that changed from the base of the PR and between 1808694 and 3067e3b.

📒 Files selected for processing (3)
  • cmd/mapping/mapping.go
  • cmd/mapping/run.go
  • tests/mapping-test-cases.yaml

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.


Walkthrough

The mapping command is renamed from run to evaluate. The run alias remains available and prints a deprecation warning. Existing mapping execution behavior and flags remain in place.

Changes

Mapping command

Layer / File(s) Summary
Register evaluate and retain run alias
cmd/mapping/mapping.go, cmd/mapping/run.go
The command group registers evaluate. The run alias prints a deprecation warning. Help examples and internal option variables use evaluate; flag names and defaults remain unchanged.
Validate evaluate and run commands
tests/mapping-test-cases.yaml
Existing mapping scenarios now invoke evaluate. Added checks cover successful continuation with valid records, unresolved-filter aggregation, and successful tuple output from the deprecated run alias.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: aaguiarz

Merge Risk: ⚪ Minimal · up to 3067e

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding the evaluate command and deprecating run.
Full details: Docstring Coverage

Explanation

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 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment thread cmd/mapping/run.go
@ewanharris ewanharris changed the title feat(mapping): add evaluate command, deprecate run refactor(mapping): add evaluate command, deprecate run Oct 8, 2026

@SoulPancake SoulPancake left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ewanharris
ewanharris added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit 5802421 Oct 8, 2026
26 checks passed
@ewanharris
ewanharris deleted the feat/mapping-evaluate-command branch October 8, 2026 16:13
@openfga-releaser-bot openfga-releaser-bot Bot mentioned this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants