-
Notifications
You must be signed in to change notification settings - Fork 0
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
*: use axios-retry instead of handrolled retry methods #67
Conversation
1ceeafd
to
50ccb6c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Reviewed everything up to 50ccb6c in 1 minute and 46 seconds
More details
- Looked at
430
lines of code in4
files - Skipped
6
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. src/reporter.ts:26
- Draft comment:
The retry condition correctly checks for network or idempotent request errors and status codes >= 500. This ensures that retries are only attempted for recoverable errors. - Reason this comment was not posted:
Confidence changes required:0%
The code usesaxiosRetry
to handle retries for network requests. However, the retry condition checks for status codes greater than or equal to 500, which is correct, but it should also consider network errors like timeouts or connection resets. The current implementation does this correctly, so no changes are needed here.
2. src/reporter.ts:34
- Draft comment:
Consider makingstickyDiskMgrUrl
configurable via an environment variable for flexibility. - Reason this comment was not posted:
Confidence changes required:33%
ThecreateBlacksmithAPIClient
andcreateBlacksmithAgentClient
functions are well-structured and correctly configure axios instances with retry logic. However, thecreateBlacksmithAgentClient
function uses a hardcoded URL, which might be better as a configurable environment variable for flexibility.
3. src/reporter.ts:179
- Draft comment:
Theget
function is well-implemented, handling optional form data and signal options correctly. - Reason this comment was not posted:
Confidence changes required:0%
Theget
function inreporter.ts
is correctly implemented to handle GET requests with optional form data and signal options. It uses the axios instance correctly and sets the necessary headers.
4. src/setup_builder.ts:164
- Draft comment:
Consider adding error handling for unexpected response data ingetStickyDisk
. - Reason this comment was not posted:
Confidence changes required:33%
Insetup_builder.ts
, thegetStickyDisk
function uses thereporter.get
function to make a GET request. The function is correctly implemented, but it might be beneficial to handle potential errors more explicitly, especially if the response data is not as expected.
Workflow ID: wflow_7ezzlhLXr9qj09Sx
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
50ccb6c
to
810d280
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on 810d280 in 27 seconds
More details
- Looked at
414
lines of code in4
files - Skipped
3
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. src/reporter.ts:21
- Draft comment:
Consider refactoring the axios-retry configuration into a separate function to avoid duplication increateBlacksmithAPIClient
andcreateBlacksmithAgentClient
. - Reason this comment was not posted:
Confidence changes required:50%
The axios-retry configuration is duplicated in both createBlacksmithAPIClient and createBlacksmithAgentClient functions. This can be refactored to avoid redundancy.
2. src/reporter.ts:181
- Draft comment:
Ensure to handle potential errors in theget
function to avoid unhandled promise rejections. - Reason this comment was not posted:
Confidence changes required:50%
The error handling in theget
function should be improved to handle potential errors gracefully.
3. src/reporter.ts:34
- Draft comment:
Consider using an environment variable forstickyDiskMgrUrl
instead of hardcoding it, to allow for more flexible configuration. - Reason this comment was not posted:
Confidence changes required:50%
ThecreateBlacksmithAgentClient
function inreporter.ts
andsetup_builder.ts
uses a hardcoded URL which might be better suited as a configurable environment variable.
4. src/setup_builder.ts:147
- Draft comment:
Consider using an environment variable forstickyDiskMgrUrl
instead of hardcoding it, to allow for more flexible configuration. - Reason this comment was not posted:
Confidence changes required:50%
ThecreateBlacksmithAgentClient
function inreporter.ts
andsetup_builder.ts
uses a hardcoded URL which might be better suited as a configurable environment variable.
Workflow ID: wflow_NSM71zqPnGboew21
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
We need to rebase this I think @adityamaru |
Important
Replace custom retry logic with
axios-retry
for HTTP requests inreporter.ts
andsetup_builder.ts
.axios-retry
topackage.json
dependencies.typescript
version inpackage.json
.createBlacksmithAPIClient
andcreateBlacksmithAgentClient
inreporter.ts
to configureaxios
withaxios-retry
.axios-retry
for retry logic with 5 retries and exponential backoff.postWithRetryToBlacksmithAPI
andpostWithRetry
withaxios-retry
inreporter.ts
.getWithRetry
withget
inreporter.ts
.getStickyDisk
insetup_builder.ts
to usecreateBlacksmithAgentClient
.utils.ts
as it is no longer needed.This description was created by for 810d280. It will automatically update as commits are pushed.