private location cmd - #32
Merged
Merged
Conversation
Member
Author
|
@claude review this |
There was a problem hiding this comment.
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) withlist,info, andcreatesubcommands (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...) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.