-
Couldn't load subscription status.
- Fork 77
feat(provider): sdk 53 upgrade and cleanup dead code #1989
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughRemoves network version variables and related schema/mappings, simplifies network config (version fields dropped), changes Network.id to string, deletes proto initialization/exports, removes akash-related dependencies, and adds general public network env vars in the local Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant App
participant Env as Env Config
participant Net as Network Config
rect rgb(245, 248, 255)
note right of App: After changes (simplified flow)
User->>App: Load Provider Console
App->>Env: Read public env vars (no version fields)
Env-->>App: Network selection
App->>Net: getCurrentNetworkConfig()
Net-->>App: Config { id, ..., version: null }
App-->>User: Render UI with selected network
end
sequenceDiagram
autonumber
actor User
participant App
participant Env as Env Config (before)
participant Net as Network Config (before)
participant Proto as Proto Types (before)
rect rgb(255, 248, 240)
note right of App: Previous flow (for contrast)
User->>App: Load
App->>Env: Read public env vars (incl. version, versionMarket)
Env-->>App: Network + version fields
App->>Net: getNetworkConfig()
Net-->>App: Config { id, version, versionMarket }
App->>Proto: initProtoTypes(network id)
Proto-->>App: Selected proto types
App-->>User: Render UI
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
⏰ 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). (13)
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 |
63e6294 to
5dba5db
Compare
❌ 49 Tests Failed:
View the top 3 failed test(s) by shortest run time
View the full list of 6 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
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.
Actionable comments posted: 0
🧹 Nitpick comments (4)
apps/provider-console/env/.env (1)
4-15: Resolve dotenv-linter warnings
dotenv-linteris flagging the extra blank line, the unsorted key order, and the missing trailing newline for this block. Please tidy the spacing and sort the keys so the linter passes.NEXT_PUBLIC_SENTRY_DSN=https://[email protected]/2 - - -# Network Configurations -NEXT_PUBLIC_SELECTED_NETWORK=mainnet -NEXT_PUBLIC_NETWORK_TITLE=Mainnet -NEXT_PUBLIC_CHAIN_ID=akashnet-2 -NEXT_PUBLIC_CHAIN_REGISTRY_NAME=akash -NEXT_PUBLIC_NETWORK_TYPE=mainnet -NEXT_PUBLIC_RPC_ENDPOINT=https://rpc.cosmos.directory/akash -NEXT_PUBLIC_API_ENDPOINT=https://rest.cosmos.directory/akash -NEXT_PUBLIC_CONSOLE_API_URL=https://console-api.akash.network -NEXT_PUBLIC_SECURITY_URL=https://provider-console-security.akash.network -NEXT_PUBLIC_API_BASE_URL=https://provider-console-api.akash.network -NEXT_PUBLIC_URL=https://provider-console.akash.network +# Network Configurations +NEXT_PUBLIC_API_BASE_URL=https://provider-console-api.akash.network +NEXT_PUBLIC_API_ENDPOINT=https://rest.cosmos.directory/akash +NEXT_PUBLIC_CHAIN_ID=akashnet-2 +NEXT_PUBLIC_CHAIN_REGISTRY_NAME=akash +NEXT_PUBLIC_CONSOLE_API_URL=https://console-api.akash.network +NEXT_PUBLIC_NETWORK_TITLE=Mainnet +NEXT_PUBLIC_NETWORK_TYPE=mainnet +NEXT_PUBLIC_RPC_ENDPOINT=https://rpc.cosmos.directory/akash +NEXT_PUBLIC_SECURITY_URL=https://provider-console-security.akash.network +NEXT_PUBLIC_SELECTED_NETWORK=mainnet +NEXT_PUBLIC_URL=https://provider-console.akash.networkBased on static analysis hints
apps/provider-console/src/types/network.ts (1)
10-10: Consider removing the unusedversionfield.Since
versionis now hardcoded tonullinnetwork.config.ts(line 24), this field appears to be dead code. If the version field is no longer needed as part of the SDK 53 upgrade, consider removing it from the type definition to simplify the interface.Apply this diff if the field is confirmed unused:
- version: string | null;apps/provider-console/src/config/network.config.ts (2)
74-80: Rename function to reflect its actual purpose.The function name
getNetworkVersionInfois misleading since it no longer returns version information—it only returnsselectedNetworkId. Consider renaming togetSelectedNetworkIdor similar to better reflect its current behavior.Apply this diff to rename the function:
-export function getNetworkVersionInfo() { +export function getSelectedNetworkId() { const selectedNetwork = browserEnvConfig.NEXT_PUBLIC_SELECTED_NETWORK ?? "mainnet"; return { selectedNetworkId: selectedNetwork }; }Then update all call sites to use the new name:
#!/bin/bash # Description: Find all call sites to update # Find function calls rg -nP --type=ts --type=tsx 'getNetworkVersionInfo\(' apps/provider-console/
24-24: Remove unusedversionfield from network config: Hard-codingversion = nullis safe—no code readsconfig.version(all.versionmatches are onpublicRuntimeConfigornode.version). Remove this property fromNetworkConfigandnetworkStoreto clean up dead code.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (13)
apps/provider-console/env/.env(1 hunks)apps/provider-console/env/.env.production(0 hunks)apps/provider-console/env/.env.sandbox(0 hunks)apps/provider-console/env/.env.staging(0 hunks)apps/provider-console/package.json(0 hunks)apps/provider-console/src/config/browser-env.config.ts(0 hunks)apps/provider-console/src/config/env-config.schema.ts(0 hunks)apps/provider-console/src/config/network.config.ts(1 hunks)apps/provider-console/src/types/network.ts(1 hunks)apps/provider-console/src/utils/constants.ts(0 hunks)apps/provider-console/src/utils/init.ts(0 hunks)apps/provider-console/src/utils/proto/grant.ts(0 hunks)apps/provider-console/src/utils/proto/index.ts(0 hunks)
💤 Files with no reviewable changes (10)
- apps/provider-console/package.json
- apps/provider-console/src/config/env-config.schema.ts
- apps/provider-console/src/utils/constants.ts
- apps/provider-console/env/.env.sandbox
- apps/provider-console/src/config/browser-env.config.ts
- apps/provider-console/src/utils/proto/grant.ts
- apps/provider-console/src/utils/proto/index.ts
- apps/provider-console/src/utils/init.ts
- apps/provider-console/env/.env.staging
- apps/provider-console/env/.env.production
🧰 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-console/src/types/network.tsapps/provider-console/src/config/network.config.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-console/src/types/network.tsapps/provider-console/src/config/network.config.ts
🧠 Learnings (1)
📚 Learning: 2025-08-12T13:52:38.708Z
Learnt from: stalniy
PR: akash-network/console#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/provider-console/env/.env
🪛 dotenv-linter (3.3.0)
apps/provider-console/env/.env
[warning] 3-3: [ExtraBlankLine] Extra blank line detected
(ExtraBlankLine)
[warning] 6-6: [UnorderedKey] The NEXT_PUBLIC_NETWORK_TITLE key should go before the NEXT_PUBLIC_SELECTED_NETWORK key
(UnorderedKey)
[warning] 7-7: [UnorderedKey] The NEXT_PUBLIC_CHAIN_ID key should go before the NEXT_PUBLIC_NETWORK_TITLE key
(UnorderedKey)
[warning] 8-8: [UnorderedKey] The NEXT_PUBLIC_CHAIN_REGISTRY_NAME key should go before the NEXT_PUBLIC_NETWORK_TITLE key
(UnorderedKey)
[warning] 9-9: [UnorderedKey] The NEXT_PUBLIC_NETWORK_TYPE key should go before the NEXT_PUBLIC_SELECTED_NETWORK key
(UnorderedKey)
[warning] 10-10: [UnorderedKey] The NEXT_PUBLIC_RPC_ENDPOINT key should go before the NEXT_PUBLIC_SELECTED_NETWORK key
(UnorderedKey)
[warning] 11-11: [UnorderedKey] The NEXT_PUBLIC_API_ENDPOINT key should go before the NEXT_PUBLIC_CHAIN_ID key
(UnorderedKey)
[warning] 12-12: [UnorderedKey] The NEXT_PUBLIC_CONSOLE_API_URL key should go before the NEXT_PUBLIC_NETWORK_TITLE key
(UnorderedKey)
[warning] 13-13: [UnorderedKey] The NEXT_PUBLIC_SECURITY_URL key should go before the NEXT_PUBLIC_SELECTED_NETWORK key
(UnorderedKey)
[warning] 14-14: [UnorderedKey] The NEXT_PUBLIC_API_BASE_URL key should go before the NEXT_PUBLIC_API_ENDPOINT key
(UnorderedKey)
[warning] 15-15: [EndingBlankLine] No blank line at the end of the file
(EndingBlankLine)
🔇 Additional comments (1)
apps/provider-console/src/types/network.ts (1)
2-2: It looks like the “unrecognized file type: tsx” is coming from whatever CLI or bundler you’re using—it doesn’t know how to handle .tsx inputs and is exiting early (“Broken pipe”). To help diagnose:• Which command (and tool) are you running when you get that error?
• How is your project configured to compile .tsx files (tsconfig, Babel, esbuild, etc.)?
• Does running a plaintscoryarn buildsucceed?Once we know your build setup and exact invocation, we can recommend the right loader or flag to add TSX support.
closes #1931
Summary by CodeRabbit