borg-backup-ui icon indicating copy to clipboard operation
borg-backup-ui copied to clipboard

Upgrade bundled Apprise from 1.12.0 to 1.13.1 and guard future breaking changes

Open borg-codex-bot opened this issue 4 months ago • 1 comments

Maintainer-approved scope for PR #510 (2026-09-13)

The implementation in PR #510 is limited to the Apprise 1.13.1 update, the necessary compatibility handling, dependency/license review and validation. This decision supersedes the full-provider expansion and release-automation requirements below for this PR.

  • Retain the existing base-package strategy: 137 available providers in 1.12.0 become 141 in 1.13.1. Five providers are added and NotificationAPI is replaced.
  • The old count of 137 was not the complete upstream provider set. Optional providers such as MQTT/XMPP were already unavailable without extra packages. The maintainer explicitly approved deferring those additional dependencies.
  • Preserve NotificationAPI profile metadata and secrets. Detect retired schemes when reading/validating/sending, show German/English reconfiguration guidance, and isolate delivery failures. Do not run a data migration or rewrite secrets.
  • The version update is being tested in the existing PR #510 alongside #507 and #511. Stable release approval still requires the maintainer's test.

Remaining work (keep this issue open after PR #510):

  • [ ] Assess and package optional provider dependencies separately, with Unraid Python/platform compatibility and license checks.
  • [ ] Add the scheduled/manual upstream release check and deduplicated tracking issues, using the required borg-codex-bot identity. Do not auto-update code.

Context

Borg Backup UI currently bundles and hash-pins Apprise 1.12.0 in plugin/apprise-requirements.lock. The package build installs this dependency only into the build tree and ships a deterministic vendor bundle. Unraid hosts must continue to run without runtime pip installation or dependency network access.

The current upstream release is Apprise 1.13.1, published on 2026-08-31:

  • Release 1.13.0: https://github.com/caronc/apprise/releases/tag/v1.13.0
  • Release 1.13.1: https://github.com/caronc/apprise/releases/tag/v1.13.1
  • PyPI metadata: https://pypi.org/project/apprise/1.13.1/
  • Full comparison: https://github.com/caronc/apprise/compare/v1.12.0...v1.13.1

The project should upgrade the bundled runtime from 1.12.0 to 1.13.1 next, while treating notification delivery and saved profile compatibility as user-visible behavior rather than as a lock-file-only maintenance change.

Verified upstream facts

  • Apprise 1.13.1 requires Python >=3.9, unchanged from 1.12.0 and compatible with the plugin's supported Python baseline.
  • Its direct base dependency declarations are unchanged from 1.12.0: requests, requests-oauthlib, click>=5.0, markdown, PyYAML, and certifi (plus tzdata on Windows).
  • The published 1.13.1 wheel SHA256 is 2ded6d00562dd2ae9eb6f1e6cc8d3fb66e06f7ede6efac0ad029031b633780f4. The generated lock must independently verify this value and all transitive hashes instead of copying only this one hash manually.
  • Upstream identifies 1.13.1 as the final planned Apprise 1.x release and explicitly warns that 2.x will introduce breaking changes.
  • 1.13.0 and 1.13.1 add Pinglet, Trigv, Pingram, Signalgrid, and Lauther.
  • The current bundled Apprise 1.12.0 runtime reports 137 providers in Borg Backup UI. Full provider coverage is an intentional product requirement and is the compatibility baseline for this upgrade.
  • NotificationAPI was retired and replaced by Pingram. Apprise 1.12.0 registered napi:// and notificationapi://; 1.13.1 registers pingram:// and uses a different API-key format.
  • URL parsing now rejects malformed authority content by returning None. This may make generic URL validation stricter and must not surface as an unhandled exception.
  • Relevant provider fixes include Microsoft Workflows routing, Matrix message splitting, Telegram rich messages, Pingram JWT-style keys, Bark AES-GCM, and in-memory attachment stability.

Compatibility and breaking-change policy

Apprise 1.13.1 upgrade

No general upstream breaking change is declared for 1.13.1, but the NotificationAPI-to-Pingram replacement is a concrete compatibility break for saved profiles using the old URL schemes.

Before release, the implementation must determine how Borg Backup UI handles existing profiles whose secret URL starts with napi:// or notificationapi://:

  • Detect affected profiles without logging or exposing the stored URL, credentials, recipients, or tokens.
  • Do not silently rewrite old credentials to pingram://; the service and key model changed and a safe automatic conversion is not established.
  • Preserve profile metadata and secret files.
  • Show an actionable, bilingual warning that NotificationAPI was retired and the profile must be reconfigured for Pingram or another provider.
  • Ensure a failed affected profile cannot prevent other notification channels or profiles from being processed.
  • Cover the selected behavior with upgrade and regression tests.

The pull request must document the final compatibility decision. If safe handling requires a migration, it must follow the repository migration contract, be idempotent, audit its actions without secrets, and never discard the original profile secret.

Future Apprise 2.x

Apprise 2.x is explicitly out of scope for this dependency update. The exact hash pin already prevents an accidental major upgrade. The release-check automation must classify a detected 2.x release as a separate compatibility and API migration task, not as a routine dependency bump or automatic pull request.

Implementation scope

1. Update the deterministic vendor dependency

  • Change the Apprise pin from 1.12.0 to 1.13.1.
  • Regenerate the complete hash-pinned lock in a clean build environment.
  • Review every transitive dependency version and license; do not assume that unchanged direct requirements produce an unchanged resolved lock.
  • Keep --only-binary=:all: and --require-hashes packaging behavior.
  • Update version assertions in tests/test_apprise_packaging.py.
  • Update Apprise and transitive dependency versions in runtime/licenses/THIRD-PARTY-NOTICES.md and refresh license files only when the shipped distributions require it.
  • Build the deterministic vendor archive and verify that apprise-vendor.json reports 1.13.1 and the correct archive SHA256.
  • Verify that an existing 1.12.0 vendor marker causes the installer to extract the new bundle exactly once and that a repeated install remains idempotent.

2. Validate the Borg Backup UI adapter contract

Run compatibility tests against the real bundled Apprise 1.13.1 runtime for every API surface used by runtime/lib/apprise_adapter.py:

  • import only from runtime/vendor, never from host site-packages
  • Apprise().details() provider discovery
  • schema, template, and token metadata extraction
  • Apprise().add(url) validation
  • Apprise().notify(title=..., body=...) delivery result handling
  • timeout handling and sanitized errors

Provider counts and ordering should not be hard-coded unless the assertion is purposefully version-bound. Tests should focus on required metadata contracts and stable provider identities.

3. Preserve complete provider support

Borg Backup UI intentionally supports the complete provider set exposed by its bundled Apprise runtime. The current 1.12.0 integration reports 137 providers. The 1.13.1 upgrade must preserve that product contract and add all provider modules introduced by the target Apprise release.

  • Build and compare complete 1.12.0 and 1.13.1 provider/schema inventories.
  • Record the exact expected provider count for the final 1.13.1 vendor bundle in the pull request and automated test evidence.
  • Do not hide or silently drop providers because they require an optional dependency.
  • Determine the complete dependency set required by Apprise 1.13.1, including provider dependencies declared through the upstream all-plugins extra.
  • Add all dependencies required for complete provider support to the exact, hash-pinned vendor lock and include their license notices.
  • Verify that every provider module in the shipped Apprise 1.13.1 runtime can be imported and discovered without a missing-dependency failure.
  • Verify that the dynamic provider selector and URL-form generator can represent the complete discovered provider set.
  • Keep the generic Apprise URL fallback working across the complete bundled provider set.
  • Document additions, removals, replacements, and renamed schemes. The upstream removal of NotificationAPI and its replacement by Pingram must use the safe compatibility handling defined above.
  • A provider count below the current baseline of 137, or any provider module that cannot load in the packaged Unraid runtime, blocks release unless the maintainer explicitly revises the full-support product decision.

Real external delivery cannot be exercised against every service without user credentials. Automated coverage must therefore combine full import/discovery and metadata validation for every provider with focused delivery smoke tests for each relevant dependency or transport family.

4. Regression-test saved profiles and delivery

  • Load existing profile metadata and write-only URL secrets without modifying them merely because the runtime version changed.
  • Test representative saved URLs for ntfy and at least one non-ntfy provider.
  • Test a generic webhook-style provider through a local or mocked endpoint so the automated suite does not require external credentials or services.
  • Test malformed authority URLs and confirm a controlled validation error.
  • Test the NotificationAPI/Pingram compatibility behavior described above.
  • Verify profile create, edit, duplicate, enable/disable, validate, test-send, and delete flows.
  • Verify queued delivery, retry/backoff, restart continuation, sanitized status, and isolation between failing and successful profiles.
  • Confirm that Unraid notifications and native email delivery are unaffected.
  • Never place real provider credentials or destination URLs in fixtures, logs, support bundles, build artifacts, or test output.

5. Add release visibility without automatic updates

  • Add a scheduled and manually triggerable GitHub workflow that compares the exact version in plugin/apprise-requirements.lock with upstream package metadata.
  • Create or update one tracking issue when a newer version exists.
  • Avoid duplicate issues for the same target version.
  • Distinguish patch/minor 1.x updates from a 2.x major migration.
  • Never modify the lock, create an update pull request, or install a dependency automatically.

6. Documentation and release communication

  • Add a user-visible release-note fragment for the Apprise 1.13.1 update.
  • Document the complete Apprise 1.13.1 provider set offered by the shipped bundle, including new and replaced providers.
  • Explicitly mention the NotificationAPI/Pingram compatibility action if an existing user can be affected.
  • Update German and English notification documentation where provider names, requirements, validation behavior, or migration guidance changed.
  • Do not describe Apprise 2.x as compatible until a separate migration issue is completed.

Acceptance criteria

  • The bundled and packaged Apprise runtime reports exactly 1.13.1.
  • The complete dependency lock is exact and hash-pinned; no runtime pip or Unraid-side dependency download is introduced.
  • License notices match every shipped dependency version.
  • Build, package, vendor metadata, archive SHA256, extraction, reinstall, and idempotency tests pass.
  • Provider discovery and dynamic URL-form generation work with the real 1.13.1 metadata.
  • Existing supported profiles remain usable or receive explicit, safe guidance for a confirmed upstream incompatibility.
  • napi:// and notificationapi:// profiles are detected without exposing secrets and are not silently converted.
  • Malformed URLs fail safely and do not interrupt the application or other notification channels.
  • Unraid, email, synchronous Apprise test delivery, and queued Apprise event delivery pass focused regression tests.
  • The packaged runtime preserves the complete provider-support contract, does not regress below the current 137-provider baseline, and includes all provider dependencies and license notices required by Apprise 1.13.1.
  • The version-check workflow reports future updates without changing code and routes Apprise 2.x to a separate breaking-change assessment.
  • A test-channel package is built and manually verified on Unraid before stable promotion.

Manual Unraid verification

  • Upgrade a test installation that already contains at least one enabled Apprise profile and confirm that metadata and secrets remain present.
  • Open Settings > Notifications, verify the expected Apprise 1.13.1 provider count, and verify provider discovery and URL-form rendering.
  • Validate and test-send through ntfy and one additional available provider.
  • Trigger a queued backup or restore-test event and confirm delivery status.
  • Restart Borg Backup UI with a queued entry and confirm safe continuation.
  • Exercise an affected legacy NotificationAPI profile fixture and verify the selected warning/reconfiguration path.
  • Reinstall the same test-channel version and confirm that the unchanged vendor bundle is not extracted again.

Out of scope

  • Upgrading to Apprise 2.x
  • Automatically converting third-party credentials or destinations
  • Installing Apprise or optional providers at runtime on Unraid
  • Reducing the intentional full-provider-support scope without a separate maintainer decision

borg-codex-bot avatar Jul 21 '26 16:07 borg-codex-bot

This is no longer considered a beta blocker. The bundled Apprise version is pinned and can be checked manually for the beta candidate; the automated tracking workflow can be implemented in parallel during beta if needed.

borg-codex-bot avatar Jul 24 '26 12:07 borg-codex-bot