project-pegaprox icon indicating copy to clipboard operation
project-pegaprox copied to clipboard

[Feature] add webhook/command to rolling updates

Open hugobugomugo opened this issue 3 months ago • 3 comments

Got an idea? Nice! 💡 We love hearing what features would make PegaProx better for you.

A friendly reminder: PegaProx is built by volunteers in our spare time. We can't promise timelines or guarantee every feature will be implemented — but every suggestion helps shape the roadmap!

Want to help move things faster?


Describe the feature

add option to send custom webhook/command when running rolling updates

Use Case

to send out an n8n webhook that then mutes the system in our monitoring system, so duty can sleep :)

maybe this can be taken even further with an trigger/action similar to what iphone does with shortcuts?

Alternatives considered

my alternative till now was to define an static maintenance window at the time for updates, but that quickly gets annoying if you have to adjust the update time for some reason. it also creates an unnecesarry monitoring mute in the case where update dont run if the node is already up to date

How important is this for you?

nice to have

Checklist

  • [x] I have searched existing issues and discussions to make sure this hasn't been requested before

hugobugomugo avatar Aug 20 '26 10:08 hugobugomugo

Nice use case — muting the on-call while a rolling update runs is exactly what a lifecycle hook should cover, and your point about the static maintenance window being clumsy (especially when the update turns out to be a no-op) is spot on. A pre/post (and ideally per-node) webhook or command on rolling updates is a sensible addition; I've noted it. The shortcuts-style trigger/action idea is interesting too, though that's a bigger design. No promises on timing (spare-time project), but it's on the list.

mkellermann97 avatar Aug 20 '26 12:08 mkellermann97

Built, on Testing, and your framing shaped it: the point is not "a webhook exists", it is that the signal has to come from the run itself, because a maintenance window guessed in advance mutes nothing useful when the update turns out to be a no-op.

A rolling update now fires two events:

  • rolling_update.started - cluster, how many nodes are queued and their names, and whether reboots are included
  • rolling_update.finished - how many were updated, skipped as up-to-date, and failed

and if the run dies on an exception, that also fires a finish event, marked critical. Un-muting on the way out matters more than muting on the way in, and a run that crashed is exactly when you want the on-call awake again.

There is no new webhook configuration. It goes through the Alert Channels you already have (Settings -> Server -> Alert Channels), which speak Slack, Discord, Teams, ntfy and plain JSON - the last is what n8n wants, and it gets the raw payload with the event key in it, so your flow can branch on rolling_update.started versus .finished and read the counts out of the message. That also means the URL keeps going through the same guard as every other channel, and no second credential store appears.

Selection is per run, in the rolling-update dialog: a row of channel buttons under the options. Nothing ticked sends nothing, so nobody gets paged because they upgraded and never asked for this.

It cannot affect the update. The dispatch is wrapped so that a channel being down, slow or misconfigured cannot raise inside the thread that is evacuating your VMs - there is a test that feeds it an exploding channel and asserts the caller survives.

One limitation to flag: listing the channels needs the alert.manage permission, so an operator who can run updates but cannot see alert configuration will not see the picker. That felt better than widening a permission that was narrowed after an audit; if it gets in your way, say so and we can look at a read-only variant.

The shortcuts-style trigger/action idea is genuinely interesting and genuinely bigger than this - I have left it out rather than half-build it.

mkellermann97 avatar Sep 28 '26 20:09 mkellermann97

Both halves of this are now on Testing.

Per node (@gyptazy, #960): a "Rolling Updates" alert type in Automation -> Alerts. Point it at a whole cluster or one named node, and it fires when that node's reboot command has actually been issued - not when the run merely has reboots enabled, which matters because a fully patched node is not rebooted at all. It goes through the alert pipeline you already have, so the browser inbox, email and the webhook channels all carry it.

Per run (2f7d7bc): rolling_update.started and rolling_update.finished on the run itself, with the counts, and a finish event from the failure path marked critical. That is the mute / un-mute pair for your n8n flow: start when the run begins, end when it actually ends rather than when a guessed maintenance window expires.

They do not overlap and you can use either or both. If you only want the on-call quiet for the duration, the run-level pair is enough and it is one selection in the rolling-update dialog. If you want to know which node is going down right now, the alert rule gives you that per node.

The shortcuts-style trigger/action idea is still open and still bigger than this; I have left it out rather than half-build it.

MrMasterbay avatar Sep 28 '26 21:09 MrMasterbay