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: 7e86551a-bd21-4fd4-8b03-99069c567b9b

📥 Commits

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

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

Included review availability: Your plan provides up to 8 included reviews per hour; 6 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 inherit global settings only when receiver-level values are absent. Existing validation and URL normalization remain in place.
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 a9c0e

This change corrects configuration merging for several notifier integrations, with no actionable merge-blocking risk remaining beyond normal checks and review.

Possibly related PRs

🚥 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, which matches the primary changes.
Description check ✅ Passed The description identifies issue #5456, marks the bugfix tests, records sign-off, and includes appropriate release notes.
Linked Issues check ✅ Passed The changes correct global configuration merging for OpsGenie, VictorOps, and Rocket.Chat and add regression tests as required by [#5456].
Out of Scope Changes check ✅ Passed The changes are limited to notifier configuration merging and related regression tests, with no unrelated scope detected.
✨ 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 from 5ed6877 to 3cb39d5 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 3cb39d5 to a9c0eac Compare August 19, 2026 14: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.

regression in merging global notifier configs

2 participants