-
Notifications
You must be signed in to change notification settings - Fork 288
fix: update Jira API endpoint from deprecated /search to /search/jql #1925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughUpdated 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
Sequence Diagram(s)Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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.
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. Comment |
There was a problem hiding this 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?
Fixes HTTP 410 'Gone' errors caused by deprecated Jira search endpoint. Updates endpoint per Atlassian CHANGE-2046 migration guidelines.
40b5819 to
e823a35
Compare
|
@coderabbitai generate docstrings |
✅ Actions performedDocstrings generation started. |
Docstrings generation was requested by @KRJNK. * #1925 (comment) The following files were modified: * `src/robusta/integrations/jira/client.py`
|
Note Generated docstrings for this pull request at #1926 |
Summary
Fixes HTTP 410 'Gone' errors caused by deprecated Jira search endpoint.
Changes
searchtosearch/jqlinlist_issues()methodImpact
Testing