Skip to content

feat: expose RackReservation.user + minimal User#98

Draft
leoparente wants to merge 1 commit into
developfrom
feat/obs-user-rackreservation
Draft

feat: expose RackReservation.user + minimal User#98
leoparente wants to merge 1 commit into
developfrom
feat/obs-user-rackreservation

Conversation

@leoparente

@leoparente leoparente commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

RackReservation now exposes its required user field, backed by a minimal
User type (username only). Previously the wrapper had no way to set the user,
so rack reservations failed ingestion with Field user is required. Closes #75.

What changes

  • Regenerated the ingester protobuf stubs (ingester_pb2.py / .pyi) and the
    ingester wrapper from the updated proto.
  • RackReservation gains a user field; new minimal User wrapper (username).
  • New example: docs/examples/rack_reservation.py (shows user=User(username=...)).

Usage

from netboxlabs.diode.sdk.ingester import Entity, RackReservation, User

Entity(rack_reservation=RackReservation(
    rack=...,
    units=[1, 2, 3],
    user=User(username="alice"),   # resolved against an existing NetBox user
))

The user is a reference to an existing NetBox user (matched by username); it is
not created by ingest.

Notes

  • Generated code — regenerated from the updated ingester proto, not hand-edited.
  • Depends on the corresponding ingester proto change.

Note: User is a match-only reference (resolved by username, never created via ingest), so there is no standalone user example — the correct usage is the nested User(...) shown in rack_reservation.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/netboxlabs/diode/sdk
   chunking.py33197%112
   client.py5684293%202–203, 222–224, 227–230, 516, 583, 588, 592, 675–680, 725–727, 757, 761, 765, 787, 808, 810, 884, 915, 923, 983–984, 993, 1026, 1053, 1058–1059, 1092, 1097–1100
   exceptions.py44393%69, 82–83
TOTAL6604693% 

Tests Skipped Failures Errors Time
203 0 💤 0 ❌ 0 🔥 2.019s ⏱️

@github-actions github-actions Bot added Documentation Improvements or additions to documentation python labels Jul 9, 2026
Regenerated from the updated ingester proto: RackReservation now exposes the
required user field and a minimal User wrapper (username). Closes #75.

Co-Authored-By: Claude Fable 5 <[email protected]>
@leoparente leoparente force-pushed the feat/obs-user-rackreservation branch from 6700e5b to 5e89cbd Compare July 9, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RackReservation object does not expose required 'user' field

1 participant