Skip to content

feat(modules): report remotely-triggered self-update outcome to NetPulse (#549) - #551

Merged
gnacho merged 1 commit into
mainfrom
feat/549-selfupdate-reporting
Oct 20, 2026
Merged

gnacho merged 1 commit into
mainfrom
feat/549-selfupdate-reporting

Conversation

@gnacho

@gnacho gnacho commented Oct 20, 2026

Copy link
Copy Markdown
Owner

When NetPulse triggers a NetGrip self-update over the agent SSE channel (upgrade event), NetGrip ran StartSelfUpdate asynchronously and returned nothing: no progress, no terminal result, no error. Any failure (for example the space pre-check aborting) only reached the router log, so NetPulse showed "update sent" and the button reappeared a few seconds later. From the UI it looked like updates were not allowed.

This adds a one-shot outcome hook to the self-update flow:

  • The hook is armed only by the remote SSE trigger (manual updates from the NetGrip panel are unaffected).
  • Progress steps (downloading, install) and the terminal result (ok before restart, or fail with the real reason) are POSTed to the NetPulse agent endpoints /api/agents/{slug}/upgrade-progress and /api/agents/{slug}/upgrade-result with the agent token as Bearer, same contract as the standalone agent.
  • Fail-silent with a log line, like the executor token registration: a network error while reporting never blocks the self-update itself.

Tests: one-shot hook consumption, failure path reporting, and the Bearer contract of the reports.

Closes #549

The SSE upgrade command from NetPulse starts NetGrip's own self-update
detached, and its failures (download, arch check, install, not enough
space) only reached the router log: from the NetPulse UI the action
looked like a no-op with no error shown.

Arm a one-shot outcome hook before starting the self-update and report
the terminal state back to NetPulse (upgrade-progress / upgrade-result
with the agent token), so the server can show real progress and the
failure reason.

Closes #549
@gnacho
gnacho merged commit 5899533 into main Oct 20, 2026
2 checks passed
@gnacho
gnacho deleted the feat/549-selfupdate-reporting branch October 20, 2026 09:32
borky pushed a commit to borky/netgrip that referenced this pull request Oct 25, 2026
Upstream's new upgrade-progress and upgrade-result reports (gnacho#551) used a
plain client. Against a NetPulse on its private CA the handshake failed,
so a self-update NetPulse triggered never reported back; and the client
would have followed a redirect with the agent token. They now use the
same pinned client as enrolment, the executor token and backups.
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.

Report self-update outcome to NetPulse when the upgrade is triggered remotely

1 participant