Skip to content

fix(config): fix regression in config merge - #5457

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

fix(config): fix regression in config merge#5457
TheMeier wants to merge 1 commit into
prometheus:mainfrom
TheMeier:config_merge_regression

Conversation

@TheMeier

Copy link
Copy Markdown
Contributor

Fixes: #5456

Pull Request Checklist

Please check all the applicable boxes.

Which user-facing changes does this PR introduce?

[BUGFIX] Config: correct merging of global configs for opsgenie, victorops and rocketchat notifiers

@TheMeier
TheMeier requested a review from a team as a code owner August 18, 2026 07:42
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Review 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: Pro Plus

Run ID: 6adbfa3a-112d-466e-9d57-7d5a142cd868

📥 Commits

Reviewing files that changed from the base of the PR and between a9c0eac and 7b5c1b6.

📒 Files selected for processing (1)
  • config/config.go

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


📝 Walkthrough

Walkthrough

Config.UnmarshalYAML now merges global settings into OpsGenie, VictorOps, and Rocket.Chat receivers without replacing local credentials. Receiver fields use imported notifier configuration types. Tests cover inline and file credential precedence.

Changes

Notifier configuration merge

Layer / File(s) Summary
Receiver defaulting and credential precedence
config/config.go
OpsGenie, VictorOps, and Rocket.Chat receivers inherit global settings only when receiver-level values are absent. Existing validation and URL normalization remain in place. Pushover, SNS, and Rocket.Chat receiver fields now use imported package types.
Credential precedence validation
config/config_test.go
Tests verify that local inline credentials override global file credentials, and local file credentials override global inline credentials. Rocket.Chat tests cover token and token ID fields.

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

Merge Risk: ⚪ Minimal · up to 7b5c1

This PR corrects configuration merging for several notifier integrations and includes regression tests; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR also changes Receiver field types for Pushover and SNS, which are unrelated to issue #5456's notifier merge fix. Remove the unrelated Pushover and SNS type changes, or document why they are required for the configuration merge fix.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the configuration regression fix and matches the pull request's primary change.
Description check ✅ Passed The description includes the linked issue, bugfix tests, sign-off, contribution checklist items, and release notes.
Linked Issues check ✅ Passed The changes fix global configuration merging for OpsGenie, VictorOps, and Rocket.Chat and add regression tests, satisfying issue #5456.
✨ 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.

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

Can we restrict this change to the lines, which are actually problematic? :-)

Comment thread config/config.go Outdated
}
ogc.HTTPConfig = cmp.Or(ogc.HTTPConfig, c.Global.HTTPConfig)
ogc.APIURL = cmp.Or(ogc.APIURL, c.Global.OpsGenieAPIURL)
if ogc.HTTPConfig == nil {

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.

This seems like a noop? I like cmp.Or.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, the revert is really not necessary for c.Global.HTTPConfig. Changed

@TheMeier
TheMeier force-pushed the config_merge_regression branch 2 times, most recently from 3cb39d5 to a9c0eac Compare August 19, 2026 14:02
Fixes: prometheus#5456

Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
@TheMeier
TheMeier force-pushed the config_merge_regression branch from a9c0eac to 7b5c1b6 Compare August 21, 2026 13:58
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.

regression in merging global notifier configs

2 participants