prometheus-operator icon indicating copy to clipboard operation
prometheus-operator copied to clipboard

feat: Add a new Jira integration for alertmanager

Open nutmos opened this issue 3 months ago • 16 comments

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

nutmos avatar Oct 02 '25 15:10 nutmos

@heliapb any comments?

nutmos avatar Oct 07 '25 12:10 nutmos

@simonpasquier Can you help review this PR as well?

nutmos avatar Oct 08 '25 13:10 nutmos

@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!

nutmos avatar Oct 11 '25 12:10 nutmos

@heliapb Anything you can suggest?

nutmos avatar Oct 14 '25 11:10 nutmos

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 avatar Oct 16 '25 12:10 heliapb

@heliapb As suggested, I added API Type in the Jira config with the condition of Alertmanager >= 0.29.0.

nutmos avatar Oct 16 '25 13:10 nutmos

@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)

cjedro avatar Oct 16 '25 15:10 cjedro

@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: []

cjedro avatar Oct 17 '25 07:10 cjedro

@heliapb Could you please help me review?

nutmos avatar Oct 17 '25 13:10 nutmos

@heliapb Any chance for reviewing this PR?

nutmos avatar Oct 25 '25 13:10 nutmos

@heliapb Are you able to have a review please?

nutmos avatar Oct 30 '25 23:10 nutmos

@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?

nutmos avatar Nov 05 '25 13:11 nutmos

@heliapb Could you please help me review?

nutmos avatar Nov 10 '25 23:11 nutmos

@heliapb have you managed to review it yet?

nutmos avatar Nov 19 '25 13:11 nutmos

@heliapb Please review. Thank you!

nutmos avatar Nov 20 '25 12:11 nutmos

@heliapb Any chance to review this PR?

nutmos avatar Dec 11 '25 00:12 nutmos