Skip to content

Set firing to toJson#587

Draft
AlexSmithGH wants to merge 1 commit into
openshift:masterfrom
AlexSmithGH:set-firing-to-json
Draft

Set firing to toJson#587
AlexSmithGH wants to merge 1 commit into
openshift:masterfrom
AlexSmithGH:set-firing-to-json

Conversation

@AlexSmithGH

@AlexSmithGH AlexSmithGH commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved PagerDuty alert details so notifications now include firing alerts in a structured format and render resolved alerts more consistently.
    • Alert counts for firing and resolved incidents continue to display as expected.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 9, 2026
@openshift-ci

openshift-ci Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Walkthrough

The PagerDuty configuration's detailsMap in createPagerdutyConfig was updated to include a JSON-rendered firing field and to change the resolved field from a templated instance string to JSON-rendered Alerts.Resolved data, while num_firing and num_resolved counts remain unchanged.

Changes

PagerDuty Details Payload

Layer / File(s) Summary
Update detailsMap fields
controllers/secret_controller.go
Adds a JSON-rendered firing field and changes resolved from the pagerduty.default.instances template output to JSON-rendered Alerts.Resolved, keeping num_firing/num_resolved counts unchanged.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and matches the main change of rendering the firing field as JSON.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
Stable And Deterministic Test Names ✅ Passed PR changes only controller code; no test files or Ginkgo titles were added or modified.
Test Structure And Quality ✅ Passed The PR only changes controllers/secret_controller.go; no Ginkgo tests were added or modified, so this test-quality check is not applicable.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR only changes controller PagerDuty template data in controllers/secret_controller.go.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Only controllers/secret_controller.go changed; no Ginkgo/e2e tests were added, so SNO compatibility review is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed Only PagerDuty details templating changed in secret_controller.go; no deployment, replica, affinity, or node selection logic was modified.
Ote Binary Stdout Contract ✅ Passed The PR only changes controller template data in package controllers; it adds no stdout writes in main/init/TestMain/suite setup paths.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo/e2e tests were added; the only change is a PagerDuty details template, with no IPv4 or external connectivity assumptions.
No-Weak-Crypto ✅ Passed Only PagerDuty template-data strings changed; no crypto primitives, custom crypto, or secret comparisons were added.
Container-Privileges ✅ Passed PR only changes PagerDuty template data in secret_controller.go; no privileged, hostPID/Network/IPC, SYS_ADMIN, or allowPrivilegeEscalation changes appear.
No-Sensitive-Data-In-Logs ✅ Passed The patch only changes PagerDuty template fields; no active logging of secrets, tokens, PII, or alert payloads was added.
✨ 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.

@openshift-ci

openshift-ci Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: AlexSmithGH
Once this PR has been reviewed and has the lgtm label, please assign anispate for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@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 (1)
controllers/secret_controller.go (1)

584-587: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add PagerDuty details assertions controllers/secret_controller_test.go:206-265 — the receiver tests cover routing key, severity, proxy, and send-resolved, but not PagerdutyConfig.Details; add checks for firing and resolved so template regressions are caught.

🤖 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 `@controllers/secret_controller.go` around lines 584 - 587, The receiver tests
in SecretController should also validate PagerdutyConfig.Details, since the
template now exposes firing and resolved alert payloads. Update the relevant
assertions in secret_controller_test.go around the existing PagerDuty receiver
checks to verify the details map includes the firing and resolved template
entries, alongside the current routing key, severity, proxy, and send-resolved
assertions.
🤖 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 `@controllers/secret_controller.go`:
- Around line 584-587: The receiver tests in SecretController should also
validate PagerdutyConfig.Details, since the template now exposes firing and
resolved alert payloads. Update the relevant assertions in
secret_controller_test.go around the existing PagerDuty receiver checks to
verify the details map includes the firing and resolved template entries,
alongside the current routing key, severity, proxy, and send-resolved
assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 150b4b9e-ff02-447e-a5b4-ea47eaa0442b

📥 Commits

Reviewing files that changed from the base of the PR and between 95b8d9a and ad216e0.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant