Skip to content

Retry backoff upstream#43787

Open
cyble-dev wants to merge 4 commits intodemisto:contrib/cyble-dev_Retry_backoff_upstreamfrom
cyble-dev:Retry_backoff_upstream
Open

Retry backoff upstream#43787
cyble-dev wants to merge 4 commits intodemisto:contrib/cyble-dev_Retry_backoff_upstreamfrom
cyble-dev:Retry_backoff_upstream

Conversation

@cyble-dev
Copy link
Copy Markdown
Contributor

@cyble-dev cyble-dev commented Apr 9, 2026

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

  • In Progress
  • Ready
  • In Hold - (Reason for hold)

Related Issues

Must have

  • Tests
  • Documentation

relates: https://jira-dc.paloaltonetworks.com/browse/CIAC-16491

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
@content-bot content-bot added Contribution Thank you! Contributions are always welcome! External PR Partner Support Level Indicates that the contribution is for Partner supported pack labels Apr 9, 2026
@content-bot content-bot changed the base branch from master to contrib/cyble-dev_Retry_backoff_upstream April 9, 2026 10:38
@content-bot content-bot requested a review from kamalq97 April 9, 2026 10:38
@content-bot
Copy link
Copy Markdown
Contributor

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.
For your convenience, here is a link to the contributions SLAs document.

@content-bot
Copy link
Copy Markdown
Contributor

Hi @cyble-dev, thanks for contributing to the XSOAR marketplace. To receive credit for your generous contribution please follow this link.

@content-bot
Copy link
Copy Markdown
Contributor

🤖 AI-Powered Code Review Available

Hi @kamalq97, you can leverage AI-powered code review to assist with this PR!

Available Commands:

  • @marketplace-ai-reviewer start review - Initiate a full AI code review
  • @marketplace-ai-reviewer re-review - Incremental review for new commits

@kamalq97
Copy link
Copy Markdown
Contributor

kamalq97 commented Apr 9, 2026

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:

  • Please confirm by commenting here or contacting me via the Cortex DFIR Community Slack.
    • We will reach out to the partner and ask for their approval of the changes in this PR.

…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
@content-bot content-bot added Partner-Approved Contribution Form Filled Whether contribution form filled or not. Partner labels Apr 9, 2026
@kamalq97 kamalq97 added ready-for-instance-test In contribution PRs, this label will cause a trigger of a build with a modified pack from the PR. ready-for-ai-review The PR is ready for reviewing the PR with the AI Reviewer. labels Apr 9, 2026
@content-bot
Copy link
Copy Markdown
Contributor

For the Reviewer: Trigger build request has been accepted for this contribution PR.

@content-bot
Copy link
Copy Markdown
Contributor

For the Reviewer: Successfully created a pipeline in GitLab with url: https://gitlab.xdr.pan.local/xdr/cortex-content/content/-/pipelines/8150997

@content-bot content-bot removed the ready-for-instance-test In contribution PRs, this label will cause a trigger of a build with a modified pack from the PR. label Apr 9, 2026
@marketplace-ai-reviewer marketplace-ai-reviewer removed the ready-for-ai-review The PR is ready for reviewing the PR with the AI Reviewer. label Apr 9, 2026
@marketplace-ai-reviewer
Copy link
Copy Markdown
Contributor

🤖 Analysis started. Please wait for results...

@content-bot
Copy link
Copy Markdown
Contributor

Validate summary
The following errors were thrown as a part of this pr: DO106.
The following errors cannot be ignored: DO106.
If the AG100 validation in the pre-commit GitHub Action fails, the pull request cannot be force-merged.
The following errors don't run as part of the nightly flow and therefore can be force merged: DO106.

Verdict: PR can be force merged from validate perspective? ✅

@marketplace-ai-reviewer
Copy link
Copy Markdown
Contributor

🤖 AI Review Disclaimer

This 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.

Copy link
Copy Markdown
Contributor

@marketplace-ai-reviewer marketplace-ai-reviewer left a comment

Choose a reason for hiding this comment

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

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 the keywords list, which is currently empty.
  • The githubUser field 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()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider failing immediately on format errors instead of retrying.

):
result = self.client.get_data(self.test_service, input_params)

assert result == {"parsed": True}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@kamalq97 kamalq97 added the pending-contributor The PR is pending the response of its creator label Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Contribution Form Filled Whether contribution form filled or not. Contribution Thank you! Contributions are always welcome! External PR Partner Support Level Indicates that the contribution is for Partner supported pack Partner Partner-Approved pending-contributor The PR is pending the response of its creator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants