Skip to content

Add --client-tablet-targeting-policy to pscale password create and update - #1538

Draft
maxenglander wants to merge 4 commits into
mainfrom
max/client-tablet-targeting-cli
Draft

maxenglander wants to merge 4 commits into
mainfrom
max/client-tablet-targeting-cli

Conversation

@maxenglander

@maxenglander maxenglander commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Adds --client-tablet-targeting-policy to pscale password create and pscale password update, and shows the policy in pscale password show and list.

Global replica passwords can ignore a tablet type the client sets (USE @replica, mydb@replica) and use their own. The API exposes this as client_tablet_targeting_policy (apply or ignore).

  • create: apply or ignore.
  • update: apply or ignore.

The CLI passes the value through, and the API validates it. When the response has no policy, show and list print an empty value.

Depends on the API accepting client_tablet_targeting_policy on password create and update.

🤖 Generated with Claude Code

Pass client_tablet_targeting_policy through to the password create and
update requests, and show it in password show and list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 5a3e995. Configure here.

ConnectionType string `header:"connection type" json:"connection_type"`
ClientTabletTargetingPolicy string `header:"client tablet targeting" json:"client_tablet_targeting_policy"`
CreatedAt int64 `json:"created_at"`
orig *ps.DatabaseBranchPassword

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.

Create output omits targeting policy

Low Severity

PasswordWithPlainText and toPasswordWithPlainText never copy ClientTabletTargetingPolicy, so pscale password create human and CSV tables omit the policy just set with --client-tablet-targeting-policy. JSON still includes it via orig, and show/list display it because Password and passwordWithoutTTL were updated.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5a3e995. Configure here.

maxenglander and others added 3 commits November 21, 2026 15:22
Passwords can switch between apply and ignore later, so drop the
client_tablet_targeting_policy_locked field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The API can return null for the policy. It decodes to an empty string,
so show and list print an empty value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cover the field being missing as well as null.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant