refactor: migrate provider-proxy to next chain sdk#1980
refactor: migrate provider-proxy to next chain sdk#1980stalniy merged 4 commits intomain-sdk-nextfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughUpdates the certificate list API path from v1beta3 to v1 in ProviderService and its test server. Adjusts TypeScript build configuration to NodeNext module resolution with TS extension handling enabled. No public APIs or exported declarations changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant ProviderService
participant ChainAPI as Chain API
Client->>ProviderService: getCertificate(serial, providerCN)
rect rgb(237, 245, 255)
note right of ProviderService: HTTP fetch with retry on 5xx
ProviderService->>ChainAPI: GET /akash/cert/v1/certificates/list
alt 2xx response
ChainAPI-->>ProviderService: certificates[]
ProviderService-->>Client: matching certificate or not found
else 5xx error
ChainAPI--x ProviderService: error
ProviderService->>ChainAPI: retry (per policy)
note over ProviderService,ChainAPI: Retries until success or limit reached
else other error
ChainAPI--x ProviderService: 4xx/Network error
ProviderService-->>Client: error propagated
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main-sdk-next #1980 +/- ##
================================================
Coverage ? 45.06%
================================================
Files ? 993
Lines ? 28097
Branches ? 7416
================================================
Hits ? 12662
Misses ? 14314
Partials ? 1121
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
apps/provider-proxy/test/setup/chainApiServer.ts (1)
18-18: Good path update; prefer strict pathname check and set JSON content-typeTighten routing and set the response header for JSON.
- if (!req.url?.includes("/akash/cert/v1/certificates/list")) { + const url = new URL(`http://localhost${req.url || "/"}`); + if (url.pathname !== "/akash/cert/v1/certificates/list") { res.writeHead(404, "Not Found"); res.end(""); return; } - - const url = new URL(`http://localhost${req.url || "/"}`); + res.setHeader("Content-Type", "application/json; charset=utf-8");apps/provider-proxy/tsconfig.build.json (1)
6-9: Explicitly set moduleResolution and trim lib
- Add
"moduleResolution": "NodeNext"alongside"module": "NodeNext"in apps/provider-proxy/tsconfig.build.json.- You’re on TypeScript ~5.8.2, and
rewriteRelativeImportExtensionshas been supported since TS 5.7 (2ality.com).- (Optional) You can simplify
"lib"to just["ESNext"].
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/provider-proxy/src/services/ProviderService/ProviderService.ts(1 hunks)apps/provider-proxy/test/setup/chainApiServer.ts(1 hunks)apps/provider-proxy/tsconfig.build.json(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Never use type any or cast to type any. Always define the proper TypeScript types.
Files:
apps/provider-proxy/test/setup/chainApiServer.tsapps/provider-proxy/src/services/ProviderService/ProviderService.ts
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
**/*.{js,ts,tsx}: Never use deprecated methods from libraries.
Don't add unnecessary comments to the code
Files:
apps/provider-proxy/test/setup/chainApiServer.tsapps/provider-proxy/src/services/ProviderService/ProviderService.ts
🧬 Code graph analysis (1)
apps/provider-proxy/src/services/ProviderService/ProviderService.ts (1)
apps/provider-proxy/src/utils/retry.ts (1)
httpRetry(4-6)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test-build
| const response = await httpRetry(() => this.fetch(`${baseUrl}/akash/cert/v1/certificates/list?${queryParams}`), { | ||
| retryIf: response => response.status > 500, | ||
| logger: this.logger | ||
| }); |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
Endpoint bump looks right; include 500 in retry and add a timeout
- The retry predicate skips HTTP 500 exactly. Use >= 500.
- Add an abort signal to avoid hanging fetches.
Apply:
- const response = await httpRetry(() => this.fetch(`${baseUrl}/akash/cert/v1/certificates/list?${queryParams}`), {
- retryIf: response => response.status > 500,
+ const response = await httpRetry(
+ () => this.fetch(`${baseUrl}/akash/cert/v1/certificates/list?${queryParams}`, { signal: AbortSignal.timeout(10_000) }),
+ {
+ retryIf: response => response.status >= 500,
logger: this.logger
- });
+ }
+ );Also, per Issue #1920, please verify no lingering v1beta endpoints remain.
Run this repo scan to catch any remaining v1beta references:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Scanning for v1beta references…"
rg -nP -C1 --glob '!**/node_modules/**' --glob '!**/dist/**' \
-e '/v1beta\d*/' -e '\bv1beta\b' -e '/cert/v1beta' .Length of output: 31
Use AbortSignal.timeout and include HTTP 500 status in retry predicate
- Pass
{ signal: AbortSignal.timeout(10_000) }to thefetchcall to prevent hanging requests. - Change
retryIf: response => response.status > 500toresponse.status >= 500. - No lingering
v1betaendpoints remain in the codebase.
🤖 Prompt for AI Agents
In apps/provider-proxy/src/services/ProviderService/ProviderService.ts around
lines 27 to 30, the fetch call needs a request timeout and the retry predicate
should include HTTP 500; update the fetch invocation to pass an AbortSignal
created with AbortSignal.timeout(10_000) so the request cancels after 10s,
change the httpRetry option to use retryIf: response => response.status >= 500,
and scan this file (and the repo) to ensure no lingering "v1beta" Akash
endpoints remain, replacing them with the correct v1 paths if found.
|
It should be merged in |
yes! thanks for pointing out this! |
* feat(deployment): add fallback deployment info endpoint * fix(billing): remove comments * fix(deployment): update apps/api/test/functional/deployment-info-fallback.spec.ts Co-authored-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com> Signed-off-by: Maxime Beauchamp <15185355+baktun14@users.noreply.github.com> * fix(deployment): pr fixes --------- Signed-off-by: Maxime Beauchamp <15185355+baktun14@users.noreply.github.com> Co-authored-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com>
b85bee9 to
46ef7a7
Compare
* refactor: migrate provider-proxy to next chain sdk (#1980) * feat(analytics): chain sdk next indexer (#1983) * feat(network): testnet deposit implementation * feat(analytics): implement new handlers for indexing * feat(analytics): add protobuf types from chain sdk for indexer * fix(analytics): remove test throw * feat: update chain-sdk indexer * feat: update net package * fix: net package testnet (#2016) fix: net config data * feat: implement new chain sdk types in api * fix: replace DepositAuthorization * fix: update http sdk + functional test envs * fix: undo frontend code changes * fix: balance calculation * fix: pr fixes * fix: gpu prices test * fix: tests * fix: fallback deployment tests * fix: stripe webhook tests * fix: balances test * fix: api structure for leases + tests * fix: lease fallback tests * fix: tests * fix: build fix * fix: faucet json * refactor: gets rid of akashjs and akash-api * fix: pr fixes for tests * fix: build * fix: sdl --------- Co-authored-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com>
* refactor: migrate provider-proxy to next chain sdk (#1980) * feat(analytics): chain sdk next indexer (#1983) * feat(network): testnet deposit implementation * feat(analytics): implement new handlers for indexing * feat(analytics): add protobuf types from chain sdk for indexer * fix(analytics): remove test throw * feat: update chain-sdk indexer * feat: update net package * fix: net package testnet (#2016) fix: net config data * feat: implement new chain sdk types in api * fix: replace DepositAuthorization * fix: update http sdk + functional test envs * fix: undo frontend code changes * fix: balance calculation * fix: pr fixes * fix: gpu prices test * fix: tests * fix: fallback deployment tests * fix: stripe webhook tests * fix: balances test * fix: api structure for leases + tests * fix: lease fallback tests * fix: tests * fix: build fix * fix: faucet json * refactor: gets rid of akashjs and akash-api * fix: pr fixes for tests * fix: build * fix: sdl --------- Co-authored-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com>
* refactor: migrate provider-proxy to next chain sdk (#1980) * feat(analytics): chain sdk next indexer (#1983) * feat(network): testnet deposit implementation * feat(analytics): implement new handlers for indexing * feat(analytics): add protobuf types from chain sdk for indexer * fix(analytics): remove test throw * feat: update chain-sdk indexer * feat: update net package * fix: net package testnet (#2016) fix: net config data * feat: implement new chain sdk types in api * fix: replace DepositAuthorization * fix: update http sdk + functional test envs * fix: undo frontend code changes * fix: balance calculation * fix: pr fixes * fix: gpu prices test * fix: tests * fix: fallback deployment tests * fix: stripe webhook tests * fix: balances test * fix: api structure for leases + tests * fix: lease fallback tests * fix: tests * fix: build fix * fix: faucet json * refactor: gets rid of akashjs and akash-api * fix: pr fixes for tests * fix: build * fix: sdl --------- Co-authored-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com>
* refactor: migrate provider-proxy to next chain sdk (#1980) * feat(analytics): chain sdk next indexer (#1983) * feat(network): testnet deposit implementation * feat(analytics): implement new handlers for indexing * feat(analytics): add protobuf types from chain sdk for indexer * fix(analytics): remove test throw * feat: update chain-sdk indexer * feat: update net package * fix: net package testnet (#2016) fix: net config data * feat: implement new chain sdk types in api * fix: replace DepositAuthorization * fix: update http sdk + functional test envs * fix: undo frontend code changes * fix: balance calculation * fix: pr fixes * fix: gpu prices test * fix: tests * fix: fallback deployment tests * fix: stripe webhook tests * fix: balances test * fix: api structure for leases + tests * fix: lease fallback tests * fix: tests * fix: build fix * fix: faucet json * refactor: gets rid of akashjs and akash-api * fix: pr fixes for tests * fix: build * fix: sdl --------- Co-authored-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com>
* refactor: migrate provider-proxy to next chain sdk (#1980) * feat(analytics): chain sdk next indexer (#1983) * feat(network): testnet deposit implementation * feat(analytics): implement new handlers for indexing * feat(analytics): add protobuf types from chain sdk for indexer * fix(analytics): remove test throw * feat: update chain-sdk indexer * feat: update net package * fix: net package testnet (#2016) fix: net config data * feat: implement new chain sdk types in api * fix: replace DepositAuthorization * fix: update http sdk + functional test envs * fix: undo frontend code changes * fix: balance calculation * fix: pr fixes * fix: gpu prices test * fix: tests * fix: fallback deployment tests * fix: stripe webhook tests * fix: balances test * fix: api structure for leases + tests * fix: lease fallback tests * fix: tests * fix: build fix * fix: faucet json * refactor: gets rid of akashjs and akash-api * fix: pr fixes for tests * fix: build * fix: sdl --------- Co-authored-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com>
* refactor: migrate provider-proxy to next chain sdk (#1980) * feat(analytics): chain sdk next indexer (#1983) * feat(network): testnet deposit implementation * feat(analytics): implement new handlers for indexing * feat(analytics): add protobuf types from chain sdk for indexer * fix(analytics): remove test throw * feat: update chain-sdk indexer * feat: update net package * fix: net package testnet (#2016) fix: net config data * feat: implement new chain sdk types in api * fix: replace DepositAuthorization * fix: update http sdk + functional test envs * fix: undo frontend code changes * fix: balance calculation * fix: pr fixes * fix: gpu prices test * fix: tests * fix: fallback deployment tests * fix: stripe webhook tests * fix: balances test * fix: api structure for leases + tests * fix: lease fallback tests * fix: tests * fix: build fix * fix: faucet json * refactor: gets rid of akashjs and akash-api * fix: pr fixes for tests * fix: build * fix: sdl --------- Co-authored-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com>
* refactor: migrate provider-proxy to next chain sdk (#1980) * feat(analytics): chain sdk next indexer (#1983) * feat(network): testnet deposit implementation * feat(analytics): implement new handlers for indexing * feat(analytics): add protobuf types from chain sdk for indexer * fix(analytics): remove test throw * feat: update chain-sdk indexer * feat: update net package * fix: net package testnet (#2016) fix: net config data * feat: implement new chain sdk types in api * fix: replace DepositAuthorization * fix: update http sdk + functional test envs * fix: undo frontend code changes * fix: balance calculation * fix: pr fixes * fix: gpu prices test * fix: tests * fix: fallback deployment tests * fix: stripe webhook tests * fix: balances test * fix: api structure for leases + tests * fix: lease fallback tests * fix: tests * fix: build fix * fix: faucet json * refactor: gets rid of akashjs and akash-api * fix: pr fixes for tests * fix: build * fix: sdl --------- Co-authored-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com>
* refactor: migrate provider-proxy to next chain sdk (#1980) * feat(analytics): chain sdk next indexer (#1983) * feat(network): testnet deposit implementation * feat(analytics): implement new handlers for indexing * feat(analytics): add protobuf types from chain sdk for indexer * fix(analytics): remove test throw * feat: update chain-sdk indexer * feat: update net package * fix: net package testnet (#2016) fix: net config data * feat: implement new chain sdk types in api * fix: replace DepositAuthorization * fix: update http sdk + functional test envs * fix: undo frontend code changes * fix: balance calculation * fix: pr fixes * fix: gpu prices test * fix: tests * fix: fallback deployment tests * fix: stripe webhook tests * fix: balances test * fix: api structure for leases + tests * fix: lease fallback tests * fix: tests * fix: build fix * fix: faucet json * refactor: gets rid of akashjs and akash-api * fix: pr fixes for tests * fix: build * fix: sdl --------- Co-authored-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com>
* refactor: migrate provider-proxy to next chain sdk (#1980) * feat(analytics): chain sdk next indexer (#1983) * feat(network): testnet deposit implementation * feat(analytics): implement new handlers for indexing * feat(analytics): add protobuf types from chain sdk for indexer * fix(analytics): remove test throw * feat: update chain-sdk indexer * feat: update net package * fix: net package testnet (#2016) fix: net config data * feat: implement new chain sdk types in api * fix: replace DepositAuthorization * fix: update http sdk + functional test envs * fix: undo frontend code changes * fix: balance calculation * fix: pr fixes * fix: gpu prices test * fix: tests * fix: fallback deployment tests * fix: stripe webhook tests * fix: balances test * fix: api structure for leases + tests * fix: lease fallback tests * fix: tests * fix: build fix * fix: faucet json * refactor: gets rid of akashjs and akash-api * fix: pr fixes for tests * fix: build * fix: sdl --------- Co-authored-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com>
* refactor: migrate provider-proxy to next chain sdk (#1980) * feat(analytics): chain sdk next indexer (#1983) * feat(network): testnet deposit implementation * feat(analytics): implement new handlers for indexing * feat(analytics): add protobuf types from chain sdk for indexer * fix(analytics): remove test throw * feat: update chain-sdk indexer * feat: update net package * fix: net package testnet (#2016) fix: net config data * feat: implement new chain sdk types in api * fix: replace DepositAuthorization * fix: update http sdk + functional test envs * fix: undo frontend code changes * fix: balance calculation * fix: pr fixes * fix: gpu prices test * fix: tests * fix: fallback deployment tests * fix: stripe webhook tests * fix: balances test * fix: api structure for leases + tests * fix: lease fallback tests * fix: tests * fix: build fix * fix: faucet json * refactor: gets rid of akashjs and akash-api * fix: pr fixes for tests * fix: build * fix: sdl --------- Co-authored-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com>
* refactor: migrate provider-proxy to next chain sdk (#1980) * feat(analytics): chain sdk next indexer (#1983) * feat(network): testnet deposit implementation * feat(analytics): implement new handlers for indexing * feat(analytics): add protobuf types from chain sdk for indexer * fix(analytics): remove test throw * feat: update chain-sdk indexer * feat: update net package * fix: net package testnet (#2016) fix: net config data * feat: implement new chain sdk types in api * fix: replace DepositAuthorization * fix: update http sdk + functional test envs * fix: undo frontend code changes * fix: balance calculation * fix: pr fixes * fix: gpu prices test * fix: tests * fix: fallback deployment tests * fix: stripe webhook tests * fix: balances test * fix: api structure for leases + tests * fix: lease fallback tests * fix: tests * fix: build fix * fix: faucet json * refactor: gets rid of akashjs and akash-api * fix: pr fixes for tests * fix: build * fix: sdl --------- Co-authored-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com>
* refactor: migrate provider-proxy to next chain sdk (#1980) * feat(analytics): chain sdk next indexer (#1983) * feat(network): testnet deposit implementation * feat(analytics): implement new handlers for indexing * feat(analytics): add protobuf types from chain sdk for indexer * fix(analytics): remove test throw * feat: update chain-sdk indexer * feat: update net package * fix: net package testnet (#2016) fix: net config data * feat: implement new chain sdk types in api * fix: replace DepositAuthorization * fix: update http sdk + functional test envs * fix: undo frontend code changes * fix: balance calculation * fix: pr fixes * fix: gpu prices test * fix: tests * fix: fallback deployment tests * fix: stripe webhook tests * fix: balances test * fix: api structure for leases + tests * fix: lease fallback tests * fix: tests * fix: build fix * fix: faucet json * refactor: gets rid of akashjs and akash-api * fix: pr fixes for tests * fix: build * fix: sdl --------- Co-authored-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com>
* refactor: migrate provider-proxy to next chain sdk (#1980) * feat(analytics): chain sdk next indexer (#1983) * feat(network): testnet deposit implementation * feat(analytics): implement new handlers for indexing * feat(analytics): add protobuf types from chain sdk for indexer * fix(analytics): remove test throw * feat: update chain-sdk indexer * feat: update net package * fix: net package testnet (#2016) fix: net config data * feat: implement new chain sdk types in api * fix: replace DepositAuthorization * fix: update http sdk + functional test envs * fix: undo frontend code changes * fix: balance calculation * fix: pr fixes * fix: gpu prices test * fix: tests * fix: fallback deployment tests * fix: stripe webhook tests * fix: balances test * fix: api structure for leases + tests * fix: lease fallback tests * fix: tests * fix: build fix * fix: faucet json * refactor: gets rid of akashjs and akash-api * fix: pr fixes for tests * fix: build * fix: sdl --------- Co-authored-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com>
Why
closes #1920
Summary by CodeRabbit