DiscoverHierarchy: subtree root + server-side filters #102
Closed
opened 2026-04-29 12:51:12 -04:00 by dohertj2
·
2 comments
No Branch/Tag Specified
main
feat/secrets-0.2.0
fix/archreview-p2
fix/archreview-p1
fix/archreview-p0
feat/stillpending-section8
feat/session-resilience
feat/stillpending-completion
docs/prose-audit
docs/xml-doc-comments
feat/adopt-zb-health
feat/adopt-zb-telemetry-serilog
feat/tls-cert-autogen
feat/lazy-browse-children
test/client-e2e-coverage
docs/alarm-client-wm-app-finding
codex/fix-runtime-review-findings
agent-2/issue-50-client-packaging-documentation
agent-1/issue-49-cross-language-smoke-test-matrix
agent-1/issue-48-implement-java-client-session-values-errors-and-cli
agent-2/issue-35-parity-fixture-matrix
agent-3/issue-46-implement-python-async-client-values-errors-and-cli
agent-1/issue-47-scaffold-java-gradle-build
agent-2/issue-44-implement-rust-client-session-values-errors-and-cli
agent-3/issue-45-scaffold-python-package
agent-1/issue-40-implement-dotnet-values-status-errors-and-cli
agent-3/issue-42-implement-go-client-session-values-errors-and-cli
agent-2/issue-34-worker-live-mxaccess-smoke-test
agent-3/issue-43-scaffold-rust-workspace
agent-1/issue-39-implement-dotnet-gatewayclient-and-session
agent-2/issue-33-implement-graceful-shutdown
agent-3/issue-41-scaffold-go-module
agent-1/issue-38-scaffold-dotnet-client-projects
agent-3/issue-32-implement-heartbeat-and-watchdog
agent-1/issue-37-create-cross-language-client-behavior-fixtures
agent-2/issue-29-implement-event-sink-and-event-queue
agent-1/issue-36-publish-stable-client-proto-generation-inputs
agent-2/issue-28-implement-advise-unadvise-advisesupervisory
agent-1/issue-16-implement-blazor-server-dashboard
agent-3/issue-19-gateway-e2e-smoke-with-fake-worker
agent-2/issue-27-implement-additem-additem2-removeitem
agent-3/issue-18-build-fake-worker-test-harness
agent-1/issue-17-implement-dashboard-authentication
agent-2/issue-26-implement-register-and-unregister
agent-3/issue-14-implement-event-streaming-and-backpressure
agent-1/issue-15-implement-dashboard-snapshot-service
agent-2/issue-25-implement-sta-command-dispatcher
agent-3/issue-13-implement-public-grpc-service
agent-2/issue-31-implement-mxstatus-proxy-and-hresult-conversion
agent-1/issue-24-create-mxaccess-com-object-on-sta
agent-3/issue-12-implement-session-manager-and-registry
agent-2/issue-30-implement-value-conversion
agent-1/issue-23-implement-sta-runtime-and-message-pump
agent-2/issue-22-implement-pipe-client-and-frame-protocol
agent-3/issue-11-implement-gateway-workerclient
agent-1/issue-8-add-grpc-authentication-and-scope-authorization
agent-2/issue-7-implement-local-api-key-admin-cli
agent-3/issue-21-implement-worker-bootstrap-and-options
agent-1/issue-10-implement-worker-process-launcher
agent-2/issue-6-implement-api-key-hashing-and-verification
agent-3/issue-20-scaffold-worker-project
agent-2/issue-5-implement-sqlite-auth-store-and-migrations
agent-1/issue-9-implement-worker-frame-protocol
agent-3/issue-4-add-structured-logging-and-metrics-foundation
agent-2/issue-3-add-gateway-configuration-and-validation
agent-1/issue-2-define-protobuf-contracts
agent-1/issue-1-scaffold-gateway-solution-and-projects
clients/go/v0.1.1
Labels
Clear labels
area:auth
area:client-dotnet
area:client-go
area:client-java
area:client-python
area:client-rust
area:contracts
area:dashboard
area:docs
area:gateway
area:tests
area:worker
blocked
priority:p0
priority:p1
priority:p2
type:docs
type:feature
type:infra
type:test
Authentication and authorization
.NET client library
Go client library
Java client library
Python client library
Rust client library
Protocol and generated contract work
Blazor dashboard work
Documentation
Gateway server work
Automated and live tests
MXAccess worker process work
Blocked by dependency
Must-have / blocking
High priority
Normal priority
Documentation work
Feature implementation
Infrastructure and scaffolding
Test work
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
dohertj2 (dohertj2)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: dohertj2/mxaccessgw#102
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
galaxy_repository.v1.DiscoverHierarchytoday returns the entire deployed Galaxy as one paged stream. Every consumer that only cares about a slice (a single Area, only$WinPlatformruntime hosts, only alarm-bearing or historized attributes, a tag-name pattern for an Admin UI search box) has to pull the whole hierarchy and filter client-side.For a 50k-object Galaxy this is wasteful for first-load and for any UI that does narrow lookups, and it makes future per-key scoped permissions (#follow-up) harder to implement because the server has no concept of "this caller's view of the hierarchy."
The gateway already materializes the full object list inside
GalaxyHierarchyCacheonce per deploy, so server-side slicing is cheap —Where/Skip/Takeover an in-memory list.Proposed proto change
Field numbers 3-12 are additive; existing clients keep working unchanged.
Server behavior
root_*resolves to agobject_id; missing root returnsNotFound.max_depthis computed against the resolved root, not the Galaxy root.tag_name_globuses standard*/?glob, anchored, case-insensitive.include_attributes=falsereturnsGalaxyObjectskeletons with emptyattributes— useful for Admin UI tree lazy-load.total_object_countreflects post-filter count.Acceptance
total_object_countis post-filter.gobject_id, subtree bytag_name, subtree bycontained_path,max_depthcap, each filter individually, all filters combined, paging across a filtered result..NETclientGalaxyRepositoryClientexposes a typedDiscoverHierarchyAsync(DiscoverHierarchyOptions)overload covering the new fields. The current zero-argDiscoverHierarchyAsync()keeps current behavior.docs/GalaxyRepository.mddocuments subtree + filter semantics.Out of scope
Per-API-key constraint scoping (e.g. "this key may only see
Area1/*") is a separate feature — see the per-key scoping issue. This issue ships the mechanism; that issue plugs key-bound constraints into the same code path.Source
Surfaced during
lmxopcuaGalaxy → MxGateway migration planning (seelmx_mxgw_impl.mdaudit). OtOpcUa itself doesn't need this for the v1 migration since it pulls the whole hierarchy at startup, but it unblocks Admin UI use cases and is a structural prerequisite for per-key scoping.Companion: #103 (per-key scoped permissions). The
browse_subtreesconstraint there reuses the filtering pipeline added by this issue.Implemented in
b995c17(codex/fix-runtime-review-findings).Verification passed:
dotnet build src\MxGateway.Contracts\MxGateway.Contracts.csprojscripts\publish-client-proto-inputs.ps1clients\go\generate-proto.ps1clients\python\generate-proto.ps1gradle :mxgateway-client:generateProtodotnet test src\MxGateway.sln --no-restoredotnet test clients\dotnet\MxGateway.Client.sln --no-restorego test ./...python -m pytestcargo fmt --all --checkcargo test --workspacegradle testgit diff --check