Skip to content

feat(cli): Add skeleton of executor and action only commits#3301

Merged
c-r33d merged 4 commits intoDSPX-2655-migrate-otdfctlfrom
step-4-commit-migration-plan
Apr 14, 2026
Merged

feat(cli): Add skeleton of executor and action only commits#3301
c-r33d merged 4 commits intoDSPX-2655-migrate-otdfctlfrom
step-4-commit-migration-plan

Conversation

@c-r33d
Copy link
Copy Markdown
Contributor

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

Proposed Changes

1.) Adds the executor which is in-charge of committing a specific plan.
2.) Adds commit logic for actions only
3.) Adds stubs for other policy constructs.

Checklist

  • I have added or updated unit tests
  • I have added or updated integration tests (if appropriate)
  • I have added or updated documentation

Testing Instructions

@c-r33d c-r33d requested a review from a team as a code owner April 13, 2026 21:58
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 03387a72-06c8-478f-b3e8-9d7caf200e62

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch step-4-commit-migration-plan

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.

@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 the core infrastructure for the namespaced policy migration workflow. It establishes the planning and execution framework, enabling the system to derive target namespaces for legacy policy objects and perform dry-run migrations. The changes focus on building a robust, deterministic planning engine that ensures migration consistency before any actual state changes are applied.

Highlights

  • Migration Executor: Added an executor component responsible for committing specific migration plans, including logic for actions and stubs for other policy constructs.
  • Namespaced Policy Migration: Implemented the dry-run planning workflow for migrating legacy policy objects to namespaced policies, including canonicalization and target derivation.
  • CLI Command Update: Updated the migrate namespaced-policy command to support planning and writing migration manifests to a specified output file.

🧠 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 shifts to a new space, Legacy objects find their place. With plans in hand and dry-run done, The migration journey has begun.

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.

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 implements the dry-run planning and initial execution logic for migrating legacy policy objects to namespaced policy within the otdfctl tool. It introduces a comprehensive migration framework including object retrieval, dependency-based target derivation, canonical comparison for deduplication, and a structured planning phase. Feedback focuses on improving the robustness and performance of the migration process. Specifically, it is recommended to ensure the migration plan is saved even if execution fails mid-process to track progress, and to move "not implemented" scope checks to the validation phase to prevent partial migrations. Additionally, performance optimizations were identified regarding the use of linear searches in retrieval loops and inefficient JSON marshaling during object canonicalization. A suggestion was also made to refactor the executor logic to reduce code duplication when handling existing or already migrated targets.

@c-r33d c-r33d force-pushed the step-4-commit-migration-plan branch from b73159d to b832687 Compare April 14, 2026 13:48
@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 187.338298ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 425.092554ms
Throughput 235.24 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 42.278116864s
Average Latency 420.722942ms
Throughput 118.26 requests/second

@c-r33d c-r33d changed the title Step 4 commit migration plan feat(cli): Add skeleton of executor and action only commits Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

@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 163.948553ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 401.668218ms
Throughput 248.96 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 39.627699357s
Average Latency 394.559082ms
Throughput 126.17 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 182.250024ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 389.296038ms
Throughput 256.87 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 39.721157185s
Average Latency 395.158817ms
Throughput 125.88 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.

return nil
}

func (e *Executor) executeSubjectConditionSets(_ context.Context, plan *Plan) error {
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.

depending on length it may be beneficial to have these (or some of them) live in different files to avoid a giant executor.go

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I agree. I will refactor as the code gets longer.

migrationLabelRun = "migration_run"
)

type ExecutorHandler interface {
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.

is there a handler implementation yet or is that next?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is more a testing nicety. It will just expand on the different CreateXx rpcs.

@c-r33d c-r33d merged commit 6fe9afe into DSPX-2655-migrate-otdfctl Apr 14, 2026
35 checks passed
@c-r33d c-r33d deleted the step-4-commit-migration-plan branch April 14, 2026 15:05
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.

2 participants