Skip to content

feat: add staged deployment update notifier - #272

Open
arpit1385 wants to merge 2 commits into
get-aurora-dev:mainfrom
arpit1385:feat/deployment-notifier
Open

feat: add staged deployment update notifier#272
arpit1385 wants to merge 2 commits into
get-aurora-dev:mainfrom
arpit1385:feat/deployment-notifier

Conversation

@arpit1385

Copy link
Copy Markdown

Implements an deployment notification system to alert users when a system update is staged .

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@renner0e renner0e left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

I will properly test this soon, some thoughts/questions from me. I would appreciate if you generally explained your reasons for why you are doing certain things/what made you decide to implement things a certain way in the commit message instead of stating what you are doing because it would make reviewing and fixing it up later (when it inevitable breaks) easier

A general outline on how you intended this to work from a user perspective would also make it more clear what the intended behavior/what a bug is.

I'm curious how you tested this, I'd recommend building a sysext with sysextbuddy (see readme) and then moving that to /var/lib/extensions so it survives updates/reboots so you can properly dog food this. Documentation is kinda meh in general regarding this.

EDIT: also do sudo systemctl enable systemd-sysext.service

@renner0e renner0e Sep 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we could get rid of this duplication with the user and system service units.

I think we might be able to use this neat systemd feature for that

man systemd.unit(5)

Unit names can be parameterized by a single argument called the "instance name". The unit
is then constructed based on a "template file" which serves as the definition of multiple
services or other units. A template unit must have a single "@" at the end of the unit name
prefix (right before the type suffix). The name of the full unit is formed by inserting the
instance name between "@" and the unit type suffix. In the unit file itself, the instance
parameter may be referred to using "%i" and other specifiers, see below.

See for an examplesystemd-zram-setup@.service systemd-zram-setup@zram0.service

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try testing and implementing it this way.

Comment on lines +13 to +36
case "${action}" in
enable|on)
systemctl --user enable --now "${user_path}"
sudo systemctl enable --now "${system_timer}"
sudo systemctl start "${system_service}" || true
echo "Aurora update notifications enabled."
;;
disable|off)
systemctl --user disable --now "${user_path}" || true
sudo systemctl disable --now "${system_timer}" || true
rm -f "${XDG_STATE_HOME:-${HOME}/.local/state}/aurora/deployment-notifier/last-notified"
echo "Aurora update notifications disabled."
;;
status)
echo "User notifier:"
systemctl --user --no-pager status "${user_path}" || true
echo
echo "System checker:"
systemctl --no-pager status "${system_timer}" || true
;;
*)
echo "Usage: ujust aurora-update-notifier [enable|disable|status]"
exit 2
;;

@renner0e renner0e Sep 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually have one recipe entrypoint and then use gum to select actions like in this case disable|status and so on. I think this would be nice here as well.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try implementing the entrypoint and selection via gum.

@renner0e

renner0e commented Sep 3, 2026

Copy link
Copy Markdown
Member

resolves: ublue-os/aurora#259

…nt-notifier.just

Co-authored-by: renner <80410025+renner0e@users.noreply.github.com>
@arpit1385

Copy link
Copy Markdown
Author

Thanks for working on this!

Thanks for the feedback and guidance.

I will properly test this soon, some thoughts/questions from me. I would appreciate if you generally explained your reasons for why you are doing certain things/what made you decide to implement things a certain way in the commit message instead of stating what you are doing because it would make reviewing and fixing it up later (when it inevitable breaks) easier

Yeah I will keep commit changes clear from next time, this time I just copied the files overs from last pr as the structure and implementation was almost similar just pushed it as a single commit.

A general outline on how you intended this to work from a user perspective would also make it more clear what the intended behavior/what a bug is.

The general outline would be from a users perspective the notifier should just give a single notification after it checks that the system update is staged after checking if the file exists in /run (the system module checks if the update is staged via a successful finishing of uupd or time based intervals) and no more notification for the session.

I'm curious how you tested this

For the testing I just made the modules and ran them in my aurora system and checked if they actually could push notifications and from my testing I found if first that notfier module was going in a loop after launching once as it was oneshot, later I added the RemainAfterExit=yes .

I'd recommend building a sysext with sysextbuddy (see readme) and then moving that to /var/lib/extensions.d so it survives updates/reboots so you can properly dog food this. Documentation is kinda meh in general regarding this.

I will try packaging into a system extension and make sure that extension can survive updates.

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.

2 participants