Skip to content

chore(notifications): deprecate legacy notification types for v2 removal - #1737

Merged
nicholas-fedor merged 1 commit into
mainfrom
chore/legacy-notifications-deprecation
Jun 4, 2026
Merged

chore(notifications): deprecate legacy notification types for v2 removal#1737
nicholas-fedor merged 1 commit into
mainfrom
chore/legacy-notifications-deprecation

Conversation

@nicholas-fedor

@nicholas-fedor nicholas-fedor commented Jun 4, 2026

Copy link
Copy Markdown
Owner

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

  • 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

Summary by CodeRabbit

  • Documentation
    • Added deprecation notices for legacy notification types (email, Slack, Microsoft Teams, Gotify) across configuration and notification documentation.
    • Updated notification documentation with migration guides directing users to use --notification-url with Shoutrrr URL schemes.
    • Updated help text to reflect deprecation of legacy notification flags; warnings now display when these options are used.

- 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
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This 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.

Changes

Legacy Notification Deprecation for Watchtower v2

Layer / File(s) Summary
User-facing deprecation guidance
docs/configuration/arguments/index.md, docs/notifications/overview/index.md
Documentation introduces top-level Watchtower v2 deprecation notices listing legacy notification services, updates flag/environment variable tables to mark legacy options as deprecated, and provides detailed migration examples converting legacy SMTP/Slack/Teams/Gotify configuration to Shoutrrr URL-based --notification-url/WATCHTOWER_NOTIFICATION_URL format with scheme-specific examples (smtp://, slack://, teams://, gotify://) and TLS/parameter guidance.
Go code deprecation doc comments
pkg/notifications/doc.go, pkg/notifications/email.go, pkg/notifications/slack.go, pkg/notifications/msteams.go, pkg/notifications/gotify.go, pkg/types/convertible_notifier.go
Legacy notification type constants, interfaces, constructors, and methods across all four legacy services annotated with Deprecated: doc comments, migration hints pointing to --notification-url with appropriate Shoutrrr schemes, and TODO markers for v2 removal.
Flag deprecation registration and runtime warnings
internal/flags/flags.go, pkg/notifications/notifier.go
Flag registration updated to mark legacy notification flags as deprecated via markFlagDeprecated helper (ensuring visibility in --help with migration hints), and runtime code switched from debug-level to logrus.Warn messages when legacy notification types are instantiated, guiding users toward URL-based configuration.
Test deprecation and TODO annotations
internal/flags/flags_test.go, pkg/notifications/notifier_test.go, pkg/notifications/shoutrrr_fuzz_test.go, pkg/notifications/shoutrrr_test.go
Legacy notification test cases, helpers, and fuzz tests annotated with //nolint:godox and TODO comments indicating removal when legacy types are removed, without changing test logic or assertions.
MkDocs extension configuration upgrade
build/mkdocs/mkdocs.yaml
Markdown extension configuration updated from pymdownx.details to pymdownx.blocks.details to enable proper rendering of collapsible detail blocks in deprecation notices.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • nicholas-fedor/watchtower#1251: Overlapping documentation updates for multi-service --notification-url configuration examples and Shoutrrr URL formatting guidance.
  • nicholas-fedor/watchtower#1718: Concurrent changes to internal/flags/flags.go for Microsoft Teams legacy notification flag handling within RegisterNotificationFlags.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main change: deprecating legacy notification types in preparation for v2 removal, which is the core objective across all modified files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            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              
Files with missing lines Coverage Δ
internal/flags/flags.go 86.56% <100.00%> (+0.35%) ⬆️
pkg/notifications/email.go 83.52% <ø> (ø)
pkg/notifications/gotify.go 70.96% <ø> (ø)
pkg/notifications/msteams.go 55.55% <ø> (ø)
pkg/notifications/notifier.go 89.79% <100.00%> (+0.98%) ⬆️
pkg/notifications/slack.go 90.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between c3cc6eb and 08bd360.

📒 Files selected for processing (15)
  • build/mkdocs/mkdocs.yaml
  • docs/configuration/arguments/index.md
  • docs/notifications/overview/index.md
  • internal/flags/flags.go
  • internal/flags/flags_test.go
  • pkg/notifications/doc.go
  • pkg/notifications/email.go
  • pkg/notifications/gotify.go
  • pkg/notifications/msteams.go
  • pkg/notifications/notifier.go
  • pkg/notifications/notifier_test.go
  • pkg/notifications/shoutrrr_fuzz_test.go
  • pkg/notifications/shoutrrr_test.go
  • pkg/notifications/slack.go
  • pkg/types/convertible_notifier.go

Comment on lines +275 to +277
!!! 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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.

Suggested change
!!! 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.

@nicholas-fedor
nicholas-fedor merged commit 558b9a6 into main Jun 4, 2026
21 of 23 checks passed
@nicholas-fedor
nicholas-fedor deleted the chore/legacy-notifications-deprecation branch June 4, 2026 23:50
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 6 medium

Alerts:
⚠ 6 issues (≤ 0 issues of at least minor severity)

Results:
6 new issues

Category Results
ErrorProne 6 medium

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

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.

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.

1 participant