Retry backoff upstream#43787
Retry backoff upstream#43787cyble-dev wants to merge 4 commits intodemisto:contrib/cyble-dev_Retry_backoff_upstreamfrom
Conversation
Restore cyble-vision-fetch-alerts, SAMPLE_ALERTS, get_event_format, and get_response retry naming; keep backoff only in get_data and get_all_services. Made-with: Cursor
|
Thank you for your contribution. Your generosity and caring are unrivaled! Make sure to register your contribution by filling the Contribution Registration form, so our content wizard @kamalq97 will know the proposed changes are ready to be reviewed. |
|
Hi @cyble-dev, thanks for contributing to the XSOAR marketplace. To receive credit for your generous contribution please follow this link. |
🤖 AI-Powered Code Review AvailableHi @kamalq97, you can leverage AI-powered code review to assist with this PR! Available Commands:
|
|
Hi @cyble-dev Thank you for your contribution! This PR does not yet have partner approval. If you are a developer from the partner organization:
If you are a member of our XSOAR Content development community:
|
…erage - Add explicit fallback returns after retry loops in get_data and get_all_services - Mark unreachable fallbacks with pragma: no cover for coverage - Add unit tests for missing credentials, HTTP/JSON retry paths, and services retry Made-with: Cursor
|
For the Reviewer: Trigger build request has been accepted for this contribution PR. |
|
For the Reviewer: Successfully created a pipeline in GitLab with url: https://gitlab.xdr.pan.local/xdr/cortex-content/content/-/pipelines/8150997 |
|
🤖 Analysis started. Please wait for results... |
|
Validate summary Verdict: PR can be force merged from validate perspective? ✅ |
🤖 AI Review DisclaimerThis review was generated by an AI-powered tool and may contain inaccuracies. Please be advised, and we extend our sincere apologies for any inconvenience this may cause. |
marketplace-ai-reviewer
left a comment
There was a problem hiding this comment.
Thanks for your contribution to the CybleEventsV2 pack! I've reviewed the PR and left a few suggestions to refine the new retry logic, specifically around failing immediately on format errors and expanding the test coverage to verify backoff behavior. Please also update the pack metadata to include the vendor name in the keywords and valid GitHub usernames, and ensure the release notes start with an approved prefix. Let me know if you have any questions!
Additionally, please address the following file-level notes:
Packs/CybleEventsV2/pack_metadata.json: - The vendor name (e.g., 'Cyble') must be included in thekeywordslist, which is currently empty.- The
githubUserfield is currently an empty list. Please provide a list of valid GitHub usernames (strings) to ensure the vendor receives notifications.
@kamalq97 please review and approve the results generated by the AI Reviewer by responding 👍 on this comment.
| result = self.client.get_all_services(self.test_api_key, self.test_url) | ||
| assert result == ["a"] | ||
| mock_sleep.assert_called() | ||
|
|
There was a problem hiding this comment.
Consider adding a test case that exhausts all retries to ensure the final exception is raised correctly.
| demisto.debug(f"Received services: {json.dumps(parsed['data'], indent=2)}") | ||
| return parsed["data"] | ||
|
|
||
| if attempt < len(backoffs): |
There was a problem hiding this comment.
Consider failing immediately on format errors instead of retrying.
| ): | ||
| result = self.client.get_data(self.test_service, input_params) | ||
|
|
||
| assert result == {"parsed": True} |
There was a problem hiding this comment.
Verify that the retry backoff was triggered.
|
|
||
| ##### CybleEvents v2 | ||
|
|
||
| - Added retry with backoff when fetch-incidents calls to the services or alerts API fail (initial attempt plus retries with delays of 5, 10, 20, 20, and 20 seconds). |
There was a problem hiding this comment.
The release note entry does not start with an approved prefix. Please auto-generate the release notes via demisto-sdk update-release-notes, and/or refer to the Release Notes Documentation.
Approved prefixes include Added support for, Improved implementation, Updated the, etc.
Consider rewording to something like:
- Improved implementation of `fetch-incidents` by adding retry with backoff when calls to the services or alerts API fail (initial attempt plus retries with delays of 5, 10, 20, 20, and 20 seconds).
Contributing to Cortex XSOAR Content
Make sure to register your contribution by filling the contribution registration form
The Pull Request will be reviewed only after the contribution registration form is filled.
Status
Related Issues
Must have
relates: https://jira-dc.paloaltonetworks.com/browse/CIAC-16491