Skip to content

cli: add hidden init-geolocation-config command#3717

Merged
ben-dz merged 1 commit into
mainfrom
bdz/init-geolocation-config
May 19, 2026
Merged

cli: add hidden init-geolocation-config command#3717
ben-dz merged 1 commit into
mainfrom
bdz/init-geolocation-config

Conversation

@ben-dz
Copy link
Copy Markdown
Contributor

@ben-dz ben-dz commented May 18, 2026

Stacked on #3715 (PR 3: `doublezero geolocation user`). Base branch: `bdz/geolocation-user-subtree`.

Summary of Changes

  • Adds a hidden top-level `doublezero init-geolocation-config` command that delegates to `InitProgramConfigCliCommand`, mirroring `doublezero-geolocation init-config`
  • Follows the same `#[command(hide = true)]` pattern as the existing `Init` and `Migrate` hidden commands

Diff Breakdown

Category Files Lines (+/-) Net
Scaffolding 2 +13 / -0 +13
Docs 1 +1 / -0 +1

Pure wiring — no new logic, just hooking `InitProgramConfigCliCommand` into the existing `doublezero` binary.

Key files (click to expand)
  • `client/doublezero/src/cli/command.rs` — adds `InitGeolocationConfig(InitProgramConfigCliCommand)` hidden variant; imports `InitProgramConfigCliCommand` into the `doublezero_cli` use block
  • `client/doublezero/src/main.rs` — wires `Command::InitGeolocationConfig` dispatch arm; constructs `GeoClient` + `GeoCliCommandImpl` inline, identical to the `Command::Geolocation` pattern

Testing Verification

  • `cargo check -p doublezero` passes clean
  • `make rust-fmt && make rust-lint` pass with no warnings
  • `doublezero init-geolocation-config --help` shows the expected clap help (including `--yes`)
  • `doublezero --help | grep init-geolocation` produces no output, confirming the command is hidden

@ben-dz ben-dz force-pushed the bdz/geolocation-user-subtree branch from 454f635 to e2c3c0e Compare May 18, 2026 19:11
@ben-dz ben-dz marked this pull request as draft May 18, 2026 19:28
@ben-dz ben-dz force-pushed the bdz/geolocation-user-subtree branch from e2c3c0e to b7c23c0 Compare May 18, 2026 20:47
Base automatically changed from bdz/geolocation-user-subtree to main May 19, 2026 12:46
@ben-dz ben-dz force-pushed the bdz/init-geolocation-config branch 2 times, most recently from 9069a11 to ba94a5d Compare May 19, 2026 13:04
@ben-dz ben-dz force-pushed the bdz/init-geolocation-config branch from ba94a5d to ad2bd6f Compare May 19, 2026 13:04
@ben-dz ben-dz requested a review from juan-malbeclabs May 19, 2026 13:08
@ben-dz ben-dz marked this pull request as ready for review May 19, 2026 13:08
@ben-dz ben-dz merged commit 2a15159 into main May 19, 2026
33 checks passed
@ben-dz ben-dz deleted the bdz/init-geolocation-config branch May 19, 2026 13:45
ben-dz added a commit that referenced this pull request May 19, 2026
## Summary of Changes
- Adds `doublezero geolocation probe ...` and `doublezero geolocation
user ...` subcommand groups to the `doublezero` CLI, mirroring the
standalone `doublezero-geolocation` binary
- Adds `doublezero init-geolocation-config` (hidden) mirroring
`doublezero-geolocation init-config`
- Adds `--geo-program-id` to `doublezero config set` and `doublezero
config get`; persists and prints the geolocation program ID alongside
the serviceability program ID
- Migrates all e2e test invocations (`geoprobe_test.go`,
`smartcontract_geolocation.go`) and the manager init script from
`doublezero-geolocation ...` to `doublezero geolocation ...` /
`doublezero init-geolocation-config` / `doublezero config set
--geo-program-id`

This is PR 5 of 5 in a stacked series, stacked on top of PR #3717
(`bdz/init-geolocation-config`), which adds the geolocation CLI commands
to the `doublezero_cli` library. PRs 1–4 must be merged first.

## Diff Breakdown
| Category     | Files | Lines (+/-)  | Net  |
|--------------|-------|--------------|------|
| Core logic   |     3 | +150 / -9    | +141 |
| Scaffolding  |     5 | +98 / -4     |  +94 |
| Tests        |     3 | +16 / -16    |   +0 |
| Docs         |     1 | +6 / -0      |   +6 |

Mostly new scaffolding and core logic adding geolocation commands to
`doublezero`; e2e changes are pure renames with zero net churn.

<details>
<summary>Key files (click to expand)</summary>

- `smartcontract/cli/src/config/set.rs` — adds `--geo-program-id` flag,
persistence, conflict detection with `--env`, output formatting, and
tests
- `client/doublezero/src/main.rs` — dispatch for `Command::Geolocation`
and `Command::InitGeolocationConfig`; constructs `GeoClient` with
`--geo-program-id` global flag
- `client/doublezero/src/cli/geolocation/user.rs` — thin Clap wrapper
exposing all `doublezero_cli` geolocation user subcommands
- `client/doublezero/src/cli/geolocation/probe.rs` — thin Clap wrapper
exposing all `doublezero_cli` geolocation probe subcommands
- `client/doublezero/src/cli/command.rs` — registers `Geolocation` and
`InitGeolocationConfig` variants in the top-level command enum
- `smartcontract/cli/src/config/get.rs` — adds Geolocation Program ID
line to `config get` output
- `e2e/geoprobe_test.go` — replaces `"doublezero-geolocation"` with
`"doublezero", "geolocation"` at all call sites
- `e2e/docker/manager/scripts/init-config.sh` — consolidates geo program
ID into `doublezero config set --geo-program-id`; removes standalone
`doublezero-geolocation config set` call

</details>

## Testing Verification
- `TestE2E_GeoprobeDiscovery` passed (208s runtime) — exercises `probe
create`, `probe get`, `probe add-parent`, `user create`, `user
update-payment`, `user add-target` (outbound + inbound), and
`init-geolocation-config` via the new paths
- `TestE2E_GeoprobeIcmpTargets` and `TestE2E_GeoprobeResultDestination`
were not run in this session; reviewer may want to verify those
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