Skip to content

Improvement/format all UI with biomejs#4806

Open
MonPote wants to merge 2 commits intodevelopment/131.0from
improvement/format-all-ui-with-biomejs
Open

Improvement/format all UI with biomejs#4806
MonPote wants to merge 2 commits intodevelopment/131.0from
improvement/format-all-ui-with-biomejs

Conversation

@MonPote
Copy link
Copy Markdown
Contributor

@MonPote MonPote commented Mar 3, 2026

Component:

Context:

Summary:

Acceptance criteria:


Closes: #ISSUE_NUMBER

@MonPote MonPote requested a review from a team as a code owner March 3, 2026 14:33
@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Mar 3, 2026

Hello monpote,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Mar 3, 2026

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

@MonPote
Copy link
Copy Markdown
Contributor Author

MonPote commented Mar 3, 2026

/create_integration_branches

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Mar 3, 2026

Conflict

A conflict has been raised during the creation of
integration branch w/132.0/improvement/format-all-ui-with-biomejs with contents from improvement/format-all-ui-with-biomejs
and development/132.0.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 git fetch
 git checkout -B w/132.0/improvement/format-all-ui-with-biomejs origin/development/132.0
 git merge origin/improvement/format-all-ui-with-biomejs
 # <intense conflict resolution>
 git commit
 git push -u origin w/132.0/improvement/format-all-ui-with-biomejs

The following options are set: create_integration_branches

const nodeRolesLabels = Object.keys(node.metadata.labels).filter(
(label) => label.startsWith(ROLE_PREFIX),
);
const nodeRolesLabels = Object.keys(node.metadata.labels).filter((label) => label.startsWith(ROLE_PREFIX));

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High

'
node-role.kubernetes.io
' may be followed by an arbitrary host name.

Copilot Autofix

AI 26 days ago

In general, to fix incomplete substring/prefix checks you should parse and validate the structure explicitly rather than relying on includes or startsWith on uncontrolled strings. For a Kubernetes node role label, the expected structure is exactly node-role.kubernetes.io/<role-name> with no extra suffix or additional separators in the key portion. Instead of checking label.startsWith(ROLE_PREFIX), we should ensure that the label key is of the form ROLE_PREFIX + '/' + <role-name>, where <role-name> is non-empty and does not contain another /.

In this file, the best way to fix the issue without changing existing functionality is to replace the broad startsWith(ROLE_PREFIX) filter with a stricter structural check on the label string. We can do this inline in the filter callback to avoid adding new helpers or imports. A safe check is:

  • Ensure the label key begins with ROLE_PREFIX + '/'.
  • Ensure there is only one / (so no additional path-like components in the key).

This preserves all current valid labels like node-role.kubernetes.io/master and node-role.kubernetes.io/worker, but rejects malformed or malicious labels like node-role.kubernetes.ioevil.com/worker or node-role.kubernetes.io/master/extra. The change is localized to the nodeRolesLabels computation around line 317 in ui/src/ducks/app/nodes.ts; no new imports or additional definitions are required.

Suggested changeset 1
ui/src/ducks/app/nodes.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/ui/src/ducks/app/nodes.ts b/ui/src/ducks/app/nodes.ts
--- a/ui/src/ducks/app/nodes.ts
+++ b/ui/src/ducks/app/nodes.ts
@@ -314,7 +314,14 @@
           }
 
           // the Roles of the Node should be the ones that are stored in the labels `node-role.kubernetes.io/<role-name>`
-          const nodeRolesLabels = Object.keys(node.metadata.labels).filter((label) => label.startsWith(ROLE_PREFIX));
+          const nodeRolesLabels = Object.keys(node.metadata.labels).filter((label) => {
+            // Only accept labels exactly matching the expected prefix + single role segment.
+            return (
+              label.startsWith(`${ROLE_PREFIX}/`) &&
+              // Ensure there's only one '/' (the one after the prefix)
+              label.indexOf('/', ROLE_PREFIX.length + 1) === -1
+            );
+          });
           const nodeRoles = nodeRolesLabels?.map((nRL) => nRL.split('/')[1]);
           return {
             id: node.metadata.uid,
EOF
@@ -314,7 +314,14 @@
}

// the Roles of the Node should be the ones that are stored in the labels `node-role.kubernetes.io/<role-name>`
const nodeRolesLabels = Object.keys(node.metadata.labels).filter((label) => label.startsWith(ROLE_PREFIX));
const nodeRolesLabels = Object.keys(node.metadata.labels).filter((label) => {
// Only accept labels exactly matching the expected prefix + single role segment.
return (
label.startsWith(`${ROLE_PREFIX}/`) &&
// Ensure there's only one '/' (the one after the prefix)
label.indexOf('/', ROLE_PREFIX.length + 1) === -1
);
});
const nodeRoles = nodeRolesLabels?.map((nRL) => nRL.split('/')[1]);
return {
id: node.metadata.uid,
Copilot is powered by AI and may make mistakes. Always verify output.
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