Skip to content

fix: separate deployments for each provider proxy env/network#2211

Merged
stalniy merged 5 commits intoakash-network:mainfrom
jzsfkzm:bugfixes/2190-provider-proxy-deployments
Nov 17, 2025
Merged

fix: separate deployments for each provider proxy env/network#2211
stalniy merged 5 commits intoakash-network:mainfrom
jzsfkzm:bugfixes/2190-provider-proxy-deployments

Conversation

@jzsfkzm
Copy link
Contributor

@jzsfkzm jzsfkzm commented Nov 12, 2025

refs #2190

Summary by CodeRabbit

  • New Features

    • Explicit support for multiple blockchain environments (mainnet, sandbox, testnet) with separate deployment and configuration profiles.
    • Runtime network selection now drives provider-proxy endpoints and WebSocket connections.
  • Chores

    • Split and renamed CI deployment jobs to distinguish mainnet vs sandbox; added a sandbox/testnet deployment path.
    • Removed legacy host entries and consolidated environment hostnames.
    • Removed legacy browser-specific WebSocket URL derivation.

@jzsfkzm jzsfkzm requested a review from a team as a code owner November 12, 2025 16:37
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 12, 2025

Walkthrough

Split 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

Cohort / File(s) Change Summary
Workflows
​.github/workflows/console-api-release.yml, ​.github/workflows/provider-proxy-release.yml
Renamed deploy jobs (e.g., deploy-betadeploy-beta-mainnet), updated job display names, added chain inputs for mainnet, and introduced a deploy-beta-sandbox job (chain: sandbox).
Helm — prod values
.helm/provider-proxy-prod-mainnet-values.yaml, .helm/provider-proxy-prod-sandbox-values.yaml, .helm/provider-proxy-prod-values.yaml
Added per-chain prod values (mainnet/sandbox), removed hostName: console-provider-proxy.akash.network from base prod values; adjusted hostNames in mainnet file.
Helm — staging values
.helm/provider-proxy-staging-mainnet-values.yaml, .helm/provider-proxy-staging-sandbox-values.yaml, .helm/provider-proxy-staging-testnet-values.yaml, .helm/provider-proxy-staging-values.yaml
Added staging values for mainnet, sandbox, testnet (set chain and hostNames); removed hostName from base staging values.
Frontend env / config
apps/deploy-web/env/.env, apps/deploy-web/src/config/ws.config.ts
Parameterized NEXT_PUBLIC_PROVIDER_PROXY_URL to "/provider-proxy-%{NETWORK}"; removed browser-specific WebSocket URL construction and related exports from ws.config.ts.
DI container / runtime wiring
apps/deploy-web/src/services/app-di-container/app-di-container.ts, apps/deploy-web/src/services/app-di-container/browser-di-container.ts
Added networkStore provider and dynamic base URL / WebSocket resolution in app-di-container.ts; removed networkStore provider entry from browser-di-container.ts, affecting provider wiring in browser container.

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
Loading
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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay special attention to DI changes: networkStore added to app-di-container but removed from browser-di-container — verify container composition and any unresolved references.
  • Verify Axios interceptor and WebSocket URL construction handle edge cases (missing network id, leading/trailing slashes).
  • Confirm Helm value removals/additions leave no environment unconfigured and CI job renames match any downstream callers.

Possibly related PRs

Suggested reviewers

  • baktun14
  • ygrishajev

Poem

🐇 I hopped through YAML and CI tonight,

Chains split like trails beneath moonlight,
Env strings wear tiny network hats,
DI and WebSockets follow the pats,
A rabbit cheers the deploys bright.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objective of the changeset: implementing separate deployments for provider proxy environments and networks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jzsfkzm jzsfkzm force-pushed the bugfixes/2190-provider-proxy-deployments branch 2 times, most recently from f424f34 to 3b0fbab Compare November 14, 2025 16:50
@stalniy stalniy force-pushed the bugfixes/2190-provider-proxy-deployments branch from 3b0fbab to 274a00e Compare November 16, 2025 08:57
@codecov
Copy link

codecov bot commented Nov 16, 2025

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 47.28%. Comparing base (b9a6436) to head (e24bf8e).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../src/services/app-di-container/app-di-container.ts 88.88% 1 Missing ⚠️
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     
Flag Coverage Δ *Carryforward flag
api 82.04% <ø> (ø) Carriedforward from b9a6436
deploy-web 26.45% <88.88%> (+0.02%) ⬆️
log-collector ?
notifications 87.94% <ø> (ø) Carriedforward from b9a6436
provider-console 81.48% <ø> (ø) Carriedforward from b9a6436
provider-proxy 84.96% <ø> (ø) Carriedforward from b9a6436

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
.../services/app-di-container/browser-di-container.ts 69.69% <ø> (-1.74%) ⬇️
.../src/services/app-di-container/app-di-container.ts 88.00% <88.88%> (+2.43%) ⬆️

... and 13 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 274a00e and fbc10d8.

📒 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 selectedNetworkId getter is properly defined and returns Network["id"], which is guaranteed to have a value. The selectedNetworkIdStore is initialized with atomWithStorage using this.options.defaultNetworkId as the fallback value, and NetworkStoreOptions requires defaultNetworkId to 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.

@stalniy stalniy force-pushed the bugfixes/2190-provider-proxy-deployments branch from acee500 to e24bf8e Compare November 17, 2025 08:37
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between acee500 and e24bf8e.

📒 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: mainnet parameter added for clarity and proper configuration (line 39)
  • New deploy-beta-sandbox job 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.yml workflow correctly handles the chain parameter 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 networkStore follow the established patterns and enable dynamic network selection throughout the application.

Also applies to: 78-78

@stalniy stalniy merged commit 728f449 into akash-network:main Nov 17, 2025
64 checks passed
stalniy added a commit that referenced this pull request Nov 20, 2025
refs #2190


---------

Co-authored-by: Sergii <sergiy.stotskiy@gmail.com>
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

Comments