Skip to content

notify: small prepation changes for retry on 429 mechanism - #5553

Open
SoloJacobs wants to merge 3 commits into
prometheus:mainfrom
SoloJacobs:prepare-429
Open

notify: small prepation changes for retry on 429 mechanism#5553
SoloJacobs wants to merge 3 commits into
prometheus:mainfrom
SoloJacobs:prepare-429

Conversation

@SoloJacobs

Copy link
Copy Markdown
Contributor

Some small changes, to prepare #5497

Which user-facing changes does this PR introduce?

NONE

`retry_stage.go` will ignore the retry, if the notification was
delivered successfully. This change is technically a change in
behaviour, since it affects the tracing attributes.

Signed-off-by: Solomon Jacobs <solomonjacobs@protonmail.com>
This part of our notification retry logic is especially tricky. Thus, I
used an httptest server to generate errors from the SDK. This allows to
safely make changes to `ErrorWithReason`.

Signed-off-by: Solomon Jacobs <solomonjacobs@protonmail.com>
This change simplifies the number errors handled by
`TestClassifyClientError`. No test coverage is lost, since
`TestNotifyWithInvalidTemplate` already covers the behaviour in
question.

Small change in behaviour: `template` errors are now always surfaced
before client errors.

Signed-off-by: Solomon Jacobs <solomonjacobs@protonmail.com>
@SoloJacobs
SoloJacobs requested a review from a team as a code owner September 10, 2026 21:10
@SoloJacobs SoloJacobs changed the title Prepare 429 notify: small prepation changes for retry on 429 mechanism Sep 10, 2026
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: eb5abc00-02bc-4dd4-8a15-9a7309c21ac1

📥 Commits

Reviewing files that changed from the base of the PR and between 18b78df and 5d63e9c.

📒 Files selected for processing (3)
  • notify/opsgenie/opsgenie.go
  • notify/sns/sns.go
  • notify/sns/sns_test.go

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

OpsGenie successful notifications no longer request retries. SNS resolves API URLs before client creation and centralizes error classification for client creation and publishing, with tests for status-specific retry behavior and failure reasons.

Changes

OpsGenie retry handling

Layer / File(s) Summary
Successful notification result
notify/opsgenie/opsgenie.go
Successful notifications now return false, nil instead of setting the retry flag.

SNS error classification

Layer / File(s) Summary
SNS endpoint and error classification
notify/sns/sns.go, notify/sns/sns_test.go
Notify resolves the API URL before client creation. Client and publish failures use dedicated classification methods that extract status codes, apply retrier decisions, and assign failure reasons. Tests cover client, authentication, rate-limit, server, redirect, and deserialization cases.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 5d63e

Successful OpsGenie notifications no longer request retries, while SNS resolves endpoints earlier and classifies failures by status. No current-head merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description states the preparation purpose and correctly marks the release notes as NONE. However, it omits most of the required checklist, including issue tracking, applicable bugfix and breaking… Complete the repository pull request template. Include the issue status, applicable bugfix and test confirmation, feature and performance checks, breaking-change confirmations, documentation status, sign-off status, best-practices confirmat…
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly identifies notification changes related to preparing retry handling for HTTP 429 responses. It follows the repository's area-prefix format, although it contains a minor spelling erro…
Full details: Description check

Explanation

The description states the preparation purpose and correctly marks the release notes as NONE. However, it omits most of the required checklist, including issue tracking, applicable bugfix and breaking-change confirmations, documentation status, and other required contribution checks.

Resolution

Complete the repository pull request template. Include the issue status, applicable bugfix and test confirmation, feature and performance checks, breaking-change confirmations, documentation status, sign-off status, best-practices confirmation, and the release-notes block.

  • Fix all pre-merge checks with AI
✨ 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.

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