Skip to content

refactor(notification)!: move notification to its own module, notifications - #282

Merged
sthanikan2000 merged 1 commit into
mainfrom
refactor/notifications-module
Oct 6, 2026
Merged

sthanikan2000 merged 1 commit into
mainfrom
refactor/notifications-module

Conversation

@sthanikan2000

@sthanikan2000 sthanikan2000 commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Moves notification out of core's root module into its own Go module, github.com/OpenNSW/core/notifications, as was done for storage in #159.

No behavior changes.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Other (please describe):

Changes Made

  • git mv notification notifications. Every file is recorded as a rename, so history follows.
  • The package keeps its name, notification. Only the import path changes; code keeps using notification.X. Go allows a package name that differs from its path. The repo's formatter (goimports, run by the pre-commit hook and CI) writes such imports with the name spelled out: notification "github.com/OpenNSW/core/notifications".
  • The only code changes are four import lines, in providers/email.go, providers/sms.go and the integration test. Every other Go file is identical to main.
  • New notifications/go.mod: go 1.26, requiring remote v0.8.0 and secret v0.2.0, the package's only dependencies. Nothing else in core imports it.
  • Root go.mod: after go mod tidy, secret becomes indirect, since only notification used it directly.
  • .github/workflows/ci.yml: a Notifications Module job, copied from storage-module. .github/dependabot.yml: "/notifications".
  • READMEs: the package README notes the move, and the root table row and architecture diagram use the new name.

Testing

  • I have tested this change locally

  • I have added tests that prove my fix is effective or that my feature works

  • I have tested edge cases

  • All existing tests pass

  • notifications: go mod tidy, go vet ./..., go test -race ./... pass.

  • Root: go mod tidy, go build ./..., go vet ./..., go test ./... pass; the root no longer has notification's two packages.

  • No code anywhere references github.com/OpenNSW/core/notification.

  • The pre-commit hooks passed, including the go mod tidy check.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have checked that there are no merge conflicts

Related Issues

Prerequisite for #281.

Screenshots/Demo

N/A

Additional Notes

Breaking: import notification "github.com/OpenNSW/core/notifications" instead of "github.com/OpenNSW/core/notification". The package name and API are unchanged.

Release:

  • No tag yet. fix(notifications)!: take each provider's config as a typed struct #281 (stacked on this PR) fixes the notification settings bug. The first tag, notifications/v0.1.0, goes on the result once both merge, so the first published API already includes the fix.
  • nsw-srilanka then requires notifications/v0.1.0 next to its current root pin, without bumping the root module, and changes only its 7 import lines.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5fad458c-df1a-4bae-9824-19ff58dc6c4a
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@sthanikan2000
sthanikan2000 added this pull request to stack #283 October 6, 2026 11:40
@sthanikan2000
sthanikan2000 force-pushed the refactor/notifications-module branch 2 times, most recently from 46e78b6 to 1b14f6a Compare October 6, 2026 11:53
…ations

notification lived in core's root module. A fix to it could only reach
a consumer through a bump of the whole root module, which today also
brings workflow's breaking changes. It is now the independent module
github.com/OpenNSW/core/notifications, versioned on its own like storage
(#159).

The module takes a new path rather than keeping
github.com/OpenNSW/core/notification. A consumer pinned to a root-module
version that still contains notification/ would otherwise see the same
import path in two modules and fail with an ambiguous import, so it
could not adopt the module without that root bump. Under a new path it
can require the module beside its existing root pin.

The package keeps its name, notification, so a consumer changes only
its import path and keeps using notification.X. goimports writes the
import with the name spelled out, since it differs from the path. Only remote and secret
are dependencies, nothing else in core imports it, and its behavior is
unchanged. CI gets a Notifications Module job, and dependabot watches the
new directory.

BREAKING CHANGE: import notification "github.com/OpenNSW/core/notifications"
instead of "github.com/OpenNSW/core/notification". The package name and
API are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sthanikan2000
sthanikan2000 force-pushed the refactor/notifications-module branch from 1b14f6a to 4054392 Compare October 6, 2026 11:53

@mushrafmim mushrafmim 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.

LGTM!

@sthanikan2000
sthanikan2000 marked this pull request as ready for review October 6, 2026 12:01
@sthanikan2000
sthanikan2000 merged commit 8118b2a into main Oct 6, 2026
26 checks passed
@sthanikan2000
sthanikan2000 deleted the refactor/notifications-module branch October 6, 2026 12:02
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