fix: separate deployments for each provider proxy env/network#2211
Conversation
WalkthroughSplit provider-proxy deployments by chain and update CI jobs; add per-chain Helm values and remove legacy hostName entries; parameterize provider-proxy URL in frontend env; wire dynamic network-based providerProxy and WebSocket resolution in the DI container; remove browser-specific WS URL helper. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant CI as GitHub Actions
participant Build as Build job
participant Reusable as reusable-deploy-k8s
Note over CI,Build: Build produces image_tag
CI->>Build: run build
Build-->>CI: outputs.image_tag
par Deploys by chain
CI->>Reusable: deploy-beta-mainnet(app: provider-proxy, appVersion: image_tag, chain: mainnet)
Reusable-->>CI: success/failure
CI->>Reusable: deploy-beta-sandbox(app: provider-proxy, appVersion: image_tag, chain: sandbox)
Reusable-->>CI: success/failure
end
sequenceDiagram
autonumber
participant UI as Browser UI
participant DI as app-di-container
participant Store as networkStore
participant HTTP as Axios client
participant WS as WebSocket
UI->>DI: request providerProxy service
DI->>Store: read selectedNetworkId
Store-->>DI: selectedNetworkId
DI->>HTTP: create axios instance (baseURL="/") with interceptor
Note right of HTTP: interceptor overrides baseURL to "/provider-proxy-<selectedNetworkId>"
UI->>HTTP: send HTTP request
HTTP-->>UI: response
Note right of DI: WS URL computed via "/provider-proxy-<selectedNetworkId>" and used to create WebSocket
DI->>WS: open WebSocket to computed URL
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
f424f34 to
3b0fbab
Compare
3b0fbab to
274a00e
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2211 +/- ##
==========================================
- Coverage 47.59% 47.28% -0.32%
==========================================
Files 1032 1021 -11
Lines 29258 28902 -356
Branches 7564 7551 -13
==========================================
- Hits 13926 13666 -260
+ Misses 14952 14853 -99
- Partials 380 383 +3
*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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/deploy-web/env/.env(1 hunks)apps/deploy-web/src/config/ws.config.ts(0 hunks)apps/deploy-web/src/services/app-di-container/app-di-container.ts(2 hunks)apps/deploy-web/src/services/app-di-container/browser-di-container.ts(0 hunks)
💤 Files with no reviewable changes (2)
- apps/deploy-web/src/services/app-di-container/browser-di-container.ts
- apps/deploy-web/src/config/ws.config.ts
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: baktun14
Repo: akash-network/console PR: 1725
File: apps/api/src/utils/constants.ts:5-5
Timestamp: 2025-07-24T17:00:52.361Z
Learning: In the Akash Network Console project, when cross-cutting concerns or broader refactoring issues are identified during PR review, the preferred approach is to create a separate GitHub issue to track the work rather than expanding the scope of the current PR. This maintains focus and allows for proper planning of architectural improvements.
📚 Learning: 2025-08-12T13:52:38.708Z
Learnt from: stalniy
Repo: akash-network/console PR: 1800
File: apps/deploy-web/next.config.js:163-165
Timestamp: 2025-08-12T13:52:38.708Z
Learning: In the Akash Console project, akashnetwork/env-loader is used at the top of next.config.js files to automatically load environment variables from env/.env files into process.env. SENTRY_ORG and SENTRY_PROJECT are stored as public configuration values in apps/deploy-web/env/.env and are loaded this way, while only SENTRY_AUTH_TOKEN is handled as a GitHub secret in workflows.
Applied to files:
apps/deploy-web/env/.env
🧬 Code graph analysis (1)
apps/deploy-web/src/services/app-di-container/app-di-container.ts (2)
apps/stats-web/src/store/network.store.ts (1)
networkStore(6-10)apps/deploy-web/src/services/provider-proxy/provider-proxy.service.ts (1)
ProviderProxyService(18-319)
🪛 dotenv-linter (4.0.0)
apps/deploy-web/env/.env
[warning] 28-28: [QuoteCharacter] The value has quote characters (', ")
(QuoteCharacter)
⏰ 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). (2)
- GitHub Check: validate / validate-app
- GitHub Check: test-build
🔇 Additional comments (2)
apps/deploy-web/src/services/app-di-container/app-di-container.ts (2)
19-19: LGTM! NetworkStore integration follows the DI container pattern.The networkStore import and provider addition enable dynamic network-based URL resolution for the provider proxy.
Also applies to: 78-78
79-88: The original review comment is incorrect.The
selectedNetworkIdgetter is properly defined and returnsNetwork["id"], which is guaranteed to have a value. TheselectedNetworkIdStoreis initialized withatomWithStorageusingthis.options.defaultNetworkIdas the fallback value, andNetworkStoreOptionsrequiresdefaultNetworkIdto be provided. The getter will never be undefined—it either retrieves the stored value or defaults to the initial network ID.The dynamic URL resolution in the reviewed code will work correctly as written.
Likely an incorrect or invalid review comment.
acee500 to
e24bf8e
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
apps/deploy-web/env/.env (1)
28-28: Remove quotes from the environment variable value.The double quotes will be included as part of the parsed value, resulting in an invalid URL like
"/provider-proxy-%{NETWORK}"(with a leading quote character).Apply this diff to fix:
-NEXT_PUBLIC_PROVIDER_PROXY_URL="/provider-proxy-%{NETWORK}" +NEXT_PUBLIC_PROVIDER_PROXY_URL=/provider-proxy-%{NETWORK}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (13)
.github/workflows/console-api-release.yml(1 hunks).github/workflows/provider-proxy-release.yml(1 hunks).helm/provider-proxy-prod-mainnet-values.yaml(1 hunks).helm/provider-proxy-prod-sandbox-values.yaml(1 hunks).helm/provider-proxy-prod-values.yaml(0 hunks).helm/provider-proxy-staging-mainnet-values.yaml(1 hunks).helm/provider-proxy-staging-sandbox-values.yaml(1 hunks).helm/provider-proxy-staging-testnet-values.yaml(1 hunks).helm/provider-proxy-staging-values.yaml(0 hunks)apps/deploy-web/env/.env(1 hunks)apps/deploy-web/src/config/ws.config.ts(0 hunks)apps/deploy-web/src/services/app-di-container/app-di-container.ts(2 hunks)apps/deploy-web/src/services/app-di-container/browser-di-container.ts(0 hunks)
💤 Files with no reviewable changes (4)
- .helm/provider-proxy-staging-values.yaml
- .helm/provider-proxy-prod-values.yaml
- apps/deploy-web/src/services/app-di-container/browser-di-container.ts
- apps/deploy-web/src/config/ws.config.ts
🚧 Files skipped from review as they are similar to previous changes (6)
- .helm/provider-proxy-prod-mainnet-values.yaml
- .helm/provider-proxy-staging-sandbox-values.yaml
- .helm/provider-proxy-prod-sandbox-values.yaml
- .helm/provider-proxy-staging-mainnet-values.yaml
- .github/workflows/provider-proxy-release.yml
- .helm/provider-proxy-staging-testnet-values.yaml
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: baktun14
Repo: akash-network/console PR: 1725
File: apps/api/src/utils/constants.ts:5-5
Timestamp: 2025-07-24T17:00:52.361Z
Learning: In the Akash Network Console project, when cross-cutting concerns or broader refactoring issues are identified during PR review, the preferred approach is to create a separate GitHub issue to track the work rather than expanding the scope of the current PR. This maintains focus and allows for proper planning of architectural improvements.
📚 Learning: 2025-08-12T13:52:38.708Z
Learnt from: stalniy
Repo: akash-network/console PR: 1800
File: apps/deploy-web/next.config.js:163-165
Timestamp: 2025-08-12T13:52:38.708Z
Learning: In the Akash Console project, akashnetwork/env-loader is used at the top of next.config.js files to automatically load environment variables from env/.env files into process.env. SENTRY_ORG and SENTRY_PROJECT are stored as public configuration values in apps/deploy-web/env/.env and are loaded this way, while only SENTRY_AUTH_TOKEN is handled as a GitHub secret in workflows.
Applied to files:
apps/deploy-web/env/.env
🧬 Code graph analysis (1)
apps/deploy-web/src/services/app-di-container/app-di-container.ts (2)
apps/stats-web/src/store/network.store.ts (1)
networkStore(6-10)apps/deploy-web/src/services/provider-proxy/provider-proxy.service.ts (1)
ProviderProxyService(18-319)
🪛 dotenv-linter (4.0.0)
apps/deploy-web/env/.env
[warning] 28-28: [QuoteCharacter] The value has quote characters (', ")
(QuoteCharacter)
⏰ 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). (2)
- GitHub Check: validate / validate-app
- GitHub Check: test-build
🔇 Additional comments (2)
.github/workflows/console-api-release.yml (1)
30-50: Clear separation of deployments by chain with consistent job structure.The changes properly separate console-api deployments for mainnet and sandbox chains:
- Job name updated to reflect mainnet target (line 32)
- Explicit
chain: mainnetparameter added for clarity and proper configuration (line 39)- New
deploy-beta-sandboxjob added with matching structure (lines 41-50)The workflow structure is consistent and aligns with the PR objective to separate deployments per environment/network.
Verify that the underlying
reusable-deploy-k8s.ymlworkflow correctly handles thechainparameter to ensure both mainnet and sandbox deployments are properly configured.apps/deploy-web/src/services/app-di-container/app-di-container.ts (1)
19-19: LGTM: networkStore integration.The import and container exposure of
networkStorefollow the established patterns and enable dynamic network selection throughout the application.Also applies to: 78-78
refs #2190 --------- Co-authored-by: Sergii <sergiy.stotskiy@gmail.com>
refs #2190
Summary by CodeRabbit
New Features
Chores