Skip to content

geolocation: standardize CLI flag naming and validators#3489

Open
ben-dz wants to merge 1 commit intomainfrom
bdz/geolocation-cli-consistency
Open

geolocation: standardize CLI flag naming and validators#3489
ben-dz wants to merge 1 commit intomainfrom
bdz/geolocation-cli-consistency

Conversation

@ben-dz
Copy link
Copy Markdown
Contributor

@ben-dz ben-dz commented Apr 8, 2026

Summary of Changes

  • Standardize entity identification: probe mutation commands now use --probe (was --code) accepting pubkey or code; user mutation commands now accept pubkey or code via validate_pubkey_or_code (was code-only)
  • Rename --signing-keypair--signing-pubkey (it accepts a pubkey, not a keypair) and --target-pk--target-signing-pubkey (spell out instead of abbreviating)
  • Add --json-compact to probe get and user get (previously only available on list commands)

Diff Breakdown

Category Files Lines (+/-) Net
Core logic 10 +358 / -89 +269
Tests 10 +49 / -12 +37
E2E 1 +3 / -3 0

Most of the net addition is resolution logic: non-create commands now resolve pubkey-or-code to a code via a get call before passing to the SDK.

Key files (click to expand)
  • smartcontract/cli/src/geolocation/user/add_target.rs--user accepts pubkey_or_code; --target-pk--target-signing-pubkey; adds user resolution + test mocks
  • smartcontract/cli/src/geolocation/user/remove_target.rs — same changes as add_target
  • smartcontract/cli/src/geolocation/probe/update.rs--code--probe with pubkey_or_code; --signing-keypair--signing-pubkey; adds probe resolution
  • smartcontract/cli/src/geolocation/probe/add_parent.rs--code--probe with pubkey_or_code; adds probe resolution
  • smartcontract/cli/src/geolocation/probe/delete.rs--code--probe with pubkey_or_code; adds probe resolution
  • smartcontract/cli/src/geolocation/user/update_payment_status.rs--user accepts pubkey_or_code; adds user resolution
  • smartcontract/cli/src/geolocation/user/delete.rs--user accepts pubkey_or_code; adds user resolution
  • smartcontract/cli/src/geolocation/probe/get.rs — adds --json-compact; display field signing_keypairsigning_pubkey

Testing Verification

  • All 38 geolocation CLI unit tests pass
  • Clippy clean with -Dclippy::all -Dwarnings
  • E2E tests compile (go build -tags e2e ./e2e/...)
  • Infra repo verified: no references to the renamed geolocation CLI flags

@ben-dz ben-dz force-pushed the bdz/geolocation-cli-consistency branch from fd1f292 to a6769b5 Compare April 8, 2026 16:52
@ben-dz ben-dz requested a review from nikw9944 April 8, 2026 17:04
@ben-dz ben-dz marked this pull request as ready for review April 8, 2026 17:04
@ben-dz ben-dz linked an issue Apr 8, 2026 that may be closed by this pull request
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.

Geolocation: Make CLI more consistent

1 participant