Add jsmops (JSM Ops) notifier as Opsgenie migration target#5373
Add jsmops (JSM Ops) notifier as Opsgenie migration target#5373jothimanikrish wants to merge 3 commits into
Conversation
Implement a new notify/jsmops/ package targeting the Jira Service Management Operations REST API. This is the supported migration path for the deprecated Opsgenie notifier (EOL April 2027). Key differences from opsgenie: - Auth delegated to http_config (no api_key fields) - Required cloud_id per receiver config - URLs built via APIURL.JoinPath(cloudID, "v1", "alerts", ...) - Update requests use PATCH (per JSM Ops OpenAPI spec) Includes: - Full notifier implementation with create/close/update lifecycle - Config schema, global defaults, per-receiver defaulting - Integration registration in config/receiver - Default templates (jsmops.default.message/description/source) - Comprehensive test suite mirroring opsgenie patterns - Documentation in docs/configuration.md and CHANGELOG.md Signed-off-by: jothimanikrish <jothimanikrish@hotmail.com>
35db0b9 to
4c8cf0f
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThis PR adds a new ChangesJSM Ops receiver integration
Estimated code review effort: 3 (Moderate) | ~30 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
notify/jsmops/config_test.go (1)
29-40: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd assertion that responder
Typeis normalized after parsing.This case exercises mixed-case types ("scheDule", "teams", "USER") but only checks
require.NoError. It doesn't assert that the parsed config actually stores the lowercased value, which is why the range-copy bug innotify/jsmops/config.go(see review comment there) went unnoticed.require.NoError(t, err) require.Equal(t, "schedule", cfg.Responders[0].Type) require.Equal(t, "teams", cfg.Responders[1].Type) require.Equal(t, "user", cfg.Responders[2].Type)🤖 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 `@notify/jsmops/config_test.go` around lines 29 - 40, The “valid configuration” test only checks that parsing succeeds, so it misses whether responder types are actually normalized. In config_test.go, update the test that exercises mixed-case responder types to assert the parsed cfg.Responders entries have lowercased Type values after parsing, using the cfg.Responders slice and its Type field to verify schedule, teams, and user normalization.
🤖 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.
Inline comments:
In `@notify/jsmops/config.go`:
- Around line 80-95: The responder type normalization in the jsmOps config
validation is only applied to the loop copy, so mixed-case types are not
persisted back into the config. Update the responder validation logic in the
c.Responders loop to iterate by index and assign the lowercased value back into
c.Responders[i].Type after the ContainsTemplating check, while preserving the
existing validation using jsmopsTypeMatcher and jsmopsValidTypesRe.
In `@notify/jsmops/jsmops.go`:
- Around line 182-210: The responder filtering in jsmOps message creation is too
weak because it only skips fully empty jsmOpsCreateMessageResponder values,
allowing identifier-less responders through when only Type is populated. Update
the responder-building loop in the JSM Ops message creation logic to reject
responders that do not have at least one valid identifier field (ID, Name, or
Username) after templating, while still preserving the special teams-to-team
expansion path. Keep the check close to the existing responder construction so
malformed responders are filtered before appending to responders.
---
Nitpick comments:
In `@notify/jsmops/config_test.go`:
- Around line 29-40: The “valid configuration” test only checks that parsing
succeeds, so it misses whether responder types are actually normalized. In
config_test.go, update the test that exercises mixed-case responder types to
assert the parsed cfg.Responders entries have lowercased Type values after
parsing, using the cfg.Responders slice and its Type field to verify schedule,
teams, and user normalization.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 4db83b0a-d437-41d5-b861-7e9675fbb245
📒 Files selected for processing (11)
CHANGELOG.mdconfig/config.goconfig/config_test.goconfig/receiver/receiver.goconfig/testdata/conf.jsmops-default-apiurl.ymldocs/configuration.mdnotify/jsmops/config.gonotify/jsmops/config_test.gonotify/jsmops/jsmops.gonotify/jsmops/jsmops_test.gotemplate/default.tmpl
- Iterate responders by index so strings.ToLower persists the normalized type back into the config struct. Previously the range-copy meant mixed-case types like "Teams" passed validation but failed the == "teams" check at notification time. - Add a post-templating guard that skips responders whose identifier fields (ID, Name, Username) all evaluated to empty strings, preventing type-only responders from reaching the API. Signed-off-by: jothimanikrish <jothimanikrish@hotmail.com>
|
Context: Atlassian is officially retiring Opsgenie and folding its on-call and alerting features directly into Jira Service Management (JSM) Premium and Enterprise tiers. Opsgenie reaches its full end-of-support on April 5, 2027 However I wonder if JSM Ops only provides the opsgenie compatible API or if there other options, maybe even usable with the webhook notifier . Eg this https://developer.atlassian.com/cloud/jira/service-desk-ops/rest/v2/api-group-alerts/#api-api-cloudid-v1-alerts-post ? |
Pull Request Checklist
Please check all the applicable boxes.
Please list all open issue(s) discussed with maintainers related to this change
Is this a new Receiver integration?
Is this a bugfix?
Is this a new feature?
Does this change affect performance?
I have provided benchmarks comparison that shows performance is improved or is not degraded
I have added new benchmarks if required or requested by maintainers
Is this a breaking change?
My changes do not break the existing cluster messages
My changes do not break the existing api
I have added/updated the required documentation
I have signed-off my commits
I will follow best practices for contributing to this project
Which user-facing changes does this PR introduce?