Skip to content

SUP-1886-update veracode retry on 504#614

Open
effany wants to merge 10 commits into
mainfrom
SUP-1886-update-veracode-code
Open

SUP-1886-update veracode retry on 504#614
effany wants to merge 10 commits into
mainfrom
SUP-1886-update-veracode-code

Conversation

@effany

@effany effany commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

This PR updates Veracode retry handling for 504 Gateway Timeout responses.

When a request to Veracode returns HTTP 504, the connector now retries the request up to 2 times, with a fixed 30-second interval between attempts.

This change improves resiliency against temporary Veracode-side timeouts while keeping retry behavior controlled and predictable.

https://kennasecurity.atlassian.net/jira/software/c/projects/SUP/boards/58?selectedIssue=SUP-1886

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.18%. Comparing base (119038c) to head (be67a87).

Files with missing lines Patch % Lines
...ors/veracode_asset_vulns/lib/veracode_av_client.rb 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #614      +/-   ##
==========================================
+ Coverage   35.56%   37.18%   +1.61%     
==========================================
  Files         128      128              
  Lines        8463     8469       +6     
==========================================
+ Hits         3010     3149     +139     
+ Misses       5453     5320     -133     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

effany added 2 commits June 15, 2026 13:29
- Add comprehensive unit tests for VeracodeAV::Client
- Add comprehensive unit tests for Veracode::Client
- Test HTTP requests, error handling, and authentication
- Improve patch coverage from 62.50% to meet project standards
- Use webmock for HTTP request stubbing
Comment thread spec/tasks/connectors/veracode/veracode_client_spec.rb Fixed
Comment thread spec/tasks/connectors/veracode/veracode_client_spec.rb Fixed
Comment thread spec/tasks/connectors/veracode/veracode_client_spec.rb Fixed
Comment thread spec/tasks/connectors/veracode/veracode_client_spec.rb Fixed
Comment thread spec/tasks/connectors/veracode/veracode_client_spec.rb Fixed
Comment thread spec/tasks/connectors/veracode/veracode_client_spec.rb Fixed
next_page = url
until next_page.nil?
response = http_get(next_page, {}, hmac_client: self)
response = http_get(next_page, {}, MAX_RETRIES_504_ONLY, true, hmac_client: self, retry_options: RETRY_OPTIONS_504_ONLY)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

can you please elaborate what this is going to do?

504 was already part of the http.rb retry options. how does this all work

The way I am reading this is now instead of retrying 5 times we will be retrying 2 times. is that true?

@ababhis2 ababhis2 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Need some clarity on the work

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