-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat: Fix Missing CPU and Memory Limit Warnings When Editing Installe… #7313
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
||
const acceptParams = async (props: ParamProps) => { | ||
loadLimit(); | ||
submitModel.value.installId = props.id; | ||
params.value = []; | ||
paramData.value.id = props.id; |
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.
In the given snippet of code, there seem to be a few areas that could be improved. Some differences and improvements suggested:
- In
submitModel
, instead of defining bothCPU
andMEMORY_LIMIT
with same validations and rules under a single key (params
), consider using different keys as you may have specific constraints on CPU Quota vs. Memory Limit.
// ... other definitions...
const submitModel = ref<{[key: string]: any}>({cpuQuota: {}, memoryLimit: {...}}); // use proper object keys for distinct validation & rule sets
- The
extensions
array is imported twice (once before extending codemirror and again after). You can import them only once at the beginning so we don't accidentally re-import them unnecessarily later. - In JavaScript language definition, it would help if these were properly formatted and structured like they should be per best practices.
- The documentation isn’t very clear about why
codeMirrorInstance
was mentioned; it seems out-of-line from rest of the code section. Consider placing it at its respective place closer to where it will be used within the component(s). - There's some duplication across multiple places which might confuse others reading through this codebase. Ensure each instance has appropriate imports/uses.
- Lastly, make note of missing
<script lang...>
tags when importing external libraries/components. This prevents errors related to incorrect file inclusion in TypeScript files.
For optimization suggestion:
Use the correct syntax when importing React components from another folder into typescript to prevent error messages during compiles. For example:
import { EditorState } from "@vue/reactivity";
Replace "EditorState" in the above line with your actual component name.
This helps keeping your .tsx code more tidy without worrying about unnecessary complexity introduced due to typing mismatching between ts and js codes leading to unexpected runtime errors.
Quality Gate passedIssues Measures |
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.
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wanghe-fit2cloud The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
No description provided.