Skip to content
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

feat(amazonq): add retries around APIs #4256

Closed
wants to merge 3 commits into from
Closed

feat(amazonq): add retries around APIs #4256

wants to merge 3 commits into from

Conversation

dhasani23
Copy link
Contributor

@dhasani23 dhasani23 commented Apr 10, 2024

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

If an API fails, retry it once before notifying the user that it failed.

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dhasani23 dhasani23 requested review from a team as code owners April 10, 2024 00:43
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Everything deleted here was an unused string

codemodernizer.notification.info.modernize_partial_complete.title=Transformation partially successful!
codemodernizer.notification.info.submitted_project.content=Your project has been submitted for transformation. The code transformation process may take 10-30 mins depending on the size of your project.
codemodernizer.notification.info.submitted_project.title=Submitted Project
codemodernizer.notification.info.modernize_partial_complete.content=Transformation completed, but with build errors. The new code is not fully Java {0} compatible yet. You will need to fix changes yourself. You can view the changes by clicking View Diff below.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already reviewed with PM, he wants this change to say "...but with build errors" instead of "partially completed"

@@ -254,7 +255,7 @@ class CodeModernizerSession(
throw AlreadyDisposedException("Disposed when about to create upload URL")
}
val clientAdaptor = GumbyClient.getInstance(sessionContext.project)
val createUploadUrlResponse = clientAdaptor.createGumbyUploadUrl(sha256checksum)
var createUploadUrlResponse = clientAdaptor.createGumbyUploadUrl(sha256checksum)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we move this into the try catch block?

for (attempt in 0..MAX_API_RETRIES) {
  try {
    var createUploadUrlResponse = clientAdaptor.createGumbyUploadUrl(sha256checksum)
    clientAdaptor.uploadArtifactToS3(...)
  } catch (e) {
  ...
  }
}

@justinmk3
Copy link
Contributor

justinmk3 commented Apr 10, 2024

Can you not use the SDK's builtin retry mechanism?

I would expect that to be explained in the PR description / commit message.

@dhasani23 dhasani23 closed this Apr 11, 2024
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