Skip to content

Give devices the connectivity view tunnels already have - #186

Merged
vitramir merged 1 commit into
mainfrom
device-connectivity
Aug 10, 2026
Merged

Give devices the connectivity view tunnels already have#186
vitramir merged 1 commit into
mainfrom
device-connectivity

Conversation

@vitramir

Copy link
Copy Markdown
Contributor

DeviceStatus only models enrollment (PENDING/ENROLLED), so the console can show a device as Enrolled but has no way to say whether it is actually reachable. Devices sit permanently at "Enrolled" once the token is redeemed, even when the machine is off.

TunnelCredential already splits this into two axes — enrollment_state and connectivity, plus enrolled_at/last_seen_at. This mirrors that shape for Device:

  • new DeviceConnectivity enum (UNSPECIFIED/ONLINE/OFFLINE)
  • Device.connectivity, Device.enrolled_at, Device.last_seen_at

DeviceStatus keeps its current meaning as the enrollment axis, so nothing changes for existing readers.

Deliberately not adding provisioning_state: unlike tunnels, devices have no reconcile loop — the OpenZiti identity is created synchronously in CreateDevice and the row is only written on success, so the field would always read active and carry no information.

Additive only — buf lint and buf breaking --against main both pass.

Follow-up once this publishes to the BSR: users gains the columns and populates connectivity/last_seen_at from the GetIdentityLiveness poll it now runs, and console-app renders the second axis.

DeviceStatus only covers enrollment, so the console can show a device as
Enrolled but never as reachable. TunnelCredential already models these as
two axes; mirror that for devices.

Adds DeviceConnectivity plus enrolled_at/last_seen_at. Additive only.
@vitramir
vitramir requested a review from a team as a code owner August 10, 2026 04:15
@github-actions

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow buf-pr / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedAug 10, 2026, 4:15 AM

@vitramir
vitramir merged commit 8e3d931 into main Aug 10, 2026
1 check passed
vitramir added a commit to agynio/users that referenced this pull request Aug 10, 2026
Devices were written pending and nothing ever wrote anything else. Only
OpenZiti knows when an enrollment token is redeemed, and users had no liveness
poll, so every device read pending forever no matter what it was doing.

Adds a poll mirroring the tunnel liveness loop networks already runs: every
DEVICE_LIVENESS_INTERVAL it reads GetIdentityLiveness per device and records
enrollment and connectivity as two axes, the same shape as TunnelCredential.
An unchanged offline device is skipped; an online one is written each pass so
last_seen_at keeps advancing. One failing device does not stop the sweep.

Needs the Device.connectivity/enrolled_at/last_seen_at fields from
agynio/api#186.

Also fixes devspace.yaml, which had never run: it patched a deployment named
users-users, its pipeline name was invalid for current devspace, it forwarded a
host port, and its buf generate was missing the groups proto CI and the
Dockerfile both pass.
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