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

Fixes: prometheus#5456

Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
@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: 6031ae0c-40d0-4331-9a25-00e16a9d9958

📥 Commits

Reviewing files that changed from the base of the PR and between ee6b5f4 and 5ed6877.

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

Included review availability: Your plan includes up to 8 reviews per rolling 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. 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 now apply global HTTP and API settings. Global credentials apply only when receiver-level credentials are absent.
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 5ed68

This localized bug fix corrects config merging for affected notifier integrations and includes regression tests; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies a configuration merge regression fix, matching the primary changes in the pull request.
Description check ✅ Passed The description identifies issue #5456, marks the bugfix tests, includes sign-off information, and provides a release note.
Linked Issues check ✅ Passed The changes correct global configuration merging for OpsGenie, VictorOps, and Rocket.Chat, and add tests for credential precedence as required by #5456.
Out of Scope Changes check ✅ Passed All changes are limited to notifier configuration merging and regression tests for the linked issue objectives.
✨ 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
}
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.

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