Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .coverage
Binary file not shown.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ The used format is based on
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.5.40] - 2026-05-06

### 🐛 Bug Fixes

- _(notifiers)_ Resolve s-nail attachment error by using -M for MIME type
- _(notifiers)_ Ensure correct templates are used for all channels and improve
test dispatch

### ⚙️ Miscellaneous Tasks

- _(release)_ Bump version to 1.5.39

## [1.5.39] - 2026-05-06

### 🐛 Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

NAME := flatpak-automatic
EPOCH := 1
VERSION := 1.5.39
VERSION := 1.5.40
REL_NUM := 1
DATE := $(shell LC_ALL=C date +"%a %b %d %Y")
AUTHOR := "fedoraBee <9395414+fedoraBee@users.noreply.github.com>"
Expand Down
2 changes: 1 addition & 1 deletion assets/banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion config/sysconfig/flatpak-automatic
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Please migrate your settings to the new YAML format.
# ==============================================================================

# Version: 1.5.39 | Built for Fedora & Universal RPM Systems
# Version: 1.5.40 | Built for Fedora & Universal RPM Systems
# Built for Fedora & Universal RPM Systems

# --- [ Universal Notifications (Apprise) ] ---
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "flatpak-automatic"
version = "1.5.39"
version = "1.5.40"
authors = [
{ name = "fedoraBee", email = "9395414+fedoraBee@users.noreply.github.com" },
]
Expand Down
2 changes: 1 addition & 1 deletion src/flatpak-automatic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Version: 1.5.39
# Version: 1.5.40
import sys
import os

Expand Down
2 changes: 1 addition & 1 deletion src/flatpak_automatic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .updater import FlatpakUpdater

__version__ = "1.5.39"
__version__ = "1.5.40"

from .snapper import SnapperManager
from .config import ConfigManager, StateManager
Expand Down
2 changes: 1 addition & 1 deletion src/flatpak_automatic/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def banner() -> str:
f"{Colors.OKBLUE} | __| |__ _ | |_ _ __ __ _ | |__ \n"
f"{Colors.HEADER} | _|| / _` || ._| '_ \\/ _` || / / \n"
f"{Colors.OKPINK} |_| |_\\__,_|\\__|| .__/\\__,_||_\\_\\\n"
f" AUTOMATIC |_| {Colors.ENDC} {Colors.OKCYAN} v1.5.39{Colors.ENDC}\n"
f" AUTOMATIC |_| {Colors.ENDC} {Colors.OKCYAN} v1.5.40{Colors.ENDC}\n"
)


Expand Down
23 changes: 20 additions & 3 deletions src/flatpak_automatic/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,35 @@ def wipe_bytecode_cache(self) -> None:
def dispatch_test_notifications(self) -> None:
logging.info("Executing Test Notification dispatch...")
router = NotificationRouter(self.config)
test_body = (
hostname = socket.gethostname()

# 1. Success Test Notification
logging.info("Sending SUCCESS test notification...")
success_body = (
"org.mozilla.firefox 125.0.1\n"
"org.gnome.Calculator 46.0\n"
"org.freedesktop.Platform 23.08"
)
router.dispatch_all(
"[TEST] Flatpak Automatic",
test_body,
f"[TEST-SUCCESS] Flatpak Automatic - {hostname}",
success_body,
True,
update_count=3,
)

# 2. Failure Test Notification
logging.info("Sending FAILURE test notification...")
failure_body = (
"Error: Failed to fetch updates from remote 'flathub'\n"
"Error: Connection timed out after 30 seconds"
)
router.dispatch_all(
f"[TEST-FAILURE] Flatpak Automatic - {hostname}",
failure_body,
False,
update_count=0,
)

def print_status_overview(self) -> None:
from .notifiers import APPRISE_AVAILABLE, MailNotifier

Expand Down
16 changes: 10 additions & 6 deletions src/flatpak_automatic/notifiers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ def dispatch_all(
if not self.groups:
return

hostname = socket.gethostname()
context = {
"TITLE": title,
"BODY": body,
"STATUS": "SUCCESS" if success else "FAILED",
"DATE": datetime.now().strftime(DATE_FORMAT),
"HOSTNAME": socket.gethostname(),
"HOSTNAME": hostname,
"UPDATE_COUNT": str(update_count),
"UPDATE_LIST": body if success else "",
"LOG_OUTPUT": body if not success else "",
Expand All @@ -65,12 +66,15 @@ def _resolve(
field_name: str,
default_val: Any,
) -> Any:
# First, check if the specific plugin (target_cfg) has an override
target_val = (
target_cfg.get(field_name)
if target_cfg and field_name in target_cfg
else None
)
# Second, check if the group has a default
group_val = group_cfg.get(field_name)

state_key = "success" if success else "failure"

def get_state_val(v: Any) -> Any:
Expand Down Expand Up @@ -99,7 +103,7 @@ def get_state_val(v: Any) -> Any:
app_title = _resolve(group, apprise_cfg, "title", title)
app_title = app_title.replace(
"$UPDATE_COUNT", str(update_count)
).replace("$(hostname)", socket.gethostname())
).replace("$(hostname)", hostname)
app_tpl = _resolve(group, apprise_cfg, "body_template", "")
app_body = (
TemplateRenderer.render(app_tpl, context) if app_tpl else body
Expand Down Expand Up @@ -130,10 +134,10 @@ def get_state_val(v: Any) -> Any:
to_addrs = mails_cfg.get("to", [])
if isinstance(to_addrs, str):
to_addrs = [to_addrs]
from_addr = mails_cfg.get("from", f"bot@{socket.gethostname()}")
from_addr = mails_cfg.get("from", f"bot@{hostname}")
m_title = _resolve(group, mails_cfg, "title", title)
m_title = m_title.replace("$UPDATE_COUNT", str(update_count)).replace(
"$(hostname)", socket.gethostname()
"$(hostname)", hostname
)
m_tpl = _resolve(group, mails_cfg, "body_template", "")
m_body = TemplateRenderer.render(m_tpl, context) if m_tpl else body
Expand All @@ -149,7 +153,7 @@ def get_state_val(v: Any) -> Any:
secret = webhook_cfg.get("secret", "")
wh_title = _resolve(group, webhook_cfg, "title", title)
wh_title = wh_title.replace("$UPDATE_COUNT", str(update_count)).replace(
"$(hostname)", socket.gethostname()
"$(hostname)", hostname
)
wh_tpl = _resolve(group, webhook_cfg, "body_template", "")
wh_body = TemplateRenderer.render(wh_tpl, context) if wh_tpl else body
Expand All @@ -162,7 +166,7 @@ def get_state_val(v: Any) -> Any:
if desktop_cfg.get("enabled", True):
dt_title = _resolve(group, desktop_cfg, "title", title)
dt_title = dt_title.replace("$UPDATE_COUNT", str(update_count)).replace(
"$(hostname)", socket.gethostname()
"$(hostname)", hostname
)
dt_tpl = _resolve(group, desktop_cfg, "body_template", "")
dt_body = TemplateRenderer.render(dt_tpl, context) if dt_tpl else body
Expand Down
2 changes: 1 addition & 1 deletion tbump.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[version]
current = "1.5.39"
current = "1.5.40"
# Updated regex to support X.Y.Z and X.Y.Z-rc1 (or -beta, -alpha)
regex = '''
(?P<major>\d+)
Expand Down
Loading