feat(admin): add systemplane catalog surface#21
Conversation
Expose registered key metadata through public client APIs and admin catalog routes. Reserve the catalog route namespace, validate unsafe clone inputs, and document non-secret catalog usage. X-Lerian-Ref: 0x1
|
Caution Review failedFailed to post review comments WalkthroughAdds a read-only catalog registry with public types and Client accessors, safe cloning/validation, reserved-key protections, admin HTTP catalog endpoints (MountCatalog), unit tests, and README updates for catalog metadata and multi-tenant mounting. ChangesCatalog Registry System
Comment |
Resolve internal/client/client.go by keeping both manager lifecycle state and catalog service metadata. Preserve lifecycle cancellation gosec suppression and use direct #nosec on the manager example event name. X-Lerian-Ref: 0x1
🔍 PR Validation Summary✅ PR Mergeable — no blocking failures
|
🔒 Security Scan Results —
|
| Stage | Status | Blocking? |
|---|---|---|
| Filesystem Scan | ✅ Clean | — |
| Docker Image Scan | ➖ Skipped | — |
| Docker Hub Health Score | ➖ Skipped | — |
| Pre-release Version Check | ✅ Clean | — |
Trivy
Filesystem Scan
✅ No vulnerabilities or secrets found.
Pre-release Version Check
✅ No unstable version pins found.
📊 Unit Test Coverage Report:
|
| Metric | Value |
|---|---|
| Overall Coverage | 80.5% ✅ PASS |
| Threshold | 80% |
Coverage by Package
| Package | Coverage |
|---|---|
github.com/LerianStudio/lib-systemplane/admin |
88.4% |
github.com/LerianStudio/lib-systemplane/internal/client |
80.7% |
github.com/LerianStudio/lib-systemplane/internal/debounce |
73.1% |
github.com/LerianStudio/lib-systemplane/internal/manager |
87.4% |
github.com/LerianStudio/lib-systemplane/internal/mongodb |
97.5% |
github.com/LerianStudio/lib-systemplane/internal/postgres |
100.0% |
github.com/LerianStudio/lib-systemplane |
94.6% |
Generated by Go PR Analysis workflow
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@admin/admin.go`:
- Around line 4-15: Update the exported doc comment for Mount and MountCatalog
to reflect the actual mounted patterns: include the wildcard "/*" variants (e.g.
GET/PUT/DELETE /<prefix>/:namespace/* to allow keys containing slashes via
escaped slashes), note that both exact ":key" and wildcard "/*" routes are
mounted to support escaped-slash keys, and add the catalog detail route (GET
/<prefix>/-/catalog/:namespace/:key and its wildcard form) so the comments match
the implemented Mount and MountCatalog behavior.
In `@internal/client/value_clone.go`:
- Around line 165-225: The validation only deduplicates pointers so
self-referential slices/maps can recurse forever; update
validateCloneSafeIndexed and validateCloneSafeMap to treat slice/map identity
like pointers: if v.IsNil() return nil, compute a visit mark using visit{typ:
v.Type(), ptr: v.Pointer()} (same visit type used in validateCloneSafePointer),
check seen[mark] and return if present, then add seen[mark] = struct{}{} before
iterating and validating elements/values via validateCloneSafeValue (preserve
existing path formatting). Ensure you only call v.Pointer() when the value is
not nil to avoid panics.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: a87bbf42-031f-4c3a-b0b9-1b8b727c653f
📒 Files selected for processing (17)
README.mdadmin/admin.goadmin/admin_responses.goadmin/admin_test.goapi_catalog_test.goapi_client.goapi_constants.goapi_constructors.goapi_types.gointernal/client/catalog.gointernal/client/catalog_test.gointernal/client/client.gointernal/client/client_test.gointernal/client/options.gointernal/client/redact.gointernal/client/register.gointernal/client/value_clone.go
X-Lerian-Ref: 0x1
Fixes Applied SuccessfullyFixed 3 file(s) based on 2 CodeRabbit feedback item(s). Files modified:
Commit: Validation passed locally with The latest autofix changes are on the |
X-Lerian-Ref: 0x1
|
@CodeRabbit approve |
✅ Actions performedComments resolved and changes approved. |
Summary
Verification