Skip to content

Metadata identity + unary command RPCs part 3#1933

Open
asher-pem-arm wants to merge 11 commits into
labgrid-project:masterfrom
ARM-software:detach-streams-from-unary-rpcs-master-pr3
Open

Metadata identity + unary command RPCs part 3#1933
asher-pem-arm wants to merge 11 commits into
labgrid-project:masterfrom
ARM-software:detach-streams-from-unary-rpcs-master-pr3

Conversation

@asher-pem-arm

@asher-pem-arm asher-pem-arm commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Description

Checklist

  • Documentation for the feature
  • Tests for the feature
  • The arguments and description in doc/configuration.rst have been updated
  • Add a section on how to use the feature to doc/usage.rst
  • Add a section on how to use the feature to doc/development.rst
  • PR has been tested
  • Man pages have been regenerated

Description

This is the third part of the coordinator unary-RPC rework, building on the metadata-based identity and operation-specific RPCs introduced in #1918 and #1919.

Changes

  • ListPlaceResources returns resources matching a requested place.
  • ListResources returns exporter resources with filtering over resource attributes and paths.
  • ListPlaces supports filtering and deprecates GetPlaces.
  • ListReservations supports filtering and deprecates GetReservations.
  • The client reservation-listing path now uses ListReservations.
  • Deprecated RPCs remain available for older clients.

Motivation

  • Allows clients to retrieve current coordinator state without maintaining stream-backed caches.
  • Moves filtering and resource matching into the coordinator.
  • Reduces transferred data and duplicated client-side selection logic.
  • Provides consistent List* request and response types with scope for future pagination.
  • Preserves compatibility by deprecating GetPlaces and GetReservations rather than removing them.

note:

cel only works with python3:11 onwards:
https://pypi.org/project/common-expression-language/

See also

Discussion on the gRPC unary rework: #1881
First PR—metadata-based identity: #1918
Second PR—operation-specific RPCs: #1919

asher-pem-arm and others added 11 commits July 2, 2026 09:03
Add client and server interceptors which attach labgrid identity metadata
to gRPC calls and expose it to coordinator RPC handlers.

Use the metadata identity to register client and exporter stream sessions
while keeping startup-message handling as a deprecated fallback for older
clients and exporters.

Signed-off-by: Asher Pemberton <asher.pemberton@arm.com>
Reviewed-by: Asher Pemberton <asher.pemberton@arm.com> # gatekeeper
Co-authored-by: Luke Beardsmore <luke.beardsmore2@arm.com>
Allow AcquirePlace, ReleasePlace and CreateReservation to identify the
caller from gRPC metadata instead of requiring identity to come only from
an established ClientStream session.

Keep the existing ClientStream session lookup as a fallback so older
clients which still send startup messages on the stream continue to work.

Signed-off-by: Asher Pemberton <asher.pemberton@arm.com>
Reviewed-by: Asher Pemberton <asher.pemberton@arm.com> # gatekeeper
Co-authored-by: Luke Beardsmore <luke.beardsmore2@arm.com>
Add a unary GetPlace RPC for fetching a single place by name instead of
requiring callers to fetch and scan the full GetPlaces response.

Return INVALID_ARGUMENT when no name is provided or when the requested
place does not exist.

Signed-off-by: Asher Pemberton <asher.pemberton@arm.com>
Reviewed-by: Asher Pemberton <asher.pemberton@arm.com> # gatekeeper
Co-authored-by: Luke Beardsmore <luke.beardsmore2@arm.com>
Add a unary UnsharePlace RPC that lets the acquiring user remove a previously allowed user from a place without updating the full place state.

Expose the RPC through labgrid-client and cover the success, not-acquired, and not-shared error paths.

Signed-off-by: Asher Pemberton <asher.pemberton@arm.com>
Reviewed-by: Asher Pemberton <asher.pemberton@arm.com> # gatekeeper
Co-authored-by: Luke Beardsmore <luke.beardsmore2@arm.com>
Add a unary CreatePlace RPC that creates and returns the new place while keeping AddPlace available as a deprecated compatibility alias.

Update labgrid-client create to use CreatePlace and cover successful creation plus duplicate-place errors.

Signed-off-by: Asher Pemberton <asher.pemberton@arm.com>
Reviewed-by: Asher Pemberton <asher.pemberton@arm.com> # gatekeeper
Co-authored-by: Luke Beardsmore <luke.beardsmore2@arm.com>
Add a unary SharePlace RPC that grants another user access to an acquired place while keeping AllowPlace available as a deprecated compatibility alias.

Update labgrid-client to prefer the share command, retain allow as a command alias, and cover successful sharing plus not-acquired errors.

Signed-off-by: Asher Pemberton <asher.pemberton@arm.com>
Reviewed-by: Asher Pemberton <asher.pemberton@arm.com> # gatekeeper
Co-authored-by: Luke Beardsmore <luke.beardsmore2@arm.com>
Add a unary RefreshReservation RPC that refreshes and returns reservation state while keeping PollReservation available as a deprecated compatibility alias.

Update labgrid-client reservation waiting to use RefreshReservation and cover both new and deprecated reservation refresh paths.

Signed-off-by: Asher Pemberton <asher.pemberton@arm.com>
Reviewed-by: Asher Pemberton <asher.pemberton@arm.com> # gatekeeper
Co-authored-by: Luke Beardsmore <luke.beardsmore2@arm.com>
Add a unary ListPlaceResources RPC that returns the exporter resources matching a requested place.

Cover matched resources, empty matches, and missing-place errors using exporter fixture data where the resource name differs from its class.

Signed-off-by: Asher Pemberton <asher.pemberton@arm.com>
Reviewed-by: Asher Pemberton <asher.pemberton@arm.com> # gatekeeper
Co-authored-by: Luke Beardsmore <luke.beardsmore2@arm.com>
Add a unary ListResources RPC that returns exporter resources and supports CEL filtering over resource attributes and paths.

Include coverage for listing all resources and filtering by resource path data while waiting for exporter fixture resources to register.

Signed-off-by: Asher Pemberton <asher.pemberton@arm.com>
Reviewed-by: Asher Pemberton <asher.pemberton@arm.com> # gatekeeper
Co-authored-by: Luke Beardsmore <luke.beardsmore2@arm.com>
Add a unary ListPlaces RPC that returns places and supports CEL filtering over place attributes.

Mark the legacy GetPlaces RPC and messages as deprecated, and add coverage for listing, matching filters, invalid filters, unknown fields and non-boolean filter results.

Signed-off-by: Asher Pemberton <asher.pemberton@arm.com>
Reviewed-by: Asher Pemberton <asher.pemberton@arm.com> # gatekeeper
Co-authored-by: Luke Beardsmore <luke.beardsmore2@arm.com>
…tions

Add a unary ListReservations RPC that returns reservations and supports CEL filtering over reservation attributes and tokens.

Mark the legacy GetReservations RPC and messages as deprecated, update the client reservation listing path, and add coverage for matching filters, invalid filters, unknown fields and non-boolean filter results.

Signed-off-by: Asher Pemberton <asher.pemberton@arm.com>
Reviewed-by: Asher Pemberton <asher.pemberton@arm.com> # gatekeeper
Co-authored-by: Luke Beardsmore <luke.beardsmore2@arm.com>
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.

1 participant