Skip to content

Conversation

@baktun14
Copy link
Contributor

@baktun14 baktun14 commented Jan 30, 2026

Summary by CodeRabbit

  • Refactor
    • Removed GPU rental feature and its associated page from the deployment application
    • Consolidated and simplified internal form type system across multiple components for improved maintainability

✏️ Tip: You can customize this high-level summary in your review settings.

@baktun14 baktun14 requested a review from a team as a code owner January 30, 2026 23:15
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

This PR removes GPU rental functionality from the deploy web application. It eliminates the RentGpusForm component, RentGpu page, and RentGpusFormValuesType references across the codebase, narrowing form control types in SDL components to use only SdlBuilderFormValuesType.

Changes

Cohort / File(s) Summary
Component Type Narrowing
apps/deploy-web/src/components/sdl/AddStorageButton.tsx, apps/deploy-web/src/components/sdl/AdvancedConfig.tsx, apps/deploy-web/src/components/sdl/CpuFormControl.tsx, apps/deploy-web/src/components/sdl/EphemeralStorageFormControl.tsx, apps/deploy-web/src/components/sdl/GpuFormControl.tsx, apps/deploy-web/src/components/sdl/ImageSelect.tsx, apps/deploy-web/src/components/sdl/MemoryFormControl.tsx, apps/deploy-web/src/components/sdl/MountedStorageFormControl.tsx
Removed RentGpusFormValuesType from control and related prop types; components now use only SdlBuilderFormValuesType in their form control generics. Updated imports accordingly.
Modal Component Update
apps/deploy-web/src/components/sdl/EnvFormModal/EnvFormModal.tsx, apps/deploy-web/src/components/sdl/EnvFormModal/EnvFormModal.spec.tsx
Narrowed EnvFormModal control prop and form typing from union with RentGpusFormValuesType to SdlBuilderFormValuesType only. Updated test mocks and type aliases.
RegionSelect Adjustment
apps/deploy-web/src/components/sdl/RegionSelect.tsx
Changed control prop type from Control<RentGpusFormValuesType, any> to Control<FieldValues, any>; replaced RentGpusFormValuesType import with FieldValues from react-hook-form.
Feature Removal
apps/deploy-web/src/components/sdl/RentGpusForm.tsx, apps/deploy-web/src/pages/rent-gpu/index.tsx
Deleted RentGpusForm component (391 lines) and RentGpu page entirely, removing the GPU rental deployment form workflow and associated UI.
Type Definitions Cleanup
apps/deploy-web/src/types/sdlBuilder.ts
Removed exported RentGpusFormValuesType, RentGpusFormValuesSchema, ProviderRegionValueType, and ProviderRegionValueSchema type definitions.
Utilities & State
apps/deploy-web/src/utils/sdl/data.ts, apps/deploy-web/src/utils/urlUtils.ts, apps/deploy-web/src/store/sdlStore.ts
Removed defaultRentGpuService and defaultAnyRegion exports from data utilities; removed static rentGpus() method from UrlService; removed rentGpuSdl atom from sdlStore default export.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • #2331: Modifies spacing in the deleted RentGpusForm.tsx file
  • #2334: Adds newLogin/newSignup methods to UrlService class alongside the removal of rentGpus()

Suggested reviewers

  • stalniy

Poem

🐰 Hop, hop, farewell GPU dreams,
No more rentals, no more schemes!
Types collapse to one clean line,
Components shrink, refactoring divine.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the primary change: removing the RentGpusForm component and all related rent GPU functionality from the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/remove-rent-gpu

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

@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.53%. Comparing base (4665f2b) to head (a35e574).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2634      +/-   ##
==========================================
- Coverage   50.91%   50.53%   -0.38%     
==========================================
  Files        1055     1018      -37     
  Lines       29781    28716    -1065     
  Branches     6713     6546     -167     
==========================================
- Hits        15162    14511     -651     
+ Misses      14335    13979     -356     
+ Partials      284      226      -58     
Flag Coverage Δ *Carryforward flag
api 78.27% <ø> (ø) Carriedforward from 4665f2b
deploy-web 32.63% <ø> (+0.38%) ⬆️
log-collector ?
notifications 87.94% <ø> (ø) Carriedforward from 4665f2b
provider-console 81.48% <ø> (ø) Carriedforward from 4665f2b
provider-proxy 84.35% <ø> (ø) Carriedforward from 4665f2b
tx-signer ?

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

Files with missing lines Coverage Δ
...deploy-web/src/components/sdl/AddStorageButton.tsx 41.66% <ø> (ø)
...s/deploy-web/src/components/sdl/AdvancedConfig.tsx 0.00% <ø> (ø)
...s/deploy-web/src/components/sdl/CpuFormControl.tsx 81.81% <ø> (ø)
...b/src/components/sdl/EnvFormModal/EnvFormModal.tsx 94.20% <ø> (ø)
...src/components/sdl/EphemeralStorageFormControl.tsx 87.50% <ø> (ø)
...s/deploy-web/src/components/sdl/GpuFormControl.tsx 0.00% <ø> (ø)
apps/deploy-web/src/components/sdl/ImageSelect.tsx 0.00% <ø> (ø)
...eploy-web/src/components/sdl/MemoryFormControl.tsx 85.71% <ø> (ø)
...b/src/components/sdl/MountedStorageFormControl.tsx 0.00% <ø> (ø)
...pps/deploy-web/src/components/sdl/RegionSelect.tsx 0.00% <ø> (ø)
... and 4 more

... and 78 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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/deploy-web/src/components/sdl/EnvFormModal/EnvFormModal.tsx (1)

26-31: ⚠️ Potential issue | 🟡 Minor

Remove the second any parameter from Control type.
Line 30 uses Control<SdlBuilderFormValuesType, any>; this violates the coding guideline against using any. Since context is not used in this component, omit the second parameter entirely, as the rest of the codebase does.

✅ Suggested fix
-  control: Control<SdlBuilderFormValuesType, any>;
+  control: Control<SdlBuilderFormValuesType>;
apps/deploy-web/src/components/sdl/MountedStorageFormControl.tsx (1)

34-42: ⚠️ Potential issue | 🟠 Major

Remove explicit any from Control type parameter.
Line 39 uses Control<SdlBuilderFormValuesType, any>; the second type parameter should be omitted to avoid explicit use of any. Use Control<SdlBuilderFormValuesType> instead.

Suggested fix
-  control: Control<SdlBuilderFormValuesType, any>;
+  control: Control<SdlBuilderFormValuesType>;

As per coding guidelines: **/*.{ts,tsx,js}: Never use type any or cast to type any. Always define the proper TypeScript types.

🤖 Fix all issues with AI agents
In `@apps/deploy-web/src/components/sdl/ImageSelect.tsx`:
- Around line 21-24: In Props in ImageSelect.tsx, remove the unnecessary any
type parameter on Control: change control: Control<SdlBuilderFormValuesType,
any> to use the single generic Control<SdlBuilderFormValuesType> (follow the
TokenFormControl.tsx pattern) so the resolver context generic is omitted; update
the Props type declaration accordingly to eliminate the use of any and keep
proper typing for control.

In `@apps/deploy-web/src/components/sdl/RegionSelect.tsx`:
- Around line 15-17: The prop type RegionSelectProps currently uses
Control<FieldValues, any> which introduces an unwanted any; update the type to
omit the second generic so it reads Control<FieldValues> (or just Control if you
prefer a fully generic control) in the RegionSelectProps declaration to remove
the no-any violation; look for the Control usage in the RegionSelectProps type
definition and replace Control<FieldValues, any> with Control<FieldValues>.

Comment on lines 21 to 24
type Props = {
children?: ReactNode;
control: Control<SdlBuilderFormValuesType | RentGpusFormValuesType, any>;
control: Control<SdlBuilderFormValuesType, any>;
currentService: ServiceType;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cd /repo && git ls-files | head -20

Repository: akash-network/console

Length of output: 120


🏁 Script executed:

# First, let me check if the repo exists and the file location
find . -name "ImageSelect.tsx" -type f

Repository: akash-network/console

Length of output: 117


🏁 Script executed:

# Check the content of the file and understand the Control type
cat -n apps/deploy-web/src/components/sdl/ImageSelect.tsx | head -50

Repository: akash-network/console

Length of output: 2868


🏁 Script executed:

# Search for imports to understand where Control comes from
rg "import.*Control" apps/deploy-web/src/components/sdl/ImageSelect.tsx

Repository: akash-network/console

Length of output: 158


🏁 Script executed:

rg "Control<" apps/deploy-web/src --type ts --type tsx -A 1 -B 1

Repository: akash-network/console

Length of output: 92


🏁 Script executed:

# Also check the react-hook-form documentation or type definitions in node_modules if available
find . -path "*/node_modules/react-hook-form/*" -name "*.d.ts" | head -5

Repository: akash-network/console

Length of output: 47


🏁 Script executed:

rg "Control<" apps/deploy-web/src -A 1 -B 1

Repository: akash-network/console

Length of output: 12993


🏁 Script executed:

# Search for all Control type definitions and usages
rg "control:" apps/deploy-web/src -A 0 -B 0 | head -20

Repository: akash-network/console

Length of output: 2243


🏁 Script executed:

# Let's check the react-hook-form package to understand the Control type signature
# First check if it's in package.json
cat package.json | grep -A 2 "react-hook-form"

Repository: akash-network/console

Length of output: 47


🏁 Script executed:

cat -n apps/deploy-web/src/components/sdl/ImageSelect.tsx | tail -100

Repository: akash-network/console

Length of output: 4312


🏁 Script executed:

# Also check the react-hook-form Control type documentation
web_search
react-hook-form Control generic parameters documentation

Repository: akash-network/console

Length of output: 169


🌐 Web query:

react-hook-form Control type generic parameters second parameter context

💡 Result:

In react-hook-form, Control is generic over:

Control<TFieldValues extends FieldValues = FieldValues, TContext = any>
  • TFieldValues: your form’s values shape.
  • TContext: the type of the “form context” object you optionally pass to useForm({ context }), which is then forwarded to your resolver as its context parameter. This is why you’ll see it wired through UseFormProps (context: TContext, resolver: Resolver<TFieldValues, TContext>) and UseFormReturn (control: Control<TFieldValues, TContext>). [1]

Example:

type FormValues = { email: string };
type MyContext = { locale: "en" | "es" };

const form = useForm<FormValues, MyContext>({
  context: { locale: "en" },
  resolver: async (values, context) => {
    // context is MyContext here
    return { values, errors: {} };
  },
});

// control is Control<FormValues, MyContext>
const { control } = form;

If you’re not using useForm({ context }) / resolver context, you can usually ignore the 2nd generic and just use Control<FormValues>. [1]

Sources:
[1] React Hook Form – TypeScript Support (shows control: Control<TFieldValues, TContext> and UseFormProps with context / resolver typed by TContext) (react-hook-form.com)

Citations:


🏁 Script executed:

# Find where the control is created - search for useForm calls in the codebase
rg "useForm" apps/deploy-web/src --type js -B 3 -A 10 | grep -A 10 "resolver\|context" | head -50

Repository: akash-network/console

Length of output: 47


🏁 Script executed:

# Check the specific component hierarchy - trace back where control comes from
# Look for the main form setup
rg "useForm<SdlBuilderFormValuesType" apps/deploy-web/src -A 15

Repository: akash-network/console

Length of output: 16298


🏁 Script executed:

# Count how many files omit vs use the second parameter
echo "Files using Control with second parameter:"
rg "Control<[^>]+, " apps/deploy-web/src | wc -l
echo ""
echo "Files using Control without second parameter:"
rg "Control<[^>]+>(?!.*,)" apps/deploy-web/src | wc -l

Repository: akash-network/console

Length of output: 415


🏁 Script executed:

# Check TokenFormControl to see the pattern
cat -n apps/deploy-web/src/components/sdl/TokenFormControl.tsx

Repository: akash-network/console

Length of output: 2324


Remove the any type parameter from Control.

Line 23 uses Control<SdlBuilderFormValuesType, any>, which violates the TypeScript guideline against using any. The second parameter represents the resolver context type, which is unused in this component since no context is passed to useForm. Follow the pattern in TokenFormControl.tsx and omit the second parameter entirely.

✅ Suggested fix
-  control: Control<SdlBuilderFormValuesType, any>;
+  control: Control<SdlBuilderFormValuesType>;

As per coding guidelines: **/*.{ts,tsx,js}: Never use type any or cast to type any. Always define the proper TypeScript types.

🤖 Prompt for AI Agents
In `@apps/deploy-web/src/components/sdl/ImageSelect.tsx` around lines 21 - 24, In
Props in ImageSelect.tsx, remove the unnecessary any type parameter on Control:
change control: Control<SdlBuilderFormValuesType, any> to use the single generic
Control<SdlBuilderFormValuesType> (follow the TokenFormControl.tsx pattern) so
the resolver context generic is omitted; update the Props type declaration
accordingly to eliminate the use of any and keep proper typing for control.

Comment on lines 15 to 17
type RegionSelectProps = {
control: Control<RentGpusFormValuesType, any>;
control: Control<FieldValues, any>;
className?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat -n apps/deploy-web/src/components/sdl/RegionSelect.tsx | head -30

Repository: akash-network/console

Length of output: 1380


🏁 Script executed:

rg "type RegionSelectProps" -A 5 apps/deploy-web/src/components/sdl/RegionSelect.tsx

Repository: akash-network/console

Length of output: 257


🏁 Script executed:

rg "import.*Control" apps/deploy-web/src/components/sdl/RegionSelect.tsx

Repository: akash-network/console

Length of output: 171


🏁 Script executed:

rg "Control<" apps/deploy-web/src/components/sdl/ -A 2 -B 2

Repository: akash-network/console

Length of output: 11183


🏁 Script executed:

cat -n apps/deploy-web/src/components/sdl/RegionSelect.tsx

Repository: akash-network/console

Length of output: 4152


🏁 Script executed:

rg "useFormContext|context" apps/deploy-web/src/components/sdl/RegionSelect.tsx

Repository: akash-network/console

Length of output: 47


🏁 Script executed:

rg "control\." apps/deploy-web/src/components/sdl/RegionSelect.tsx

Repository: akash-network/console

Length of output: 47


🏁 Script executed:

# Check if there are any existing patterns with unknown for Control context
rg "Control<.*unknown" apps/deploy-web/

Repository: akash-network/console

Length of output: 47


🏁 Script executed:

# Verify Control type signature in react-hook-form types
rg "export.*Control" node_modules/react-hook-form/dist/types/form.d.ts 2>/dev/null | head -5

Repository: akash-network/console

Length of output: 47


Omit unnecessary context generic from Control type.

Line 16 uses Control<FieldValues, any>, which violates the no-any guideline. Since the component doesn't use form context, omit the second generic parameter entirely.

✅ Suggested fix
-  control: Control<FieldValues, any>;
+  control: Control<FieldValues>;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
type RegionSelectProps = {
control: Control<RentGpusFormValuesType, any>;
control: Control<FieldValues, any>;
className?: string;
type RegionSelectProps = {
control: Control<FieldValues>;
className?: string;
🤖 Prompt for AI Agents
In `@apps/deploy-web/src/components/sdl/RegionSelect.tsx` around lines 15 - 17,
The prop type RegionSelectProps currently uses Control<FieldValues, any> which
introduces an unwanted any; update the type to omit the second generic so it
reads Control<FieldValues> (or just Control if you prefer a fully generic
control) in the RegionSelectProps declaration to remove the no-any violation;
look for the Control usage in the RegionSelectProps type definition and replace
Control<FieldValues, any> with Control<FieldValues>.

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