Skip to content

private location cmd - #32

Merged
thibaultleouay merged 1 commit into
mainfrom
private-location-cmd
Jul 25, 2026
Merged

private location cmd#32
thibaultleouay merged 1 commit into
mainfrom
private-location-cmd

Conversation

@thibaultleouay

Copy link
Copy Markdown
Member

No description provided.

@thibaultleouay

Copy link
Copy Markdown
Member Author

@claude review this

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class support for “private locations” (self-hosted checker agents) to the CLI, including a new top-level command group and enriched monitor output that can display attached private locations.

Changes:

  • Introduces openstatus private-locations (pl) with list, info, and create subcommands (plus JSON output support).
  • Extends monitors list/info output to include attached private location IDs (and resolve them to names/status when possible).
  • Updates generated docs and bumps the OpenStatus API generated client versions (and CLI version to v1.3.0).

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/privatelocation/privatelocation.go Core helpers: client constructors, status formatting, token masking, ID→name resolution, and shared table rendering for private-locations commands and monitor integration.
internal/privatelocation/privatelocation_test.go Unit tests for command wiring and shared helpers (masking, formatting, metadata parsing, label/ref helpers).
internal/privatelocation/privatelocation_list.go Implements private-locations list command and rendering/JSON output.
internal/privatelocation/privatelocation_list_test.go Tests list behavior for success/empty/truncated output and API errors.
internal/privatelocation/privatelocation_info.go Implements private-locations info, including token masking and monitor name resolution.
internal/privatelocation/privatelocation_info_test.go Tests token masking/reveal behavior, monitor-name resolution fallback, required ID handling, and not-found messaging.
internal/privatelocation/privatelocation_create.go Implements private-locations create, including metadata parsing and interactive wizard behavior.
internal/privatelocation/privatelocation_create_test.go Tests create output (token shown), API call occurrence, API error surfacing, and flag presence.
internal/privatelocation/export_test.go Exposes selected internal helpers/types to external tests via test-only exports.
internal/monitors/monitors.go Extends the Monitor model to include private_location_ids for JSON output.
internal/monitors/monitors_private_location_test.go Tests monitors list output behavior when private locations are absent/present and when resolution fails or is nil.
internal/monitors/monitors_list.go Adds private-location resolution + conditional “Private Locations” column and JSON field to monitors list.
internal/monitors/monitor_info.go Adds private-location resolution + inclusion in JSON output and human-readable info display for monitors info.
internal/monitors/monitor_create.go Populates the local Monitor struct with PrivateLocationIDs when converting from API models.
internal/cmd/app.go Registers the new private-locations command and bumps the CLI version to v1.3.0.
internal/cmd/app_test.go Updates expected version and command count/list to include private-locations.
go.sum Updates checksums for bumped OpenStatus generated API modules.
go.mod Bumps OpenStatus generated API module versions and adjusts protobuf dependency classification.
docs/openstatus.1 Regenerates manpage to include private-locations command documentation and updated “Get started” section.
docs/openstatus-docs.md Updates Markdown docs to include private-locations and updated “Get started” section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return refs, nil
}

resp, err := client.ListPrivateLocations(ctx, &private_locationv1.ListPrivateLocationsRequest{})
Comment on lines +79 to +82
var allIDs []string
for _, e := range entries {
allIDs = append(allIDs, e.privateLocationIDs...)
}
@thibaultleouay
thibaultleouay merged commit 8e8bb36 into main Jul 25, 2026
3 checks passed
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