Skip to content

Conversation

@KRJNK
Copy link
Contributor

@KRJNK KRJNK commented Sep 16, 2025

Summary

Fixes HTTP 410 'Gone' errors caused by deprecated Jira search endpoint.

Changes

  • Updated endpoint from search to search/jql in list_issues() method
  • Resolves compatibility with current Jira Cloud API per Atlassian CHANGE-2046

Impact

  • Resolves HTTP 410 errors when searching for existing issues
  • Restores proper Jira issue management functionality

Testing

  • [ ] Code compiles without errors
  • Follows Atlassian migration guidelines from CHANGE-2046

@CLAassistant
Copy link

CLAassistant commented Sep 16, 2025

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link

coderabbitai bot commented Sep 16, 2025

Walkthrough

Updated JiraClient.list_issues to call the "search/jql" REST endpoint instead of "search". No other logic, parameters, error handling, or method signatures were changed.

Changes

Cohort / File(s) Summary of Changes
Jira client endpoint update
src/robusta/integrations/jira/client.py
In list_issues, changed REST path from "search" to "search/jql"; URL construction, JQL parameter handling, and API call flow remain unchanged.

Sequence Diagram(s)

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title concisely and accurately summarizes the primary change—updating Jira's deprecated /search endpoint to /search/jql—and directly matches the file-level change to list_issues() described in the PR; it is specific, actionable, and follows conventional commit style.
Description Check ✅ Passed The PR description is directly related to the changeset: it explains the problem (HTTP 410 due to a deprecated endpoint), the code change (switch to /search/jql), the expected impact, and references Atlassian migration guidance, so it sufficiently documents the intent and relevance of the change.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 40b5819 and e823a35.

📒 Files selected for processing (1)
  • src/robusta/integrations/jira/client.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/robusta/integrations/jira/client.py

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/robusta/integrations/jira/client.py (2)

199-205: Good fix to the deprecated endpoint; adjust for new response semantics.

Switching to GET /rest/api/3/search/jql is correct and resolves the 410s. Note: the enhanced search response no longer returns "total" and uses nextPageToken-based pagination; relying code must be updated accordingly. Also, the old GET/POST /search endpoints were removed on May 1, 2025. (developer.atlassian.com)

Apply this minimal fix to keep return type consistent and avoid downstream attr errors:

-        return self._call_jira_api(url, params=query) or []
+        return self._call_jira_api(url, params=query) or {}

140-156: Fix broken logic: stop using removed "total" field; handle new paging.

search/jql responses omit "total"; current checks will always treat results as empty and never pick an issue. Use the returned "issues" array length and consider "isLast" for multi‑page scenarios. (developer.atlassian.com)

Apply:

-        query = " AND ".join(query)
-        issues = self.list_issues(query)
-
-        if issues.get("total", 0) < 1:
+        query = " AND ".join(query)
+        issues_resp = self.list_issues(query) or {}
+        issues_list = issues_resp.get("issues", [])
+        if not issues_list:
             logging.debug(f"No issue exists for query: '{query}'.")
             return
-
-        issue = issues.get("issues")[0]
-        if issues.get("total", 0) > 1:
+        issue = issues_list[0]
+        if len(issues_list) > 1 or not issues_resp.get("isLast", True):
             logging.warning(f"More than one issue found for query: '{query}', picking most recent one")
             logging.debug(f"Picked issue '{issue}'")
 
         return issue
🧹 Nitpick comments (2)
src/robusta/integrations/jira/client.py (2)

141-145: Ensure deterministic selection: order results.

To truly pick “most recent,” add an ORDER BY. The enhanced endpoint supports standard JQL. (developer.atlassian.com)

-        query = " AND ".join(query)
+        query = " AND ".join(query) + " ORDER BY updated DESC"

199-205: Optional: expose nextPageToken/maxResults to callers.

New paging uses nextPageToken; consider extending list_issues to accept these to support callers that need >1 page. (developer.atlassian.com)

Would you like a follow‑up PR to add these parameters and a small paginator helper?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 552d043 and 40b5819.

📒 Files selected for processing (1)
  • src/robusta/integrations/jira/client.py (1 hunks)

Fixes HTTP 410 'Gone' errors caused by deprecated Jira search endpoint.
Updates endpoint per Atlassian CHANGE-2046 migration guidelines.
@KRJNK KRJNK force-pushed the fix/jira-api-deprecation branch from 40b5819 to e823a35 Compare September 16, 2025 10:35
@KRJNK
Copy link
Contributor Author

KRJNK commented Sep 16, 2025

@coderabbitai generate docstrings

@coderabbitai
Copy link

coderabbitai bot commented Sep 16, 2025

✅ Actions performed

Docstrings generation started.

coderabbitai bot added a commit that referenced this pull request Sep 16, 2025
Docstrings generation was requested by @KRJNK.

* #1925 (comment)

The following files were modified:

* `src/robusta/integrations/jira/client.py`
@coderabbitai
Copy link

coderabbitai bot commented Sep 16, 2025

Note

Generated docstrings for this pull request at #1926

@moshemorad moshemorad merged commit 5bf9189 into robusta-dev:master Sep 16, 2025
4 checks passed
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.

3 participants