Skip to content

feat(cli): Interactive confirmation#3360

Merged
c-r33d merged 7 commits intomainfrom
summary-output-preview
Apr 22, 2026
Merged

feat(cli): Interactive confirmation#3360
c-r33d merged 7 commits intomainfrom
summary-output-preview

Conversation

@c-r33d
Copy link
Copy Markdown
Contributor

@c-r33d c-r33d commented Apr 22, 2026

Proposed Changes

1.) Cleanup some of the plan artifact to only include what is needed.
2.) Remove the output file from namespaced-policy and print summary of information to the screen
3.) Add confirmation prompt before commit
4.) Add option to skip, abort, 'commit' a specific object. Skipping an object that another requires causes both to be skipped.
5.) Cleanup unused files
6.) Skip integration tests for now

Example screen shot of aborted plan

Screenshot 2026-04-21 at 8 32 31 PM

Summary by CodeRabbit

  • Removed Features

    • Removed the registered-resources migration subcommand from the migrate command
    • Removed the --output flag from the namespaced-policy command
  • New Features

    • Added interactive backup confirmation prompt before committing namespaced policy migrations
  • Changed Behavior

    • Namespaced-policy command now prints a human-readable migration summary to stdout instead of writing JSON files
  • Documentation

    • Updated namespaced-policy command documentation to reflect removed flag and new summary output behavior

@c-r33d c-r33d requested a review from a team as a code owner April 22, 2026 01:31
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces an interactive confirmation and review workflow for the namespaced-policy migration command. By replacing the previous file-based output with a direct console summary and adding granular control over object migration, the changes improve user visibility and safety during the migration process.

Highlights

  • Interactive Confirmation: Added an interactive confirmation prompt before executing the commit operation for namespaced policy migrations.
  • Migration Workflow Improvements: Removed the requirement for an output file, replacing it with a human-readable summary printed directly to stdout.
  • Granular Control: Introduced options to skip, abort, or commit specific objects during the migration process.
  • Cleanup: Removed unused files and temporarily disabled integration tests to facilitate the new interactive workflow.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.


The policy moves to a brand new space, With interactive steps to keep the pace. No files to write, just text on the screen, A safer migration, clean and serene.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

Warning

Rate limit exceeded

@c-r33d has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 36 minutes and 15 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 36 minutes and 15 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b0a3436f-a2c0-4376-a5ad-345fec2f9ca2

📥 Commits

Reviewing files that changed from the base of the PR and between 919eb2f and f88cb94.

📒 Files selected for processing (7)
  • otdfctl/migrations/namespacedpolicy/finalize_plan.go
  • otdfctl/migrations/namespacedpolicy/finalize_plan_test.go
  • otdfctl/migrations/namespacedpolicy/interactive_commit.go
  • otdfctl/migrations/namespacedpolicy/obligation_triggers_execute.go
  • otdfctl/migrations/namespacedpolicy/obligation_triggers_execute_test.go
  • otdfctl/migrations/namespacedpolicy/summary.go
  • otdfctl/migrations/namespacedpolicy/summary_test.go
📝 Walkthrough

Walkthrough

Refactors namespaced-policy migration: removes legacy registered-resources and artifact packages; reshapes plan models (Targets slices → single Target, pointer objects → ID strings); adds interactive backup-and-target review; introduces textual summary rendering; updates execution to treat skipped/unresolved targets as no-ops and extends ExecutorHandler with registered-resource lookup; removes CLI --output flag.

Changes

Cohort / File(s) Summary
CLI / docs
otdfctl/cmd/migrate/migrate.go, otdfctl/cmd/migrate/namespaced_policy.go, otdfctl/docs/man/migrate/namespaced-policy.md
Removed registration of legacy registered-resources subcommand and removed --output flag/plan-file writing; split commit flow into interactive-confirm and execute helpers; docs updated to reflect --output removal and stdout summary behavior.
Interactive reviewer & summary
otdfctl/migrations/namespacedpolicy/interactive_commit.go, otdfctl/migrations/namespacedpolicy/interactive_commit_test.go, otdfctl/migrations/namespacedpolicy/summary.go, otdfctl/migrations/namespacedpolicy/summary_test.go
Added backup confirmation and target-by-target interactive review with dependency-aware skip propagation; added summary rendering functions and tests.
Plan model and finalizer
otdfctl/migrations/namespacedpolicy/plan.go, otdfctl/migrations/namespacedpolicy/finalize_plan.go, .../finalize_plan_test.go
Replaced plural Targets with single Target, replaced Existing pointers with ExistingID strings, removed binding structs and Unused/Unresolved tracking, added TargetStatusSkipped. Tests updated to new shapes.
Execution behavior
otdfctl/migrations/namespacedpolicy/actions_execute.go, .../subject_mappings_execute.go, .../registered_resources_execute.go, .../obligation_triggers_execute.go, .../subject_condition_sets_execute.go, and related tests
Execution now operates on single Target per plan, treats skipped and unresolved as non-fatal no-ops, resolves bindings via source-ID strings, and updated error behavior. Added GetRegisteredResource to ExecutorHandler and test mocks.
Retriever / planner updates
otdfctl/migrations/namespacedpolicy/retrieve.go, otdfctl/migrations/namespacedpolicy/retrieve_test.go, otdfctl/migrations/namespacedpolicy/planner_test.go
Tightened namespace filtering for action listing; planner/tests updated to new Target and source-ID fields.
Registered-resources & artifact removal
otdfctl/migrations/registered-resources.go, otdfctl/cmd/migrate/registeredResources.go, otdfctl/migrations/artifact/..., corresponding tests
Deleted legacy registered-resources migration implementation and entire artifact package (schema, metadata, v1 schema and tests).
Styling, e2e and config
otdfctl/migrations/styles.go, otdfctl/e2e/migrate-namespaced-policy.bats, otdfctl/go.mod
Exported display styles and added getters; updated/disabled e2e jq queries to use .target; moved semver dependency to indirect in go.mod.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant Planner
    participant Prompter
    participant Executor
    participant Handler

    User->>CLI: migrate namespaced-policy --interactive --commit
    CLI->>Planner: Build migration plan
    Planner->>Handler: List resources/actions/mappings
    Handler-->>Planner: Plan inputs
    Planner-->>CLI: Plan (with Targets)

    rect rgba(76, 175, 80, 0.5)
    CLI->>Prompter: ConfirmNamespacedPolicyBackup()
    Prompter->>User: Show backup warning
    User-->>Prompter: confirm/abort
    Prompter-->>CLI: result
    end

    rect rgba(33, 150, 243, 0.5)
    CLI->>Prompter: ReviewNamespacedPolicyInteractiveCommit(plan)
    loop per create-target
      Prompter->>User: present target details
      User-->>Prompter: confirm / skip / abort
      alt skip
        Prompter->>CLI: mark target skipped (propagate)
      else abort
        Prompter-->>CLI: ErrInteractiveReviewAborted
        CLI-->>User: exit
      end
    end
    Prompter-->>CLI: updated plan
    end

    rect rgba(255, 152, 0, 0.5)
    CLI->>Executor: Execute approved plan
    Executor->>Handler: create/migrate resources
    Handler-->>Executor: execution results (created IDs)
    Executor-->>CLI: execution summary
    end

    CLI->>CLI: RenderNamespacedPolicySummaryWithResult(plan,result)
    CLI-->>User: display summary
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

comp:policy, docs

Suggested reviewers

  • alkalescent
  • elizabethhealy
  • jakedoublev

Poem

🐰 I hopped through plans with gentle paws,

Skipped some targets, read all the laws,
Backed up first, then asked with care,
One-by-one we moved things there,
A tidy summary—now breathe, and pause.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(cli): Interactive confirmation' accurately reflects the main change—adding interactive confirmation prompts to the CLI migration commands, specifically the namespaced-policy command.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch summary-output-preview

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 and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the namespaced-policy migration command to replace JSON file output with human-readable summaries and implements an interactive commit workflow. Key changes include simplifying the migration plan structure by moving from multiple targets to a single target for several policy objects, adding a backup confirmation step, and allowing users to skip or abort specific operations during interactive execution. Feedback highlights logic errors in the summary rendering where unresolved registered resources and subject mappings are omitted, and suggests moving validation logic to the Plan struct to improve maintainability.

Comment thread otdfctl/migrations/namespacedpolicy/summary.go Outdated
Comment thread otdfctl/migrations/namespacedpolicy/execute.go Outdated
Comment thread otdfctl/migrations/namespacedpolicy/summary.go Outdated
@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 139.18674ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 73.899595ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 335.882302ms
Throughput 297.72 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 33.516883832s
Average Latency 333.791668ms
Throughput 149.18 requests/second

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
otdfctl/migrations/namespacedpolicy/plan.go (1)

142-151: 🧹 Nitpick | 🔵 Trivial

RegisteredResourceActionBinding.SourceActionID lacks omitempty.

Minor inconsistency with surrounding ID-field JSON tags (existing_id,omitempty, action_source_id,omitempty, action_source_ids,omitempty). If an action-less binding is never emitted in practice, the current tag is fine; otherwise consider omitempty for symmetry and smaller plan artifacts.

-	SourceActionID string        `json:"source_action_id"`
+	SourceActionID string        `json:"source_action_id,omitempty"`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@otdfctl/migrations/namespacedpolicy/plan.go` around lines 142 - 151, The JSON
tag for RegisteredResourceActionBinding.SourceActionID is missing omitempty;
update the struct field SourceActionID in RegisteredResourceActionBinding to use
`json:"source_action_id,omitempty"` (matching surrounding ID-field tags like
existing_id and action_source_id) so empty/zero-value action IDs are omitted
from serialized plans.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@otdfctl/e2e/migrate-namespaced-policy.bats`:
- Around line 1211-1212: The test suite's setup() currently skips, but it still
calls the removed CLI flag --output "$output_file", which will break when
unskipped; update the helper/tests that call the CLI to stop using --output and
instead capture the CLI's stdout (or another supported artifact) and assert
against the new rendered summary format. Locate occurrences of --output
"$output_file" and the BATS assertions that read the JSON file, replace them
with code that runs the command without --output, collects stdout (or uses the
CLI's summary output hook), and adapt the assertions in the test helper (and any
functions referenced in setup()) to parse and validate the rendered summary
rather than the old JSON file.

In `@otdfctl/migrations/namespacedpolicy/execute.go`:
- Around line 97-101: Fix the typo in the comment ("withint" → "within"),
extract the loop that checks plan.RegisteredResources into a helper on the plan
type (e.g., Plan.ValidateNoUnresolvedRegisteredResources or similar in plan.go)
so execute.go stays orchestration-only, and improve the error returned when
finding an unresolved resource: return ErrPlanNotExecutable wrapped with a
message that includes the specific resource identifier (use the appropriate
field on RegisteredResourcePlan such as resource.Source.GetName() or
resource.Name) and make the wording singular (e.g., "finalized plan contains
unresolved registered resource: <id>").

In `@otdfctl/migrations/namespacedpolicy/finalize_plan.go`:
- Around line 245-271: In newSubjectMappingTarget, avoid allocating and
populating ActionSourceIDs and SubjectConditionSetSourceID before the status
switch; move the creation of ActionSourceIDs (make([]string,...)), the loop that
appends action.GetId(), and the assignment to SubjectConditionSetSourceID to
after the switch and only execute them for the NeedsCreate branch; keep the
target struct allocation and setting of TargetStatusAlreadyMigrated/ExistingID
for the AlreadyMigrated branch but return early without populating dependency
IDs so already-migrated plans do not receive unused IDs.

In `@otdfctl/migrations/namespacedpolicy/obligation_triggers_execute.go`:
- Around line 41-42: Add a table test row to TestExecuteObligationTriggers
covering the new TargetStatusSkipped branch: add an entry with
TargetStatusSkipped as the target status and assert that no handler is invoked
and the execution result is not mutated (e.g., expectedCalls = 0,
expectedChanged = false). Update the test's loop expectations to verify the
handler call count remains zero and the ExecutionResult (or equivalent result
struct used in TestExecuteObligationTriggers) is unchanged after running the
executor for TargetStatusSkipped so the test mirrors the pattern used for other
status cases.

In `@otdfctl/migrations/namespacedpolicy/registered_resources_execute.go`:
- Around line 42-43: Add a unit test in registered_resources_execute_test.go
that exercises the TargetStatusSkipped branch: create a registered-resource
target that returns TargetStatusSkipped from the executor, invoke the same
execution entrypoint used by other tests (the test harness calling into the code
handling registered resources), assert that no parent or value create functions
are called (use existing mocks/spies used by other tests) and assert execution
state remains unchanged (no new entries/side-effects). Specifically target the
TargetStatusSkipped case to ensure the case in registered_resources_execute.go
(the `case TargetStatusSkipped: return nil` branch) is covered.

In `@otdfctl/migrations/namespacedpolicy/summary.go`:
- Around line 215-217: The loop over plan.RegisteredResources is skipping
entries with resource.Target == nil, which hides
RegisteredResourcePlan.Unresolved items; update the loop in summary.go (the
iteration over plan.RegisteredResources) to only skip when resource == nil or
resource.Source == nil, and treat entries with resource.Target == nil as valid
unresolved items: render them in the summary and increment the unresolved
counter (or mark them) when RegisteredResourcePlan.Unresolved is set so
unresolved registered resources are shown even if Target is nil.

---

Outside diff comments:
In `@otdfctl/migrations/namespacedpolicy/plan.go`:
- Around line 142-151: The JSON tag for
RegisteredResourceActionBinding.SourceActionID is missing omitempty; update the
struct field SourceActionID in RegisteredResourceActionBinding to use
`json:"source_action_id,omitempty"` (matching surrounding ID-field tags like
existing_id and action_source_id) so empty/zero-value action IDs are omitted
from serialized plans.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6de337c6-c562-4117-81b6-0ea93e89e9fe

📥 Commits

Reviewing files that changed from the base of the PR and between 176f317 and 26f268f.

📒 Files selected for processing (35)
  • otdfctl/cmd/migrate/migrate.go
  • otdfctl/cmd/migrate/namespaced_policy.go
  • otdfctl/cmd/migrate/registeredResources.go
  • otdfctl/docs/man/migrate/namespaced-policy.md
  • otdfctl/e2e/migrate-namespaced-policy.bats
  • otdfctl/migrations/artifact/artifact.go
  • otdfctl/migrations/artifact/artifact_test.go
  • otdfctl/migrations/artifact/metadata/metadata.go
  • otdfctl/migrations/artifact/v1/schema.go
  • otdfctl/migrations/artifact/v1/schema_test.go
  • otdfctl/migrations/namespacedpolicy/actions_execute.go
  • otdfctl/migrations/namespacedpolicy/actions_execute_test.go
  • otdfctl/migrations/namespacedpolicy/execute.go
  • otdfctl/migrations/namespacedpolicy/execute_test_helpers_test.go
  • otdfctl/migrations/namespacedpolicy/finalize_plan.go
  • otdfctl/migrations/namespacedpolicy/finalize_plan_test.go
  • otdfctl/migrations/namespacedpolicy/interactive_commit.go
  • otdfctl/migrations/namespacedpolicy/interactive_commit_test.go
  • otdfctl/migrations/namespacedpolicy/obligation_triggers_execute.go
  • otdfctl/migrations/namespacedpolicy/obligation_triggers_execute_test.go
  • otdfctl/migrations/namespacedpolicy/plan.go
  • otdfctl/migrations/namespacedpolicy/planner_test.go
  • otdfctl/migrations/namespacedpolicy/registered_resources_execute.go
  • otdfctl/migrations/namespacedpolicy/registered_resources_execute_test.go
  • otdfctl/migrations/namespacedpolicy/retrieve.go
  • otdfctl/migrations/namespacedpolicy/retrieve_test.go
  • otdfctl/migrations/namespacedpolicy/subject_condition_sets_execute.go
  • otdfctl/migrations/namespacedpolicy/subject_condition_sets_execute_test.go
  • otdfctl/migrations/namespacedpolicy/subject_mappings_execute.go
  • otdfctl/migrations/namespacedpolicy/subject_mappings_execute_test.go
  • otdfctl/migrations/namespacedpolicy/summary.go
  • otdfctl/migrations/namespacedpolicy/summary_test.go
  • otdfctl/migrations/registered-resources.go
  • otdfctl/migrations/registered-resources_test.go
  • otdfctl/migrations/styles.go
💤 Files with no reviewable changes (9)
  • otdfctl/cmd/migrate/migrate.go
  • otdfctl/migrations/artifact/v1/schema_test.go
  • otdfctl/migrations/artifact/artifact_test.go
  • otdfctl/migrations/registered-resources_test.go
  • otdfctl/cmd/migrate/registeredResources.go
  • otdfctl/migrations/artifact/v1/schema.go
  • otdfctl/migrations/artifact/artifact.go
  • otdfctl/migrations/artifact/metadata/metadata.go
  • otdfctl/migrations/registered-resources.go

Comment thread otdfctl/e2e/migrate-namespaced-policy.bats
Comment thread otdfctl/migrations/namespacedpolicy/execute.go Outdated
Comment thread otdfctl/migrations/namespacedpolicy/finalize_plan.go
Comment thread otdfctl/migrations/namespacedpolicy/obligation_triggers_execute.go
Comment thread otdfctl/migrations/namespacedpolicy/registered_resources_execute.go
Comment thread otdfctl/migrations/namespacedpolicy/summary.go
@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 193.863094ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 99.703546ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 435.827726ms
Throughput 229.45 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 45.824716606s
Average Latency 455.933015ms
Throughput 109.11 requests/second

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 174.322793ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 93.252805ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 429.592156ms
Throughput 232.78 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 41.810059205s
Average Latency 416.780014ms
Throughput 119.59 requests/second

@github-actions
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
otdfctl/migrations/namespacedpolicy/subject_condition_sets_execute.go (1)

78-94: 🧹 Nitpick | 🔵 Trivial

Stale //nolint:exhaustive rationale.

The directive is still warranted (only TargetStatusExistingStandard falls to default), but the comment text no longer reflects the code — TargetStatusSkipped and TargetStatusUnresolved are now handled explicitly. Consider updating the rationale so future readers aren't misled.

📝 Suggested tweak
-	//nolint:exhaustive // SCS execution only handles create and already-migrated explicitly; all other statuses are unsupported.
+	//nolint:exhaustive // SCS execution handles create, already-migrated, skipped, and unresolved explicitly; existing-standard is not a valid SCS status and falls through to the default "unsupported" branch.
 	switch target.Status {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@otdfctl/migrations/namespacedpolicy/subject_condition_sets_execute.go` around
lines 78 - 94, Update the stale nolint comment above the switch handling
TargetStatus in executeSubjectConditionSets (or the surrounding switch block) to
accurately describe why //nolint:exhaustive is required: list the statuses that
are handled explicitly (TargetStatusAlreadyMigrated, TargetStatusSkipped,
TargetStatusCreate, TargetStatusUnresolved) and state that other statuses (e.g.,
TargetStatusExistingStandard and any future statuses) are intentionally
unsupported and routed to default; replace the existing rationale text so it
matches the current cases and clarifies that only the listed statuses are
handled and all others fall through to the default error branch.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@otdfctl/migrations/namespacedpolicy/summary.go`:
- Around line 354-360: The obligation_value is rendering only GetId(), so
FQN-only obligation values show up blank; update
formatObligationTriggerCreatedLine (and the similar block at lines 432–437) to
use the same ID-or-FQN fallback as attribute_value by passing
trigger.Source.GetObligationValue() through valueFQN and rendering with
styles.Namespace().Render(valueFQN(...)) instead of obligationValueID/GetId(),
ensuring obligation_value displays either ID or FQN.

---

Outside diff comments:
In `@otdfctl/migrations/namespacedpolicy/subject_condition_sets_execute.go`:
- Around line 78-94: Update the stale nolint comment above the switch handling
TargetStatus in executeSubjectConditionSets (or the surrounding switch block) to
accurately describe why //nolint:exhaustive is required: list the statuses that
are handled explicitly (TargetStatusAlreadyMigrated, TargetStatusSkipped,
TargetStatusCreate, TargetStatusUnresolved) and state that other statuses (e.g.,
TargetStatusExistingStandard and any future statuses) are intentionally
unsupported and routed to default; replace the existing rationale text so it
matches the current cases and clarifies that only the listed statuses are
handled and all others fall through to the default error branch.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9763b77a-ccfb-4a41-9b42-0f339479b2e1

📥 Commits

Reviewing files that changed from the base of the PR and between 26f268f and 919eb2f.

📒 Files selected for processing (14)
  • otdfctl/go.mod
  • otdfctl/migrations/namespacedpolicy/actions_execute.go
  • otdfctl/migrations/namespacedpolicy/actions_execute_test.go
  • otdfctl/migrations/namespacedpolicy/execute.go
  • otdfctl/migrations/namespacedpolicy/obligation_triggers_execute.go
  • otdfctl/migrations/namespacedpolicy/obligation_triggers_execute_test.go
  • otdfctl/migrations/namespacedpolicy/registered_resources_execute.go
  • otdfctl/migrations/namespacedpolicy/registered_resources_execute_test.go
  • otdfctl/migrations/namespacedpolicy/subject_condition_sets_execute.go
  • otdfctl/migrations/namespacedpolicy/subject_condition_sets_execute_test.go
  • otdfctl/migrations/namespacedpolicy/subject_mappings_execute.go
  • otdfctl/migrations/namespacedpolicy/subject_mappings_execute_test.go
  • otdfctl/migrations/namespacedpolicy/summary.go
  • otdfctl/migrations/namespacedpolicy/summary_test.go

Comment thread otdfctl/migrations/namespacedpolicy/summary.go
@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 146.367839ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 83.542136ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 399.871822ms
Throughput 250.08 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 41.539682104s
Average Latency 413.007371ms
Throughput 120.37 requests/second

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 174.607869ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 103.824623ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 402.116776ms
Throughput 248.68 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 43.473073163s
Average Latency 433.217291ms
Throughput 115.01 requests/second

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Govulncheck found vulnerabilities ⚠️

The following modules have known vulnerabilities:

  • examples
  • otdfctl
  • sdk
  • service
  • lib/fixtures
  • tests-bdd

See the workflow run for details.

Comment thread otdfctl/migrations/namespacedpolicy/finalize_plan.go
Comment thread otdfctl/migrations/namespacedpolicy/interactive_commit.go
@c-r33d c-r33d enabled auto-merge April 22, 2026 15:16
@c-r33d c-r33d added this pull request to the merge queue Apr 22, 2026
Merged via the queue into main with commit cd931d9 Apr 22, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants