Skip to content

Metadata identity + unary command RPCs part 2#1919

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

Metadata identity + unary command RPCs part 2#1919
asher-pem-arm wants to merge 7 commits into
labgrid-project:masterfrom
ARM-software:detach-streams-from-unary-rpcs-master-pr2

Conversation

@asher-pem-arm

@asher-pem-arm asher-pem-arm commented Jul 2, 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 second part of the coordinator unary-RPC rework, building on the metadata-based identity support introduced in the first PR. #1918

Changes

  • GetPlace for retrieving one place directly.
  • CreatePlace, deprecating AddPlace.
  • SharePlace, deprecating AllowPlace.
  • UnsharePlace for revoking shared access.
  • RefreshReservation, deprecating PollReservation.
  • The client CLI uses the new RPCs, adds share and unshare commands, and retains allow as a compatibility alias. Deprecated RPCs remain available for older clients.

Motivation

  • GetPlace avoids fetching and scanning every place.
  • CreatePlace returns the created place and replaces the ambiguous AddPlace.
  • SharePlace and UnsharePlace provide explicit, reversible access management.
  • RefreshReservation clearly represents refreshing reservation state.

See also

Discussion on the gRPC unary rework: #1881
First PR to detach client stream: #1918
The List RPC changes: #1933

asher-pem-arm and others added 7 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>
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.03364% with 281 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.3%. Comparing base (63749cf) to head (1e08ebc).
⚠️ Report is 8 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...abgrid/remote/generated/labgrid_coordinator_pb2.py 1.9% 198 Missing ⚠️
...d/remote/generated/labgrid_coordinator_pb2_grpc.py 48.3% 48 Missing ⚠️
labgrid/remote/coordinator.py 92.7% 17 Missing ⚠️
labgrid/remote/client.py 56.2% 14 Missing ⚠️
labgrid/remote/identity.py 91.4% 3 Missing ⚠️
labgrid/remote/grpc/interceptor/server.py 95.6% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1919     +/-   ##
========================================
+ Coverage    61.0%   61.3%   +0.3%     
========================================
  Files         182     185      +3     
  Lines       14848   15316    +468     
========================================
+ Hits         9067    9402    +335     
- Misses       5781    5914    +133     
Flag Coverage Δ
3.10 61.3% <57.0%> (+0.3%) ⬆️
3.11 61.3% <57.0%> (+0.3%) ⬆️
3.12 61.3% <57.0%> (+0.2%) ⬆️
3.13 61.3% <57.0%> (+0.2%) ⬆️
3.14 61.3% <57.0%> (+0.2%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants