chore(notifications): deprecate legacy notification types for v2 removal - #1737
Conversation
- Mark legacy email, slack, msteams, and gotify notifiers as deprecated with `Deprecated` doc comments and TODOs for v2 removal - Add `markFlagDeprecated` helper to flag legacy CLI flags with migration hints pointing to `--notification-url` - Add deprecation warnings in `AppendLegacyUrls` and `GetTemplateData` when legacy types are used - Update docs with deprecation notices, migration guidance, and a "Deprecated" column in the flags table - Add `//nolint:godox` TODO comments in tests referencing legacy code to track removal
📝 WalkthroughWalkthroughThis PR implements a comprehensive soft deprecation of legacy per-service notification options (email, Slack, Microsoft Teams, Gotify) across Watchtower's codebase. It adds deprecation notices to user documentation, marks legacy Go code with deprecation comments, registers flags as deprecated with visible migration hints, emits runtime warnings, and annotates tests for future removal. The MkDocs configuration is also updated to support the new documentation rendering. ChangesLegacy Notification Deprecation for Watchtower v2
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1737 +/- ##
==========================================
+ Coverage 74.41% 74.49% +0.08%
==========================================
Files 61 61
Lines 10188 10223 +35
==========================================
+ Hits 7581 7616 +35
Misses 2328 2328
Partials 279 279
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/notifications/overview/index.md`:
- Around line 275-277: Update the broken anchor in the warning block by
replacing the incorrect reference
"`#transitioning-from-legacy-email-notifications-to-shoutrrr`" with the correct
MkDocs-style slug "`#migrating_deprecated_smtp_notifications_to_shoutrrr_urls`" so
the link points to the "Migrating Deprecated SMTP Notifications to Shoutrrr
URLs" section; locate the warning text containing `--notification-url` in
docs/notifications/overview/index.md and change the anchor accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d2bae1a7-1795-42fc-b4ab-242a1b04f78a
📒 Files selected for processing (15)
build/mkdocs/mkdocs.yamldocs/configuration/arguments/index.mddocs/notifications/overview/index.mdinternal/flags/flags.gointernal/flags/flags_test.gopkg/notifications/doc.gopkg/notifications/email.gopkg/notifications/gotify.gopkg/notifications/msteams.gopkg/notifications/notifier.gopkg/notifications/notifier_test.gopkg/notifications/shoutrrr_fuzz_test.gopkg/notifications/shoutrrr_test.gopkg/notifications/slack.gopkg/types/convertible_notifier.go
| !!! Warning "Deprecated" | ||
| Legacy email notification flags (e.g., `--notification-email-from`, `--notification-email-to`, `--notification-email-server`) are **deprecated**. Use `--notification-url` with an `smtp://` URL instead. See [Transitioning from Legacy Email Notifications to Shoutrrr](#transitioning-from-legacy-email-notifications-to-shoutrrr) below. | ||
|
|
There was a problem hiding this comment.
Fix broken anchor link.
Line 276 references #transitioning-from-legacy-email-notifications-to-shoutrrr, but the actual section heading at line 625 is "Migrating Deprecated SMTP Notifications to Shoutrrr URLs". Based on this repository's MkDocs configuration (which uses underscores in anchor slugs), the correct anchor should be #migrating_deprecated_smtp_notifications_to_shoutrrr_urls.
🔗 Proposed fix
!!! Warning "Deprecated"
- Legacy email notification flags (e.g., `--notification-email-from`, `--notification-email-to`, `--notification-email-server`) are **deprecated**. Use `--notification-url` with an `smtp://` URL instead. See [Transitioning from Legacy Email Notifications to Shoutrrr](`#transitioning-from-legacy-email-notifications-to-shoutrrr`) below.
+ Legacy email notification flags (e.g., `--notification-email-from`, `--notification-email-to`, `--notification-email-server`) are **deprecated**. Use `--notification-url` with an `smtp://` URL instead. See [Migrating Deprecated SMTP Notifications to Shoutrrr URLs](`#migrating_deprecated_smtp_notifications_to_shoutrrr_urls`) below.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| !!! Warning "Deprecated" | |
| Legacy email notification flags (e.g., `--notification-email-from`, `--notification-email-to`, `--notification-email-server`) are **deprecated**. Use `--notification-url` with an `smtp://` URL instead. See [Transitioning from Legacy Email Notifications to Shoutrrr](#transitioning-from-legacy-email-notifications-to-shoutrrr) below. | |
| !!! Warning "Deprecated" | |
| Legacy email notification flags (e.g., `--notification-email-from`, `--notification-email-to`, `--notification-email-server`) are **deprecated**. Use `--notification-url` with an `smtp://` URL instead. See [Migrating Deprecated SMTP Notifications to Shoutrrr URLs](`#migrating_deprecated_smtp_notifications_to_shoutrrr_urls`) below. |
🧰 Tools
🪛 LanguageTool
[grammar] ~276-~276: Ensure spelling is correct
Context: ...m Legacy Email Notifications to Shoutrrr](#transitioning-from-legacy-email-notifications-to-shoutrrr) below. To send notifications via e-mail, use an...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🪛 markdownlint-cli2 (0.22.1)
[warning] 276-276: Link fragments should be valid
(MD051, link-fragments)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/notifications/overview/index.md` around lines 275 - 277, Update the
broken anchor in the warning block by replacing the incorrect reference
"`#transitioning-from-legacy-email-notifications-to-shoutrrr`" with the correct
MkDocs-style slug "`#migrating_deprecated_smtp_notifications_to_shoutrrr_urls`" so
the link points to the "Migrating Deprecated SMTP Notifications to Shoutrrr
URLs" section; locate the warning text containing `--notification-url` in
docs/notifications/overview/index.md and change the anchor accordingly.
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| ErrorProne | 6 medium |
🟢 Metrics 0 complexity · 0 duplication
Metric Results Complexity 0 Duplication 0
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.
This PR deprecates the legacy notification service implementation in preparation for Watchtower's v2 release.
Problem
Prior to the forking of Watchtower, it outgrew its notification implementation and the Shoutrrr notification library was split off and implemented as a more maintainable notifications service. The older configuration options were retained as legacy components in an attempt to maintain backwards compatibility; however, the prior maintainers never finished the process of deprecating and encouraging users to use the newer notification implementation.
Solution
Updated the documentation and added TODO and deprecation directives for the respective legacy components.
Watchtower v2 is not expected to be released for several months, so this should hopefully encourage anyone using the legacy/deprecated notification service configurations to migrate to using the Shoutrrr URL's.
The legacy-default template will be retained, as it's largely a defacto standard when not using the report-style template.
Changes
Deprecateddoc comments and TODOs for v2 removalmarkFlagDeprecatedhelper to flag legacy CLI flags with migration hints pointing to--notification-urlAppendLegacyUrlsandGetTemplateDatawhen legacy types are used//nolint:godoxTODO comments in tests referencing legacy code to track removalSummary by CodeRabbit
--notification-urlwith Shoutrrr URL schemes.