Skip to content

fix: retry artifacts download #342

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

Merged
merged 1 commit into from
May 27, 2025

Conversation

nestoracunablanco
Copy link
Contributor

Release note:

NONE

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels May 23, 2025
@kubevirt-bot kubevirt-bot requested review from 0xFelix and ksimon1 May 23, 2025 15:24
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @nestoracunablanco - I've reviewed your changes - here's some feedback:

  • Introduce a delay (e.g., exponential backoff) between retry attempts to avoid hammering the download endpoint.
  • Use a warning log or include the current attempt number in the retry log to improve observability when downloads fail repeatedly.
  • Extract the hardcoded retry count into a constant or configuration to make retry behavior easier to adjust.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@nestoracunablanco
Copy link
Contributor Author

@kubevirt-bot kubevirt-bot requested a review from lyarwood May 23, 2025 16:25
Copy link
Member

@0xFelix 0xFelix left a comment

Choose a reason for hiding this comment

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

/approve

PTAL @jcanocan

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 0xFelix

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 26, 2025
func (b *buildAndPublish) getArtifactReader(artifactInfo *api.ArtifactDetails) (http.ReadCloserWithChecksum, error) {
var artifactReader http.ReadCloserWithChecksum
var err error
for range 3 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please use a const here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: Nestor Acuna Blanco <[email protected]>
@jcanocan
Copy link
Contributor

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label May 27, 2025
@kubevirt-bot kubevirt-bot merged commit 3c95375 into kubevirt:main May 27, 2025
6 checks passed
@nestoracunablanco nestoracunablanco deleted the fix/retryDownload branch May 27, 2025 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants