Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

refactor: remove fixed LimitRange enforcement from form data processing#1519

Open
KUASWoodyLIN wants to merge 1 commit intomainfrom
change-limit-range-config
Open

refactor: remove fixed LimitRange enforcement from form data processing#1519
KUASWoodyLIN wants to merge 1 commit intomainfrom
change-limit-range-config

Conversation

@KUASWoodyLIN
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings February 9, 2026 03:06
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @KUASWoodyLIN, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This refactoring streamlines the workspace creation process by removing a static, hardcoded constraint on resource allocation. By no longer enforcing a fixed LimitRange, the system gains enhanced flexibility, allowing for more dynamic or externally defined resource configurations rather than being tied to a predetermined default.

Highlights

  • Removed Fixed LimitRange Enforcement: The pull request eliminates the hardcoded enforcement of a fixed Kubernetes LimitRange configuration within the workspace creation form's data processing. Previously, this logic set default CPU and memory limits and requests to '500m' and '512Mi' respectively for containers.
Changelog
  • web/src/lib/components/form/workspace/create-form.svelte
    • Removed the code block responsible for enforcing a fixed LimitRange that set default CPU and memory (500m CPU, 512Mi memory) for container limits and requests within the spec.limitRange object.
Activity
  • No specific activity (comments, reviews, etc.) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the workspace creation form by removing a hardcoded LimitRange enforcement from the transformFormData function. This is a positive change as it removes a magic value override and makes the component's behavior more predictable. The limitRange from the initialData object will now be correctly used, centralizing the default configuration and improving maintainability. The change is clean and aligns with the stated goal.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes the submit-time overwrite that forced a hard-coded spec.limitRange during workspace creation, so the manifest uses whatever LimitRange is already present in the form data.

Changes:

  • Deleted the transformFormData logic that overwrote spec.limitRange with fixed CPU/memory defaults.
  • Workspace creation now retains spec.limitRange from initialData / form state rather than enforcing a constant at submit time.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 126 to 133
// Handle Resource Quota Logic: limits align with requests, strict defaults
if (spec?.resourceQuota?.hard) {
const hard = spec.resourceQuota.hard;
// Sync limits with requests
if (hard['requests.cpu']) hard['limits.cpu'] = hard['requests.cpu'];
if (hard['requests.memory']) hard['limits.memory'] = hard['requests.memory'];
}

// Enforce fixed LimitRange
if (spec) {
spec.limitRange = {
limits: [
{
type: 'Container',
default: {
cpu: '500m',
memory: '512Mi'
},
defaultRequest: {
cpu: '500m',
memory: '512Mi'
}
}
]
};
}

return data;
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

Removing the spec.limitRange overwrite changes the effective LimitRange defaults for newly created workspaces from the previously-enforced 500m/512Mi to whatever is in initialData.spec.limitRange (currently cpu: '1', memory: '2Gi'). If the 500m/512Mi values are still the intended defaults, update initialData accordingly; otherwise, consider making this default change explicit (e.g., via PR description/changelog) since it affects resource behavior in the cluster.

Copilot uses AI. Check for mistakes.
@KUASWoodyLIN KUASWoodyLIN enabled auto-merge (squash) February 9, 2026 03:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants