feat: Add a new Jira integration for alertmanager
Description
Add a new JIRA integration for alertmanager.
Relate #7285 Co-author @dongjiang1989
Type of change
What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.
- [ ]
CHANGE(fix or feature that would cause existing functionality to not work as expected) - [x]
FEATURE(non-breaking change which adds functionality) - [ ]
BUGFIX(non-breaking change which fixes an issue) - [ ]
ENHANCEMENT(non-breaking change which improves existing functionality) - [ ]
NONE(if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)
Verification
E2E Test Cases
Changelog entry
- Add a new JIRA integration for alertmanager
@heliapb any comments?
@simonpasquier Can you help review this PR as well?
@heliapb I tried checking myself with Alertmanager. It requires either api_url in jira_configs or jira_api_url global config to be set up. I updated the test cases to match the scenario. Please review. Thank you!
@heliapb Anything you can suggest?
Hi @nutmos I think since we are adding the new jira integration it might be good to add https://github.com/prometheus/alertmanager/pull/4542/files that is part of the new Alertmanager release as theres was a deprecation on Jira API that seems to render the current implementation with issues. Is part of the pre release https://github.com/prometheus/alertmanager/releases but you can already add it to required the v0.29.0.
@heliapb As suggested, I added API Type in the Jira config with the condition of Alertmanager >= 0.29.0.
@nutmos the unit tests are failing now after your change
-- FAIL: TestSanitizeJiraConfig (0.00s)
--- PASS: TestSanitizeJiraConfig/jira_configs_returns_error_for_unsupported_versions (0.00s)
--- PASS: TestSanitizeJiraConfig/jira_configs_allows_for_supported_versions (0.00s)
--- PASS: TestSanitizeJiraConfig/jira_configs_returns_error_for_missing_mandatory_fields (0.00s)
--- PASS: TestSanitizeJiraConfig/jira_configs_with_send_resolved (0.00s)
--- FAIL: TestSanitizeJiraConfig/jira_configs_with_api_type (0.00s)
--- FAIL: TestSanitizeJiraConfig/jira_configs_with_incorrect_api_type (0.00s)
--- FAIL: TestSanitizeJiraConfig/jira_configs_with_api_type_unsupported_version (0.00s)
@nutmos still one left in extended tests
=== RUN TestSanitizeJiraConfig/jira_configs_with_api_type
amcfg_test.go:5724: assertion failed:
--- expected
+++ actual
@@ -2,7 +2,7 @@
- name: ""
jira_configs:
- - send_resolved: true
- api_url: http://issues.example.com/
+ - api_url: http://issues.example.com/
project: Monitoring
+ issue_type: Bug
api_type: datacenter
templates: []
@heliapb Could you please help me review?
@heliapb Any chance for reviewing this PR?
@heliapb Are you able to have a review please?
@heliapb I updated as suggested already but I saw some error from the E2E testing, which I believe I didn't touch it. Do you have any suggestions?
@heliapb Could you please help me review?
@heliapb have you managed to review it yet?
@heliapb Please review. Thank you!
@heliapb Any chance to review this PR?