Skip to content

geolocation/cli: show codes instead of pubkeys in user get and probe get#3813

Open
ben-dz wants to merge 3 commits into
mainfrom
bdz/geo-probe-code
Open

geolocation/cli: show codes instead of pubkeys in user get and probe get#3813
ben-dz wants to merge 3 commits into
mainfrom
bdz/geo-probe-code

Conversation

@ben-dz
Copy link
Copy Markdown
Contributor

@ben-dz ben-dz commented Jun 1, 2026

Summary of Changes

  • geolocation user get: the Targets table probe column now shows the human-readable probe code instead of the raw geoprobe pubkey, resolved via list_geo_probes with a pubkey fallback. JSON gains a probe code field while retaining the canonical geoprobe_pk.
  • geolocation probe get: the exchange field now shows the exchange code instead of the raw pubkey, resolved via list_exchanges with a pubkey fallback — making it consistent with geolocation probe list, which already does this.

Diff Breakdown

Category Files Lines (+/-) Net
Core logic 2 +25 / -9 +16
Tests 2 +168 / -0 +168
Total 2 +193 / -9 +184

Two small CLI display fixes in the geolocation crate; the bulk of the diff is test coverage for code resolution and pubkey fallback.

Key files (click to expand)
  • crates/doublezero-geolocation-cli/src/user/get.rs — resolve geoprobe_pk → probe code in the Targets table; keep geoprobe_pk in JSON, add probe code field; tests for code rendering and fallback
  • crates/doublezero-geolocation-cli/src/probe/get.rs — resolve exchange_pk → exchange code, matching probe list; tests for code rendering and fallback

Testing Verification

  • user get: table asserts the probe code (ams-probe-01) and not the pubkey; new fallback test when the probe isn't found; compact-JSON test asserts both probe code and retained geoprobe_pk
  • probe get: table asserts the exchange code (ams) and not the pubkey; new fallback test when the exchange isn't found; JSON/compact tests updated to expect the code
  • All user::get and probe::get tests pass; make rust-lint clean in the dev container

@ben-dz ben-dz changed the title geolocation/cli: show probe codes in user get targets table geolocation/cli: show codes instead of pubkeys in user get and probe get Jun 1, 2026
@ben-dz ben-dz force-pushed the bdz/geo-probe-code branch from 13cd88e to 93753ef Compare June 1, 2026 13:56
@ben-dz ben-dz marked this pull request as ready for review June 1, 2026 13:56
@ben-dz ben-dz requested a review from nikw9944 June 1, 2026 13:56
ben-dz added 2 commits June 1, 2026 10:23
The 'probe' column of the Targets table in 'doublezero geolocation
user get' rendered the geoprobe pubkey. Resolve it to the probe code
via list_geo_probes, falling back to the pubkey when the probe is not
found. JSON output gains a 'probe' code field while retaining the
canonical 'geoprobe_pk'.
'doublezero geolocation probe get' rendered the exchange as a raw
pubkey, inconsistent with 'probe list' which already shows the
exchange code. Resolve exchange_pk to its code via list_exchanges
with a pubkey fallback, matching the list verb.
@ben-dz ben-dz force-pushed the bdz/geo-probe-code branch from 93753ef to b61abd5 Compare June 1, 2026 14:24
@ben-dz ben-dz enabled auto-merge (squash) June 1, 2026 14:27
@ben-dz ben-dz disabled auto-merge June 1, 2026 14:28
Comment thread crates/doublezero-geolocation-cli/src/probe/get.rs Outdated
Comment thread crates/doublezero-geolocation-cli/src/probe/get.rs Outdated
Comment thread crates/doublezero-geolocation-cli/src/user/get.rs Outdated
- probe get: keep the canonical exchange pubkey in JSON and expose the
  resolved code as a separate exchange_code field, so machine-readable
  output stays backward compatible (mirrors the user get target change)
- user get / probe get: treat code resolution as best-effort; an error
  listing probes/exchanges now falls back to the pubkey instead of
  failing the command, matching the existing not-found fallback
@ben-dz ben-dz requested a review from juan-malbeclabs June 1, 2026 14:57
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.

2 participants