Skip to content

refactor(pushover): move configuration types into pushover package - #5383

Open
TheMeier wants to merge 1 commit into
prometheus:mainfrom
TheMeier:pushover_config
Open

refactor(pushover): move configuration types into pushover package#5383
TheMeier wants to merge 1 commit into
prometheus:mainfrom
TheMeier:pushover_config

Conversation

@TheMeier

Copy link
Copy Markdown
Contributor

Pull Request Checklist

Which user-facing changes does this PR introduce?

NONE

@TheMeier
TheMeier requested a review from a team as a code owner July 14, 2026 17:46
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ca3c636f-042f-4145-bbfc-fd9b464a3b26

📥 Commits

Reviewing files that changed from the base of the PR and between 5421255 and 7c93080.

📒 Files selected for processing (7)
  • config/config.go
  • config/notifiers.go
  • config/notifiers_test.go
  • notify/pushover/config.go
  • notify/pushover/config_test.go
  • notify/pushover/pushover.go
  • notify/pushover/pushover_test.go
💤 Files with no reviewable changes (2)
  • config/notifiers.go
  • config/notifiers_test.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • config/config.go
  • notify/pushover/pushover_test.go
  • notify/pushover/pushover.go
  • notify/pushover/config_test.go

📝 Walkthrough

Walkthrough

Pushover configuration moves into notify/pushover, including defaults, duration handling, and YAML validation. Receiver and notifier APIs now use the relocated type. Related tests are moved or updated.

Changes

Pushover configuration migration

Layer / File(s) Summary
Move Pushover configuration schema
notify/pushover/config.go, notify/pushover/config_test.go, config/notifiers.go
Adds Pushover defaults, fields, duration parsing, YAML validation, and validation tests under notify/pushover; removes the former configuration definitions.
Wire receiver and notifier types
config/config.go, notify/pushover/pushover.go, notify/pushover/pushover_test.go
Updates receiver configuration and notifier construction to use pushover.PushoverConfig, and adjusts notifier tests to instantiate the local type.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes release notes and two confirmations, but it leaves most required checklist items unanswered. Complete the applicable checklist items and state why unchecked sections do not apply, including tests, documentation, breaking changes, and issue tracking.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary change: moving Pushover configuration types into the pushover package.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
notify/pushover/config_test.go (1)

31-36: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Refactor manual error assertions to use testify/require.

As per coding guidelines, Go tests should leverage github.com/stretchr/testify/require for assertions. Replacing these manual checks with require.EqualError(t, err, expected) reduces boilerplate and improves readability. Ensure you also add "github.com/stretchr/testify/require" to the file's imports.

  • notify/pushover/config_test.go#L31-L36: Replace the manual error checks with require.EqualError(t, err, expected).
  • notify/pushover/config_test.go#L49-L54: Replace the manual error checks with require.EqualError(t, err, expected).
  • notify/pushover/config_test.go#L67-L72: Replace the manual error checks with require.EqualError(t, err, expected).
  • notify/pushover/config_test.go#L86-L91: Replace the manual error checks with require.EqualError(t, err, expected).
  • notify/pushover/config_test.go#L106-L111: Replace the manual error checks with require.EqualError(t, err, expected).
🤖 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 `@notify/pushover/config_test.go` around lines 31 - 36, Replace the manual
error assertions with require.EqualError(t, err, expected) at
notify/pushover/config_test.go lines 31-36, 49-54, 67-72, 86-91, and 106-111,
and add the github.com/stretchr/testify/require import.

Source: Coding guidelines

notify/pushover/config.go (1)

53-53: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add a godoc comment for the exported type.

As per coding guidelines, exported identifiers should be documented with a full sentence ending in a period. Please consider adding a comment for PushoverConfig.

📝 Proposed comment
+// PushoverConfig configures notifications via Pushover.
 type PushoverConfig struct {
🤖 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 `@notify/pushover/config.go` at line 53, Add a GoDoc comment immediately before
the exported PushoverConfig type declaration, starting with “PushoverConfig” and
ending with a period, describing the configuration it represents.

Source: Coding guidelines

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

Nitpick comments:
In `@notify/pushover/config_test.go`:
- Around line 31-36: Replace the manual error assertions with
require.EqualError(t, err, expected) at notify/pushover/config_test.go lines
31-36, 49-54, 67-72, 86-91, and 106-111, and add the
github.com/stretchr/testify/require import.

In `@notify/pushover/config.go`:
- Line 53: Add a GoDoc comment immediately before the exported PushoverConfig
type declaration, starting with “PushoverConfig” and ending with a period,
describing the configuration it represents.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e77945ce-bff7-41c0-94f3-ddf4b726d4a1

📥 Commits

Reviewing files that changed from the base of the PR and between 3d96a34 and dc5ac8e.

📒 Files selected for processing (7)
  • config/config.go
  • config/notifiers.go
  • config/notifiers_test.go
  • notify/pushover/config.go
  • notify/pushover/config_test.go
  • notify/pushover/pushover.go
  • notify/pushover/pushover_test.go
💤 Files with no reviewable changes (2)
  • config/notifiers.go
  • config/notifiers_test.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@notify/pushover/config.go`:
- Around line 53-54: Add a Go documentation comment immediately before the
exported PushoverConfig type declaration, beginning with “PushoverConfig” and
forming a complete sentence ending with a period to satisfy the godot lint
requirement.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f19bbfd1-66ad-46a5-bfd4-bd9f4fb5e619

📥 Commits

Reviewing files that changed from the base of the PR and between 3a84e4b and 2a573da.

📒 Files selected for processing (7)
  • config/config.go
  • config/notifiers.go
  • config/notifiers_test.go
  • notify/pushover/config.go
  • notify/pushover/config_test.go
  • notify/pushover/pushover.go
  • notify/pushover/pushover_test.go
💤 Files with no reviewable changes (2)
  • config/notifiers_test.go
  • config/notifiers.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • notify/pushover/pushover.go
  • notify/pushover/pushover_test.go
  • notify/pushover/config_test.go
  • config/config.go

Comment thread notify/pushover/config.go
Comment on lines +53 to +54
type PushoverConfig struct {
amcommoncfg.NotifierConfig `yaml:",inline" json:",inline"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add documentation comment for exported type.

The exported type PushoverConfig lacks a documentation comment. As per the coding guidelines, exported identifiers must have a comment that is a full sentence ending with a period (enforced by godot lint).

📝 Proposed fix
+// PushoverConfig configures notifications via Pushover.
 type PushoverConfig struct {
 	amcommoncfg.NotifierConfig `yaml:",inline" json:",inline"`
📝 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
type PushoverConfig struct {
amcommoncfg.NotifierConfig `yaml:",inline" json:",inline"`
// PushoverConfig configures notifications via Pushover.
type PushoverConfig struct {
amcommoncfg.NotifierConfig `yaml:",inline" json:",inline"`
🤖 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 `@notify/pushover/config.go` around lines 53 - 54, Add a Go documentation
comment immediately before the exported PushoverConfig type declaration,
beginning with “PushoverConfig” and forming a complete sentence ending with a
period to satisfy the godot lint requirement.

Source: Coding guidelines

Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
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