feat(rdws): add supervisor-update methods and fix GetLogs - #13
Merged
Conversation
Adds the rDWS methods needed to drive and observe a supervisor update on a
player, and fixes GetLogs so it can succeed at all.
New RDWSService methods (each follows the existing rdws.go shape: validate,
ensure auth + network context, build the destination-scoped URL, unwrap
data.result):
- TriggerUpdateSync POST /update/sync
- GetStoredSupervisors GET /system/supervisors
- DeleteSupervisors POST /system/supervisors/delete (builds/clear are
mutually exclusive; rejected client-side too)
- GetCrashDumpFiles GET /logs/crash-dumps
- GetSystemInfo GET /system -- EXPERIMENTAL: an Internal-tier,
undocumented route, reachable only because the rDWS
passthrough originates from localhost. It is the only
source for the running supervisor version, so it is
provided with a caveat rather than left to every
caller to hand-roll.
Fixes:
- GetLogs treated a string result as a device error, but GET /logs returns
dmesg AS a string, so the method could never succeed on a healthy player.
A string result is now the success case (RDWSLogs.Text); a structured list
is still accepted. Genuine device errors arrive as non-2xx and are handled
before this parse, so nothing is lost.
New public type aliases in gopurple.go so external consumers can use the new
methods without importing internal/types. RDWSLogs gains a Text field
additively; no existing field or signature changes, so this is a safe drop-in.
Tests: parseLogsResult and parseCrashDumpList table tests (the log fix fails
against the prior logic, confirming it tests the fix), plus interface
conformance, empty-serial/no-auth guards, request-shape validation, and
response-parsing for the system-info and stored-supervisor shapes.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the rDWS methods needed to drive and observe a supervisor update on a player, and fixes GetLogs so it can succeed at all.
New RDWSService methods (each follows the existing rdws.go shape: validate, ensure auth + network context, build the destination-scoped URL, unwrap data.result):
mutually exclusive; rejected client-side too)
undocumented route, reachable only because the rDWS
passthrough originates from localhost. It is the only
source for the running supervisor version, so it is
provided with a caveat rather than left to every
caller to hand-roll.
Fixes:
New public type aliases in gopurple.go so external consumers can use the new methods without importing internal/types. RDWSLogs gains a Text field additively; no existing field or signature changes, so this is a safe drop-in.
Tests: parseLogsResult and parseCrashDumpList table tests (the log fix fails against the prior logic, confirming it tests the fix), plus interface conformance, empty-serial/no-auth guards, request-shape validation, and response-parsing for the system-info and stored-supervisor shapes.