Skip to content

fix: uses a separate consoleApiHttpClient for public access#1719

Merged
stalniy merged 1 commit intomainfrom
fix/consoleapi-access
Jul 22, 2025
Merged

fix: uses a separate consoleApiHttpClient for public access#1719
stalniy merged 1 commit intomainfrom
fix/consoleapi-access

Conversation

@stalniy
Copy link
Contributor

@stalniy stalniy commented Jul 22, 2025

Why

we have public available API on console-api and user specific one. Eventually it should be a single API instance but at the moment it's not possible to get all public endpoints. There is a separate task for this #1701 . Related #1720

What

Adds publicConsoleApiHttpClient service

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a new public API client for accessing certain data endpoints.
  • Refactor

    • Updated various data fetching hooks and related logic to use the new public API client instead of the previous internal client.
    • Adjusted test setups to accommodate the new API client.
    • Improved dynamic construction of API URLs for user authentication requests.

@stalniy stalniy requested a review from a team as a code owner July 22, 2025 11:42
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 22, 2025

"""

Walkthrough

The changes systematically replace the use of consoleApiHttpClient with publicConsoleApiHttpClient across multiple hooks, queries, and test setups within the deploy-web app. Additionally, a new publicConsoleApiHttpClient service is introduced. The updates are limited to internal HTTP client references and do not alter exported function signatures or application logic.

Changes

File(s) Change Summary
.../ProviderRawData/ProviderRawData.spec.tsx
.../useMarketData.spec.tsx
Updated test setups to inject publicConsoleApiHttpClient instead of consoleApiHttpClient as the mock HTTP client.
.../featureFlags.ts
.../useBlocksQuery.ts
.../useGpuQuery.ts
.../useMarketData.ts
.../useProvidersQuery.ts
Replaced all usage of consoleApiHttpClient with publicConsoleApiHttpClient for API requests in hooks and queries.
.../api/auth/[...auth0].ts Changed base API URL acquisition to use apiUrlService.getBaseApiUrlFor("mainnet") instead of direct config access.
.../services/http/http-browser.service.ts Added new service publicConsoleApiHttpClient as an Axios instance (marked deprecated for future removal).

Sequence Diagram(s)

sequenceDiagram
    participant ReactHook
    participant Services
    participant publicConsoleApiHttpClient
    participant API

    ReactHook->>Services: useServices()
    Services-->>ReactHook: { publicConsoleApiHttpClient }
    ReactHook->>publicConsoleApiHttpClient: get(endpoint)
    publicConsoleApiHttpClient->>API: HTTP GET request
    API-->>publicConsoleApiHttpClient: Response
    publicConsoleApiHttpClient-->>ReactHook: Data
Loading

Estimated code review effort

2 (~15 minutes)

Possibly related PRs

Suggested reviewers

  • baktun14

Poem

A hop and a skip, a client replaced,
From console to public, the code’s retraced.
Queries and hooks now fetch anew,
With services fresh and Axios in view.
Deprecated soon, but for now it’s here—
The bunnies rejoice, the code is clear!
🐇✨
"""

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-07-22T12_14_18_856Z-debug-0.log


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4834df5 and ad2af98.

📒 Files selected for processing (9)
  • apps/deploy-web/src/components/providers/ProviderRawData/ProviderRawData.spec.tsx (3 hunks)
  • apps/deploy-web/src/pages/api/auth/[...auth0].ts (1 hunks)
  • apps/deploy-web/src/queries/featureFlags.ts (2 hunks)
  • apps/deploy-web/src/queries/useBlocksQuery.ts (1 hunks)
  • apps/deploy-web/src/queries/useGpuQuery.ts (1 hunks)
  • apps/deploy-web/src/queries/useMarketData.spec.tsx (1 hunks)
  • apps/deploy-web/src/queries/useMarketData.ts (1 hunks)
  • apps/deploy-web/src/queries/useProvidersQuery.ts (4 hunks)
  • apps/deploy-web/src/services/http/http-browser.service.ts (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • apps/deploy-web/src/queries/useMarketData.spec.tsx
  • apps/deploy-web/src/services/http/http-browser.service.ts
🚧 Files skipped from review as they are similar to previous changes (7)
  • apps/deploy-web/src/queries/useBlocksQuery.ts
  • apps/deploy-web/src/queries/useMarketData.ts
  • apps/deploy-web/src/pages/api/auth/[...auth0].ts
  • apps/deploy-web/src/queries/useGpuQuery.ts
  • apps/deploy-web/src/queries/useProvidersQuery.ts
  • apps/deploy-web/src/queries/featureFlags.ts
  • apps/deploy-web/src/components/providers/ProviderRawData/ProviderRawData.spec.tsx
⏰ 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
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link

codecov bot commented Jul 22, 2025

Codecov Report

Attention: Patch coverage is 20.00000% with 16 lines in your changes missing coverage. Please review.

Project coverage is 72.26%. Comparing base (b929e99) to head (ad2af98).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/deploy-web/src/queries/useProvidersQuery.ts 14.28% 12 Missing ⚠️
apps/deploy-web/src/queries/featureFlags.ts 0.00% 3 Missing ⚠️
...ploy-web/src/services/http/http-browser.service.ts 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (20.00%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1719      +/-   ##
==========================================
- Coverage   72.40%   72.26%   -0.14%     
==========================================
  Files         607      602       -5     
  Lines       14178    14011     -167     
  Branches     2404     2390      -14     
==========================================
- Hits        10265    10125     -140     
+ Misses       3592     3566      -26     
+ Partials      321      320       -1     
Flag Coverage Δ *Carryforward flag
api 80.18% <ø> (ø) Carriedforward from b929e99
deploy-web 56.38% <20.00%> (ø)
log-collector ?
notifications 87.25% <ø> (ø) Carriedforward from b929e99
provider-console 80.95% <ø> (ø) Carriedforward from b929e99
provider-proxy 84.35% <ø> (ø) Carriedforward from b929e99

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

Files with missing lines Coverage Δ
apps/deploy-web/src/queries/useMarketData.ts 100.00% <100.00%> (ø)
...ploy-web/src/services/http/http-browser.service.ts 80.95% <0.00%> (-4.05%) ⬇️
apps/deploy-web/src/queries/featureFlags.ts 38.46% <0.00%> (+2.74%) ⬆️
apps/deploy-web/src/queries/useProvidersQuery.ts 44.89% <14.28%> (ø)

... and 5 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: 0

🧹 Nitpick comments (2)
apps/deploy-web/src/queries/useMarketData.spec.tsx (1)

21-26: Consider renaming the mock variable for consistency.

The service key change is correct, but the mock variable name consoleApiHttpClient doesn't match the service it's mocking (publicConsoleApiHttpClient). Consider renaming for better clarity.

-    const consoleApiHttpClient = mock<AxiosInstance>();
-    consoleApiHttpClient.get.mockResolvedValue({ data: mockData });
+    const publicConsoleApiHttpClient = mock<AxiosInstance>();
+    publicConsoleApiHttpClient.get.mockResolvedValue({ data: mockData });

     const { result } = setup({
       services: {
-        publicConsoleApiHttpClient: () => consoleApiHttpClient
+        publicConsoleApiHttpClient: () => publicConsoleApiHttpClient
       }
     });

     await waitFor(() => {
-      expect(consoleApiHttpClient.get).toHaveBeenCalledWith(ApiUrlService.marketData());
+      expect(publicConsoleApiHttpClient.get).toHaveBeenCalledWith(ApiUrlService.marketData());
apps/deploy-web/src/queries/featureFlags.ts (1)

28-31: Consider renaming parameter for consistency and verify URL construction pattern.

The parameter name consoleApiHttpClient should be updated to publicConsoleApiHttpClient to match the actual client being passed. Also, this file uses a different URL construction pattern (relative path + baseURL option) compared to other updated files that use full URLs.

Apply this diff to rename the parameter:

-export async function getFeatureFlags(networkId: NetworkId, consoleApiHttpClient: AxiosInstance, apiUrlService: ApiUrlService) {
+export async function getFeatureFlags(networkId: NetworkId, publicConsoleApiHttpClient: AxiosInstance, apiUrlService: ApiUrlService) {
-  const response = await consoleApiHttpClient.get<{ data: Features }>("/v1/features", {
+  const response = await publicConsoleApiHttpClient.get<{ data: Features }>("/v1/features", {
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d904409 and 089bb94.

📒 Files selected for processing (9)
  • apps/deploy-web/src/components/providers/ProviderRawData/ProviderRawData.spec.tsx (3 hunks)
  • apps/deploy-web/src/pages/api/auth/[...auth0].ts (1 hunks)
  • apps/deploy-web/src/queries/featureFlags.ts (2 hunks)
  • apps/deploy-web/src/queries/useBlocksQuery.ts (1 hunks)
  • apps/deploy-web/src/queries/useGpuQuery.ts (1 hunks)
  • apps/deploy-web/src/queries/useMarketData.spec.tsx (1 hunks)
  • apps/deploy-web/src/queries/useMarketData.ts (1 hunks)
  • apps/deploy-web/src/queries/useProvidersQuery.ts (4 hunks)
  • apps/deploy-web/src/services/http/http-browser.service.ts (1 hunks)
📓 Path-based instructions (4)
**/*.{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/deploy-web/src/queries/useBlocksQuery.ts
  • apps/deploy-web/src/queries/useProvidersQuery.ts
  • apps/deploy-web/src/queries/useMarketData.ts
  • apps/deploy-web/src/queries/useMarketData.spec.tsx
  • apps/deploy-web/src/pages/api/auth/[...auth0].ts
  • apps/deploy-web/src/services/http/http-browser.service.ts
  • apps/deploy-web/src/components/providers/ProviderRawData/ProviderRawData.spec.tsx
  • apps/deploy-web/src/queries/useGpuQuery.ts
  • apps/deploy-web/src/queries/featureFlags.ts
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/general.mdc)

**/*.{js,jsx,ts,tsx}: Never use deprecated methods from libraries.
Don't add unnecessary comments to the code

Files:

  • apps/deploy-web/src/queries/useBlocksQuery.ts
  • apps/deploy-web/src/queries/useProvidersQuery.ts
  • apps/deploy-web/src/queries/useMarketData.ts
  • apps/deploy-web/src/queries/useMarketData.spec.tsx
  • apps/deploy-web/src/pages/api/auth/[...auth0].ts
  • apps/deploy-web/src/services/http/http-browser.service.ts
  • apps/deploy-web/src/components/providers/ProviderRawData/ProviderRawData.spec.tsx
  • apps/deploy-web/src/queries/useGpuQuery.ts
  • apps/deploy-web/src/queries/featureFlags.ts
**/*.spec.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/no-jest-mock.mdc)

Don't use jest.mock() to mock dependencies in test files. Instead, use jest-mock-extended to create mocks and pass mocks as dependencies to the service under test.

**/*.spec.{ts,tsx}: Use setup function instead of beforeEach in test files
setup function must be at the bottom of the root describe block in test files
setup function creates an object under test and returns it
setup function should accept a single parameter with inline type definition
Don't use shared state in setup function
Don't specify return type of setup function

Files:

  • apps/deploy-web/src/queries/useMarketData.spec.tsx
  • apps/deploy-web/src/components/providers/ProviderRawData/ProviderRawData.spec.tsx
apps/{deploy-web,provider-console}/**/*.spec.tsx

📄 CodeRabbit Inference Engine (.cursor/rules/query-by-in-tests.mdc)

Use queryBy methods instead of getBy methods in test expectations in .spec.tsx files

Files:

  • apps/deploy-web/src/queries/useMarketData.spec.tsx
  • apps/deploy-web/src/components/providers/ProviderRawData/ProviderRawData.spec.tsx
🧠 Learnings (9)
📓 Common learnings
Learnt from: jzsfkzm
PR: akash-network/console#1372
File: apps/api/src/transaction/services/transaction/transaction.service.ts:13-15
Timestamp: 2025-05-28T20:10:28.008Z
Learning: In the Akash Network console API, input validation is preferably handled at the schema level rather than in service methods to maintain clean separation of concerns and consistent validation across endpoints.
Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/query-by-in-tests.mdc:0-0
Timestamp: 2025-07-21T08:24:27.953Z
Learning: Applies to apps/{deploy-web,provider-console}/**/*.spec.tsx : Use `queryBy` methods instead of `getBy` methods in test expectations in `.spec.tsx` files
Learnt from: baktun14
PR: akash-network/console#1428
File: apps/api/src/deployment/controllers/deployment/deployment.controller.ts:0-0
Timestamp: 2025-06-03T15:06:34.211Z
Learning: The `getByOwnerAndDseq` method in `apps/api/src/deployment/controllers/deployment/deployment.controller.ts` is intentionally public without the `@Protected` decorator because it serves public blockchain data from an indexer, following the pattern of public blockchain APIs.
Learnt from: jzsfkzm
PR: akash-network/console#1372
File: apps/api/src/dashboard/services/stats/stats.service.ts:0-0
Timestamp: 2025-05-28T20:42:58.200Z
Learning: The user successfully implemented CosmosHttpService with retry logic using axiosRetry, exponential backoff, and proper error handling for Cosmos API calls, replacing direct axios usage in StatsService.
Learnt from: stalniy
PR: akash-network/console#1660
File: apps/deploy-web/src/components/alerts/DeploymentAlertsContainer/DeploymentAlertsContainer.spec.tsx:54-56
Timestamp: 2025-07-11T10:46:43.711Z
Learning: In apps/{deploy-web,provider-console}/**/*.spec.tsx files: Use `getBy` methods instead of `queryBy` methods when testing element presence with `toBeInTheDocument()` because `getBy` throws an error and shows DOM state when element is not found, providing better debugging information than `queryBy` which returns null.
apps/deploy-web/src/queries/useBlocksQuery.ts (4)

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/query-by-in-tests.mdc:0-0
Timestamp: 2025-07-21T08:24:27.953Z
Learning: Applies to apps/{deploy-web,provider-console}/**/*.spec.tsx : Use queryBy methods instead of getBy methods in test expectations in .spec.tsx files

Learnt from: stalniy
PR: #1660
File: apps/deploy-web/src/components/alerts/DeploymentAlertsContainer/DeploymentAlertsContainer.spec.tsx:54-56
Timestamp: 2025-07-11T10:46:43.711Z
Learning: In apps/{deploy-web,provider-console}/**/*.spec.tsx files: Use getBy methods instead of queryBy methods when testing element presence with toBeInTheDocument() because getBy throws an error and shows DOM state when element is not found, providing better debugging information than queryBy which returns null.

Learnt from: baktun14
PR: #1428
File: apps/api/src/deployment/controllers/deployment/deployment.controller.ts:0-0
Timestamp: 2025-06-03T15:06:34.211Z
Learning: The getByOwnerAndDseq method in apps/api/src/deployment/controllers/deployment/deployment.controller.ts is intentionally public without the @Protected decorator because it serves public blockchain data from an indexer, following the pattern of public blockchain APIs.

Learnt from: jzsfkzm
PR: #1372
File: apps/api/src/dashboard/services/stats/stats.service.ts:0-0
Timestamp: 2025-05-28T20:42:58.200Z
Learning: The user successfully implemented CosmosHttpService with retry logic using axiosRetry, exponential backoff, and proper error handling for Cosmos API calls, replacing direct axios usage in StatsService.

apps/deploy-web/src/queries/useProvidersQuery.ts (4)

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/query-by-in-tests.mdc:0-0
Timestamp: 2025-07-21T08:24:27.953Z
Learning: Applies to apps/{deploy-web,provider-console}/**/*.spec.tsx : Use queryBy methods instead of getBy methods in test expectations in .spec.tsx files

Learnt from: stalniy
PR: #1660
File: apps/deploy-web/src/components/alerts/DeploymentAlertsContainer/DeploymentAlertsContainer.spec.tsx:54-56
Timestamp: 2025-07-11T10:46:43.711Z
Learning: In apps/{deploy-web,provider-console}/**/*.spec.tsx files: Use getBy methods instead of queryBy methods when testing element presence with toBeInTheDocument() because getBy throws an error and shows DOM state when element is not found, providing better debugging information than queryBy which returns null.

Learnt from: baktun14
PR: #1428
File: apps/api/src/deployment/controllers/deployment/deployment.controller.ts:0-0
Timestamp: 2025-06-03T15:06:34.211Z
Learning: The getByOwnerAndDseq method in apps/api/src/deployment/controllers/deployment/deployment.controller.ts is intentionally public without the @Protected decorator because it serves public blockchain data from an indexer, following the pattern of public blockchain APIs.

Learnt from: jzsfkzm
PR: #1372
File: apps/api/src/dashboard/services/stats/stats.service.ts:0-0
Timestamp: 2025-05-28T20:42:58.200Z
Learning: The user successfully implemented CosmosHttpService with retry logic using axiosRetry, exponential backoff, and proper error handling for Cosmos API calls, replacing direct axios usage in StatsService.

apps/deploy-web/src/queries/useMarketData.ts (2)

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/query-by-in-tests.mdc:0-0
Timestamp: 2025-07-21T08:24:27.953Z
Learning: Applies to apps/{deploy-web,provider-console}/**/*.spec.tsx : Use queryBy methods instead of getBy methods in test expectations in .spec.tsx files

Learnt from: baktun14
PR: #1428
File: apps/api/src/deployment/controllers/deployment/deployment.controller.ts:0-0
Timestamp: 2025-06-03T15:06:34.211Z
Learning: The getByOwnerAndDseq method in apps/api/src/deployment/controllers/deployment/deployment.controller.ts is intentionally public without the @Protected decorator because it serves public blockchain data from an indexer, following the pattern of public blockchain APIs.

apps/deploy-web/src/queries/useMarketData.spec.tsx (9)

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/query-by-in-tests.mdc:0-0
Timestamp: 2025-07-21T08:24:27.953Z
Learning: Applies to apps/{deploy-web,provider-console}/**/*.spec.tsx : Use queryBy methods instead of getBy methods in test expectations in .spec.tsx files

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/no-jest-mock.mdc:0-0
Timestamp: 2025-07-21T08:24:24.269Z
Learning: Applies to **/*.spec.{ts,tsx} : Don't use jest.mock() to mock dependencies in test files. Instead, use jest-mock-extended to create mocks and pass mocks as dependencies to the service under test.

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : Use setup function instead of beforeEach in test files

Learnt from: stalniy
PR: #1660
File: apps/deploy-web/src/components/alerts/DeploymentAlertsContainer/DeploymentAlertsContainer.spec.tsx:54-56
Timestamp: 2025-07-11T10:46:43.711Z
Learning: In apps/{deploy-web,provider-console}/**/*.spec.tsx files: Use getBy methods instead of queryBy methods when testing element presence with toBeInTheDocument() because getBy throws an error and shows DOM state when element is not found, providing better debugging information than queryBy which returns null.

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : Don't use shared state in setup function

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : Don't specify return type of setup function

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : setup function creates an object under test and returns it

Learnt from: jzsfkzm
PR: #1372
File: apps/api/src/dashboard/services/stats/stats.service.ts:0-0
Timestamp: 2025-05-28T20:42:58.200Z
Learning: The user successfully implemented CosmosHttpService with retry logic using axiosRetry, exponential backoff, and proper error handling for Cosmos API calls, replacing direct axios usage in StatsService.

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : setup function should accept a single parameter with inline type definition

apps/deploy-web/src/services/http/http-browser.service.ts (6)

Learnt from: baktun14
PR: #1428
File: apps/api/src/deployment/controllers/deployment/deployment.controller.ts:0-0
Timestamp: 2025-06-03T15:06:34.211Z
Learning: The getByOwnerAndDseq method in apps/api/src/deployment/controllers/deployment/deployment.controller.ts is intentionally public without the @Protected decorator because it serves public blockchain data from an indexer, following the pattern of public blockchain APIs.

Learnt from: jzsfkzm
PR: #1372
File: apps/api/src/dashboard/services/stats/stats.service.ts:0-0
Timestamp: 2025-05-28T20:42:58.200Z
Learning: The user successfully implemented CosmosHttpService with retry logic using axiosRetry, exponential backoff, and proper error handling for Cosmos API calls, replacing direct axios usage in StatsService.

Learnt from: jzsfkzm
PR: #1364
File: apps/api/src/provider/routes/provider-deployments/provider-deployments.router.ts:38-44
Timestamp: 2025-05-25T19:37:00.800Z
Learning: The Akash Console API uses centralized error handling through the OpenApiHonoHandler's defaultHook, which automatically processes errors via HonoErrorHandlerService. Individual route handlers do not use explicit try-catch blocks and instead rely on this framework-level error handling mechanism.

Learnt from: stalniy
PR: #1353
File: apps/deploy-web/src/config/browser-env.config.ts:0-0
Timestamp: 2025-05-22T14:25:01.336Z
Learning: For the __AK_INJECTED_CONFIG__ global window property in the Akash Network Console, security is handled through cryptographic signature verification using a public key rather than property protection mechanisms like Object.defineProperty.

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-07-21T08:24:19.412Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Never use deprecated methods from libraries.

Learnt from: ygrishajev
PR: #1461
File: apps/notifications/src/modules/alert/services/deployment-alert/deployment-alert.service.ts:194-197
Timestamp: 2025-06-10T14:19:14.122Z
Learning: The alert.CONSOLE_WEB_URL environment variable in the notifications app is controlled and configured by the Akash team, reducing XSS concerns for HTML link generation in alert messages.

apps/deploy-web/src/components/providers/ProviderRawData/ProviderRawData.spec.tsx (9)

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/query-by-in-tests.mdc:0-0
Timestamp: 2025-07-21T08:24:27.953Z
Learning: Applies to apps/{deploy-web,provider-console}/**/*.spec.tsx : Use queryBy methods instead of getBy methods in test expectations in .spec.tsx files

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/no-jest-mock.mdc:0-0
Timestamp: 2025-07-21T08:24:24.269Z
Learning: Applies to **/*.spec.{ts,tsx} : Don't use jest.mock() to mock dependencies in test files. Instead, use jest-mock-extended to create mocks and pass mocks as dependencies to the service under test.

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : setup function creates an object under test and returns it

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : Use setup function instead of beforeEach in test files

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : setup function should accept a single parameter with inline type definition

Learnt from: stalniy
PR: #1436
File: apps/api/src/provider/repositories/provider/provider.repository.ts:79-90
Timestamp: 2025-06-08T03:07:13.871Z
Learning: The getProvidersHostUriByAttributes method in apps/api/src/provider/repositories/provider/provider.repository.ts already has comprehensive test coverage in provider.repository.spec.ts, including tests for complex HAVING clause logic with COUNT(*) FILTER (WHERE ...) syntax, signature conditions (anyOf/allOf), and glob pattern matching.

Learnt from: stalniy
PR: #1660
File: apps/deploy-web/src/components/alerts/DeploymentAlertsContainer/DeploymentAlertsContainer.spec.tsx:54-56
Timestamp: 2025-07-11T10:46:43.711Z
Learning: In apps/{deploy-web,provider-console}/**/*.spec.tsx files: Use getBy methods instead of queryBy methods when testing element presence with toBeInTheDocument() because getBy throws an error and shows DOM state when element is not found, providing better debugging information than queryBy which returns null.

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : Don't use shared state in setup function

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : Don't specify return type of setup function

apps/deploy-web/src/queries/useGpuQuery.ts (2)

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/query-by-in-tests.mdc:0-0
Timestamp: 2025-07-21T08:24:27.953Z
Learning: Applies to apps/{deploy-web,provider-console}/**/*.spec.tsx : Use queryBy methods instead of getBy methods in test expectations in .spec.tsx files

Learnt from: stalniy
PR: #1660
File: apps/deploy-web/src/components/alerts/DeploymentAlertsContainer/DeploymentAlertsContainer.spec.tsx:54-56
Timestamp: 2025-07-11T10:46:43.711Z
Learning: In apps/{deploy-web,provider-console}/**/*.spec.tsx files: Use getBy methods instead of queryBy methods when testing element presence with toBeInTheDocument() because getBy throws an error and shows DOM state when element is not found, providing better debugging information than queryBy which returns null.

apps/deploy-web/src/queries/featureFlags.ts (3)

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/query-by-in-tests.mdc:0-0
Timestamp: 2025-07-21T08:24:27.953Z
Learning: Applies to apps/{deploy-web,provider-console}/**/*.spec.tsx : Use queryBy methods instead of getBy methods in test expectations in .spec.tsx files

Learnt from: stalniy
PR: #1660
File: apps/deploy-web/src/components/alerts/DeploymentAlertsContainer/DeploymentAlertsContainer.spec.tsx:54-56
Timestamp: 2025-07-11T10:46:43.711Z
Learning: In apps/{deploy-web,provider-console}/**/*.spec.tsx files: Use getBy methods instead of queryBy methods when testing element presence with toBeInTheDocument() because getBy throws an error and shows DOM state when element is not found, providing better debugging information than queryBy which returns null.

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-07-21T08:24:19.412Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Never use deprecated methods from libraries.

🧬 Code Graph Analysis (6)
apps/deploy-web/src/queries/useBlocksQuery.ts (2)
apps/deploy-web/src/context/ServicesProvider/ServicesProvider.tsx (1)
  • useServices (28-30)
apps/deploy-web/src/utils/apiUtils.ts (1)
  • ApiUrlService (7-132)
apps/deploy-web/src/queries/useProvidersQuery.ts (3)
apps/deploy-web/src/context/ServicesProvider/ServicesProvider.tsx (1)
  • useServices (28-30)
apps/deploy-web/src/queries/queryKeys.ts (1)
  • QueryKeys (1-107)
apps/deploy-web/src/utils/apiUtils.ts (1)
  • ApiUrlService (7-132)
apps/deploy-web/src/queries/useMarketData.ts (2)
apps/deploy-web/src/context/ServicesProvider/ServicesProvider.tsx (1)
  • useServices (28-30)
apps/deploy-web/src/utils/apiUtils.ts (1)
  • ApiUrlService (7-132)
apps/deploy-web/src/pages/api/auth/[...auth0].ts (2)
apps/deploy-web/src/services/http/http-browser.service.ts (1)
  • services (21-39)
apps/deploy-web/src/services/http/http-server.service.ts (1)
  • services (22-32)
apps/deploy-web/src/services/http/http-browser.service.ts (1)
apps/deploy-web/src/services/http/http-server.service.ts (1)
  • services (22-32)
apps/deploy-web/src/queries/featureFlags.ts (2)
apps/deploy-web/src/context/ServicesProvider/ServicesProvider.tsx (1)
  • useServices (28-30)
apps/deploy-web/src/queries/queryKeys.ts (1)
  • QueryKeys (1-107)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{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/deploy-web/src/queries/useBlocksQuery.ts
  • apps/deploy-web/src/queries/useProvidersQuery.ts
  • apps/deploy-web/src/queries/useMarketData.ts
  • apps/deploy-web/src/queries/useMarketData.spec.tsx
  • apps/deploy-web/src/pages/api/auth/[...auth0].ts
  • apps/deploy-web/src/services/http/http-browser.service.ts
  • apps/deploy-web/src/components/providers/ProviderRawData/ProviderRawData.spec.tsx
  • apps/deploy-web/src/queries/useGpuQuery.ts
  • apps/deploy-web/src/queries/featureFlags.ts
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/general.mdc)

**/*.{js,jsx,ts,tsx}: Never use deprecated methods from libraries.
Don't add unnecessary comments to the code

Files:

  • apps/deploy-web/src/queries/useBlocksQuery.ts
  • apps/deploy-web/src/queries/useProvidersQuery.ts
  • apps/deploy-web/src/queries/useMarketData.ts
  • apps/deploy-web/src/queries/useMarketData.spec.tsx
  • apps/deploy-web/src/pages/api/auth/[...auth0].ts
  • apps/deploy-web/src/services/http/http-browser.service.ts
  • apps/deploy-web/src/components/providers/ProviderRawData/ProviderRawData.spec.tsx
  • apps/deploy-web/src/queries/useGpuQuery.ts
  • apps/deploy-web/src/queries/featureFlags.ts
**/*.spec.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/no-jest-mock.mdc)

Don't use jest.mock() to mock dependencies in test files. Instead, use jest-mock-extended to create mocks and pass mocks as dependencies to the service under test.

**/*.spec.{ts,tsx}: Use setup function instead of beforeEach in test files
setup function must be at the bottom of the root describe block in test files
setup function creates an object under test and returns it
setup function should accept a single parameter with inline type definition
Don't use shared state in setup function
Don't specify return type of setup function

Files:

  • apps/deploy-web/src/queries/useMarketData.spec.tsx
  • apps/deploy-web/src/components/providers/ProviderRawData/ProviderRawData.spec.tsx
apps/{deploy-web,provider-console}/**/*.spec.tsx

📄 CodeRabbit Inference Engine (.cursor/rules/query-by-in-tests.mdc)

Use queryBy methods instead of getBy methods in test expectations in .spec.tsx files

Files:

  • apps/deploy-web/src/queries/useMarketData.spec.tsx
  • apps/deploy-web/src/components/providers/ProviderRawData/ProviderRawData.spec.tsx
🧠 Learnings (9)
📓 Common learnings
Learnt from: jzsfkzm
PR: akash-network/console#1372
File: apps/api/src/transaction/services/transaction/transaction.service.ts:13-15
Timestamp: 2025-05-28T20:10:28.008Z
Learning: In the Akash Network console API, input validation is preferably handled at the schema level rather than in service methods to maintain clean separation of concerns and consistent validation across endpoints.
Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/query-by-in-tests.mdc:0-0
Timestamp: 2025-07-21T08:24:27.953Z
Learning: Applies to apps/{deploy-web,provider-console}/**/*.spec.tsx : Use `queryBy` methods instead of `getBy` methods in test expectations in `.spec.tsx` files
Learnt from: baktun14
PR: akash-network/console#1428
File: apps/api/src/deployment/controllers/deployment/deployment.controller.ts:0-0
Timestamp: 2025-06-03T15:06:34.211Z
Learning: The `getByOwnerAndDseq` method in `apps/api/src/deployment/controllers/deployment/deployment.controller.ts` is intentionally public without the `@Protected` decorator because it serves public blockchain data from an indexer, following the pattern of public blockchain APIs.
Learnt from: jzsfkzm
PR: akash-network/console#1372
File: apps/api/src/dashboard/services/stats/stats.service.ts:0-0
Timestamp: 2025-05-28T20:42:58.200Z
Learning: The user successfully implemented CosmosHttpService with retry logic using axiosRetry, exponential backoff, and proper error handling for Cosmos API calls, replacing direct axios usage in StatsService.
Learnt from: stalniy
PR: akash-network/console#1660
File: apps/deploy-web/src/components/alerts/DeploymentAlertsContainer/DeploymentAlertsContainer.spec.tsx:54-56
Timestamp: 2025-07-11T10:46:43.711Z
Learning: In apps/{deploy-web,provider-console}/**/*.spec.tsx files: Use `getBy` methods instead of `queryBy` methods when testing element presence with `toBeInTheDocument()` because `getBy` throws an error and shows DOM state when element is not found, providing better debugging information than `queryBy` which returns null.
apps/deploy-web/src/queries/useBlocksQuery.ts (4)

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/query-by-in-tests.mdc:0-0
Timestamp: 2025-07-21T08:24:27.953Z
Learning: Applies to apps/{deploy-web,provider-console}/**/*.spec.tsx : Use queryBy methods instead of getBy methods in test expectations in .spec.tsx files

Learnt from: stalniy
PR: #1660
File: apps/deploy-web/src/components/alerts/DeploymentAlertsContainer/DeploymentAlertsContainer.spec.tsx:54-56
Timestamp: 2025-07-11T10:46:43.711Z
Learning: In apps/{deploy-web,provider-console}/**/*.spec.tsx files: Use getBy methods instead of queryBy methods when testing element presence with toBeInTheDocument() because getBy throws an error and shows DOM state when element is not found, providing better debugging information than queryBy which returns null.

Learnt from: baktun14
PR: #1428
File: apps/api/src/deployment/controllers/deployment/deployment.controller.ts:0-0
Timestamp: 2025-06-03T15:06:34.211Z
Learning: The getByOwnerAndDseq method in apps/api/src/deployment/controllers/deployment/deployment.controller.ts is intentionally public without the @Protected decorator because it serves public blockchain data from an indexer, following the pattern of public blockchain APIs.

Learnt from: jzsfkzm
PR: #1372
File: apps/api/src/dashboard/services/stats/stats.service.ts:0-0
Timestamp: 2025-05-28T20:42:58.200Z
Learning: The user successfully implemented CosmosHttpService with retry logic using axiosRetry, exponential backoff, and proper error handling for Cosmos API calls, replacing direct axios usage in StatsService.

apps/deploy-web/src/queries/useProvidersQuery.ts (4)

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/query-by-in-tests.mdc:0-0
Timestamp: 2025-07-21T08:24:27.953Z
Learning: Applies to apps/{deploy-web,provider-console}/**/*.spec.tsx : Use queryBy methods instead of getBy methods in test expectations in .spec.tsx files

Learnt from: stalniy
PR: #1660
File: apps/deploy-web/src/components/alerts/DeploymentAlertsContainer/DeploymentAlertsContainer.spec.tsx:54-56
Timestamp: 2025-07-11T10:46:43.711Z
Learning: In apps/{deploy-web,provider-console}/**/*.spec.tsx files: Use getBy methods instead of queryBy methods when testing element presence with toBeInTheDocument() because getBy throws an error and shows DOM state when element is not found, providing better debugging information than queryBy which returns null.

Learnt from: baktun14
PR: #1428
File: apps/api/src/deployment/controllers/deployment/deployment.controller.ts:0-0
Timestamp: 2025-06-03T15:06:34.211Z
Learning: The getByOwnerAndDseq method in apps/api/src/deployment/controllers/deployment/deployment.controller.ts is intentionally public without the @Protected decorator because it serves public blockchain data from an indexer, following the pattern of public blockchain APIs.

Learnt from: jzsfkzm
PR: #1372
File: apps/api/src/dashboard/services/stats/stats.service.ts:0-0
Timestamp: 2025-05-28T20:42:58.200Z
Learning: The user successfully implemented CosmosHttpService with retry logic using axiosRetry, exponential backoff, and proper error handling for Cosmos API calls, replacing direct axios usage in StatsService.

apps/deploy-web/src/queries/useMarketData.ts (2)

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/query-by-in-tests.mdc:0-0
Timestamp: 2025-07-21T08:24:27.953Z
Learning: Applies to apps/{deploy-web,provider-console}/**/*.spec.tsx : Use queryBy methods instead of getBy methods in test expectations in .spec.tsx files

Learnt from: baktun14
PR: #1428
File: apps/api/src/deployment/controllers/deployment/deployment.controller.ts:0-0
Timestamp: 2025-06-03T15:06:34.211Z
Learning: The getByOwnerAndDseq method in apps/api/src/deployment/controllers/deployment/deployment.controller.ts is intentionally public without the @Protected decorator because it serves public blockchain data from an indexer, following the pattern of public blockchain APIs.

apps/deploy-web/src/queries/useMarketData.spec.tsx (9)

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/query-by-in-tests.mdc:0-0
Timestamp: 2025-07-21T08:24:27.953Z
Learning: Applies to apps/{deploy-web,provider-console}/**/*.spec.tsx : Use queryBy methods instead of getBy methods in test expectations in .spec.tsx files

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/no-jest-mock.mdc:0-0
Timestamp: 2025-07-21T08:24:24.269Z
Learning: Applies to **/*.spec.{ts,tsx} : Don't use jest.mock() to mock dependencies in test files. Instead, use jest-mock-extended to create mocks and pass mocks as dependencies to the service under test.

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : Use setup function instead of beforeEach in test files

Learnt from: stalniy
PR: #1660
File: apps/deploy-web/src/components/alerts/DeploymentAlertsContainer/DeploymentAlertsContainer.spec.tsx:54-56
Timestamp: 2025-07-11T10:46:43.711Z
Learning: In apps/{deploy-web,provider-console}/**/*.spec.tsx files: Use getBy methods instead of queryBy methods when testing element presence with toBeInTheDocument() because getBy throws an error and shows DOM state when element is not found, providing better debugging information than queryBy which returns null.

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : Don't use shared state in setup function

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : Don't specify return type of setup function

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : setup function creates an object under test and returns it

Learnt from: jzsfkzm
PR: #1372
File: apps/api/src/dashboard/services/stats/stats.service.ts:0-0
Timestamp: 2025-05-28T20:42:58.200Z
Learning: The user successfully implemented CosmosHttpService with retry logic using axiosRetry, exponential backoff, and proper error handling for Cosmos API calls, replacing direct axios usage in StatsService.

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : setup function should accept a single parameter with inline type definition

apps/deploy-web/src/services/http/http-browser.service.ts (6)

Learnt from: baktun14
PR: #1428
File: apps/api/src/deployment/controllers/deployment/deployment.controller.ts:0-0
Timestamp: 2025-06-03T15:06:34.211Z
Learning: The getByOwnerAndDseq method in apps/api/src/deployment/controllers/deployment/deployment.controller.ts is intentionally public without the @Protected decorator because it serves public blockchain data from an indexer, following the pattern of public blockchain APIs.

Learnt from: jzsfkzm
PR: #1372
File: apps/api/src/dashboard/services/stats/stats.service.ts:0-0
Timestamp: 2025-05-28T20:42:58.200Z
Learning: The user successfully implemented CosmosHttpService with retry logic using axiosRetry, exponential backoff, and proper error handling for Cosmos API calls, replacing direct axios usage in StatsService.

Learnt from: jzsfkzm
PR: #1364
File: apps/api/src/provider/routes/provider-deployments/provider-deployments.router.ts:38-44
Timestamp: 2025-05-25T19:37:00.800Z
Learning: The Akash Console API uses centralized error handling through the OpenApiHonoHandler's defaultHook, which automatically processes errors via HonoErrorHandlerService. Individual route handlers do not use explicit try-catch blocks and instead rely on this framework-level error handling mechanism.

Learnt from: stalniy
PR: #1353
File: apps/deploy-web/src/config/browser-env.config.ts:0-0
Timestamp: 2025-05-22T14:25:01.336Z
Learning: For the __AK_INJECTED_CONFIG__ global window property in the Akash Network Console, security is handled through cryptographic signature verification using a public key rather than property protection mechanisms like Object.defineProperty.

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-07-21T08:24:19.412Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Never use deprecated methods from libraries.

Learnt from: ygrishajev
PR: #1461
File: apps/notifications/src/modules/alert/services/deployment-alert/deployment-alert.service.ts:194-197
Timestamp: 2025-06-10T14:19:14.122Z
Learning: The alert.CONSOLE_WEB_URL environment variable in the notifications app is controlled and configured by the Akash team, reducing XSS concerns for HTML link generation in alert messages.

apps/deploy-web/src/components/providers/ProviderRawData/ProviderRawData.spec.tsx (9)

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/query-by-in-tests.mdc:0-0
Timestamp: 2025-07-21T08:24:27.953Z
Learning: Applies to apps/{deploy-web,provider-console}/**/*.spec.tsx : Use queryBy methods instead of getBy methods in test expectations in .spec.tsx files

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/no-jest-mock.mdc:0-0
Timestamp: 2025-07-21T08:24:24.269Z
Learning: Applies to **/*.spec.{ts,tsx} : Don't use jest.mock() to mock dependencies in test files. Instead, use jest-mock-extended to create mocks and pass mocks as dependencies to the service under test.

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : setup function creates an object under test and returns it

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : Use setup function instead of beforeEach in test files

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : setup function should accept a single parameter with inline type definition

Learnt from: stalniy
PR: #1436
File: apps/api/src/provider/repositories/provider/provider.repository.ts:79-90
Timestamp: 2025-06-08T03:07:13.871Z
Learning: The getProvidersHostUriByAttributes method in apps/api/src/provider/repositories/provider/provider.repository.ts already has comprehensive test coverage in provider.repository.spec.ts, including tests for complex HAVING clause logic with COUNT(*) FILTER (WHERE ...) syntax, signature conditions (anyOf/allOf), and glob pattern matching.

Learnt from: stalniy
PR: #1660
File: apps/deploy-web/src/components/alerts/DeploymentAlertsContainer/DeploymentAlertsContainer.spec.tsx:54-56
Timestamp: 2025-07-11T10:46:43.711Z
Learning: In apps/{deploy-web,provider-console}/**/*.spec.tsx files: Use getBy methods instead of queryBy methods when testing element presence with toBeInTheDocument() because getBy throws an error and shows DOM state when element is not found, providing better debugging information than queryBy which returns null.

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : Don't use shared state in setup function

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/setup-instead-of-before-each.mdc:0-0
Timestamp: 2025-07-21T08:25:07.474Z
Learning: Applies to **/*.spec.{ts,tsx} : Don't specify return type of setup function

apps/deploy-web/src/queries/useGpuQuery.ts (2)

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/query-by-in-tests.mdc:0-0
Timestamp: 2025-07-21T08:24:27.953Z
Learning: Applies to apps/{deploy-web,provider-console}/**/*.spec.tsx : Use queryBy methods instead of getBy methods in test expectations in .spec.tsx files

Learnt from: stalniy
PR: #1660
File: apps/deploy-web/src/components/alerts/DeploymentAlertsContainer/DeploymentAlertsContainer.spec.tsx:54-56
Timestamp: 2025-07-11T10:46:43.711Z
Learning: In apps/{deploy-web,provider-console}/**/*.spec.tsx files: Use getBy methods instead of queryBy methods when testing element presence with toBeInTheDocument() because getBy throws an error and shows DOM state when element is not found, providing better debugging information than queryBy which returns null.

apps/deploy-web/src/queries/featureFlags.ts (3)

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/query-by-in-tests.mdc:0-0
Timestamp: 2025-07-21T08:24:27.953Z
Learning: Applies to apps/{deploy-web,provider-console}/**/*.spec.tsx : Use queryBy methods instead of getBy methods in test expectations in .spec.tsx files

Learnt from: stalniy
PR: #1660
File: apps/deploy-web/src/components/alerts/DeploymentAlertsContainer/DeploymentAlertsContainer.spec.tsx:54-56
Timestamp: 2025-07-11T10:46:43.711Z
Learning: In apps/{deploy-web,provider-console}/**/*.spec.tsx files: Use getBy methods instead of queryBy methods when testing element presence with toBeInTheDocument() because getBy throws an error and shows DOM state when element is not found, providing better debugging information than queryBy which returns null.

Learnt from: CR
PR: akash-network/console#0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-07-21T08:24:19.412Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Never use deprecated methods from libraries.

🧬 Code Graph Analysis (6)
apps/deploy-web/src/queries/useBlocksQuery.ts (2)
apps/deploy-web/src/context/ServicesProvider/ServicesProvider.tsx (1)
  • useServices (28-30)
apps/deploy-web/src/utils/apiUtils.ts (1)
  • ApiUrlService (7-132)
apps/deploy-web/src/queries/useProvidersQuery.ts (3)
apps/deploy-web/src/context/ServicesProvider/ServicesProvider.tsx (1)
  • useServices (28-30)
apps/deploy-web/src/queries/queryKeys.ts (1)
  • QueryKeys (1-107)
apps/deploy-web/src/utils/apiUtils.ts (1)
  • ApiUrlService (7-132)
apps/deploy-web/src/queries/useMarketData.ts (2)
apps/deploy-web/src/context/ServicesProvider/ServicesProvider.tsx (1)
  • useServices (28-30)
apps/deploy-web/src/utils/apiUtils.ts (1)
  • ApiUrlService (7-132)
apps/deploy-web/src/pages/api/auth/[...auth0].ts (2)
apps/deploy-web/src/services/http/http-browser.service.ts (1)
  • services (21-39)
apps/deploy-web/src/services/http/http-server.service.ts (1)
  • services (22-32)
apps/deploy-web/src/services/http/http-browser.service.ts (1)
apps/deploy-web/src/services/http/http-server.service.ts (1)
  • services (22-32)
apps/deploy-web/src/queries/featureFlags.ts (2)
apps/deploy-web/src/context/ServicesProvider/ServicesProvider.tsx (1)
  • useServices (28-30)
apps/deploy-web/src/queries/queryKeys.ts (1)
  • QueryKeys (1-107)
⏰ 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 (14)
apps/deploy-web/src/services/http/http-browser.service.ts (1)

37-38: LGTM! Temporary solution properly implemented.

The publicConsoleApiHttpClient service correctly implements the interim solution for separating public API access. The lack of base URL and interceptors is appropriate for public endpoints that may need different configurations.

apps/deploy-web/src/queries/useBlocksQuery.ts (1)

23-26: Confirm absolute URL in ApiUrlService.blocks()

I wasn’t able to locate the blocks(limit) implementation via automated search in

  • apps/deploy-web/src/services/api-url/api-url.service.ts
  • apps/deploy-web/src/utils/apiUtils.ts

Since publicConsoleApiHttpClient has no base URL, please manually verify that
ApiUrlService.blocks(limit) returns a fully qualified URL (including protocol and domain) rather than a relative path.

apps/deploy-web/src/queries/useGpuQuery.ts (1)

9-12: URL completeness verified

ApiUrlService.gpuModels() returns ${this.baseApiUrl}/v1/gpu-models, and baseApiUrl is sourced from the environment variables (NEXT_PUBLIC_BASE_API_MAINNET_URL, etc.) via getBaseApiUrlFor(). This guarantees a fully qualified URL even when using publicConsoleApiHttpClient without a default baseURL. No further changes needed.

apps/deploy-web/src/queries/useMarketData.ts (1)

10-13: Confirmed full URLs from ApiUrlService.marketData()

The marketData() method returns ${this.baseApiUrl}/v1/market-data, and getBaseApiUrlFor resolves to the full BASE_API_* or NEXT_PUBLIC_BASE_API_* URL (including protocol) for the selected network. The switch to publicConsoleApiHttpClient is correct—no further changes are required.

apps/deploy-web/src/pages/api/auth/[...auth0].ts (1)

67-67: LGTM! Good refactoring to centralize API URL management.

The change from direct configuration access to using the apiUrlService.getBaseApiUrlFor("mainnet") method improves maintainability and consistency across the codebase.

apps/deploy-web/src/queries/useProvidersQuery.ts (7)

16-16: LGTM! Correct usage of public client for provider detail endpoint.

Using publicConsoleApiHttpClient is appropriate for the provider detail endpoint as it's a public API that doesn't require user authentication.

Also applies to: 21-21


52-52: LGTM! Correct usage of public client for network capacity endpoint.

Using publicConsoleApiHttpClient is appropriate for the network capacity endpoint as it provides public blockchain data.

Also applies to: 55-55


61-61: LGTM! Correct usage of public client for auditors endpoint.

Using publicConsoleApiHttpClient is appropriate for the auditors endpoint as it provides public blockchain data.

Also applies to: 64-64


74-74: LGTM! Correct usage of public client for provider active leases graph.

Using publicConsoleApiHttpClient is appropriate for the provider active leases graph endpoint as it provides public blockchain data.

Also applies to: 77-77


83-83: LGTM! Correct usage of public client for provider attributes schema.

Using publicConsoleApiHttpClient is appropriate for the provider attributes schema endpoint as it provides public configuration data.

Also applies to: 86-86


96-96: LGTM! Correct usage of public client for provider list endpoint.

Using publicConsoleApiHttpClient is appropriate for the provider list endpoint as it provides public blockchain data.

Also applies to: 99-99


105-105: LGTM! Correct usage of public client for provider regions endpoint.

Using publicConsoleApiHttpClient is appropriate for the provider regions endpoint as it provides public configuration data.

Also applies to: 108-108

apps/deploy-web/src/components/providers/ProviderRawData/ProviderRawData.spec.tsx (1)

23-33: LGTM! Test mocks updated correctly to match implementation changes.

The test setup has been properly updated to mock publicConsoleApiHttpClient instead of consoleApiHttpClient, maintaining the same mock behavior while aligning with the new service structure.

Also applies to: 49-49

apps/deploy-web/src/queries/featureFlags.ts (1)

14-14: LGTM! Correct usage of public client for feature flags.

Using publicConsoleApiHttpClient is appropriate for the feature flags endpoint as it provides public configuration data.

Also applies to: 19-19

@stalniy stalniy force-pushed the fix/consoleapi-access branch from 089bb94 to e47f8a7 Compare July 22, 2025 11:51
ygrishajev
ygrishajev previously approved these changes Jul 22, 2025
@stalniy stalniy force-pushed the fix/consoleapi-access branch from 4834df5 to ad2af98 Compare July 22, 2025 12:13
@stalniy stalniy merged commit f817d47 into main Jul 22, 2025
61 of 62 checks passed
@stalniy stalniy deleted the fix/consoleapi-access branch July 22, 2025 12:23
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.

2 participants

Comments