Skip to content
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

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

zhengkunwang223
Copy link
Member

No description provided.

Copy link

f2c-ci-robot bot commented Dec 10, 2024

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;
Copy link
Member

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:

  1. In submitModel, instead of defining both CPU and MEMORY_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
  1. 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.
  2. In JavaScript language definition, it would help if these were properly formatted and structured like they should be per best practices.
  3. 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).
  4. There's some duplication across multiple places which might confuse others reading through this codebase. Ensure each instance has appropriate imports/uses.
  5. 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.

Copy link
Member

@wanghe-fit2cloud wanghe-fit2cloud left a comment

Choose a reason for hiding this comment

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

/lgtm

@wanghe-fit2cloud
Copy link
Member

/approve

Copy link

f2c-ci-robot bot commented Dec 10, 2024

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot merged commit f01d770 into dev Dec 10, 2024
7 checks passed
@f2c-ci-robot f2c-ci-robot bot deleted the pr@dev@website branch December 10, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants