Skip to content

cleanup: remove unused nodeNamesLen function from scheduler - #2735

Closed
KunwarSidhu47 wants to merge 2 commits into
Project-HAMi:masterfrom
KunwarSidhu47:cleanup-scheduler-dead-code
Closed

cleanup: remove unused nodeNamesLen function from scheduler#2735
KunwarSidhu47 wants to merge 2 commits into
Project-HAMi:masterfrom
KunwarSidhu47:cleanup-scheduler-dead-code

Conversation

@KunwarSidhu47

@KunwarSidhu47 KunwarSidhu47 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:
This PR removes the nodeNamesLen(nodeNames *[]string) int helper function from pkg/scheduler/scheduler.go.

During a static analysis pass, it was discovered that this function is completely unused (dead code). Removing it cleans up the scheduler package, reduces technical debt, and clears unnecessary clutter.

Since this cleanup is strictly scoped to the scheduler extender, it does not affect device allocation or in-container isolation. Therefore, it respects Contribution Guideline #2 and can be safely merged using existing testing without requiring real GPU hardware validation.

Which issue(s) this PR fixes:
Fixes #2694

Special notes for your reviewer:
This is a pure dead-code removal. No functionality has been altered.

I consulted an AI assistant to safely remove this unused code, but I manually reviewed and verified the final solution myself.

Does this PR introduce a user-facing change?:

NONE


<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **Chores**
  * Removed unused internal code without changing user-visible behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: KunwarSidhu47 <kunwarsidhu1947@gmail.com>
@hami-robot

hami-robot Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: KunwarSidhu47
Once this PR has been reviewed and has the lgtm label, please assign fouof for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e144c870-437a-4856-abb9-f5dd02894a17

📥 Commits

Reviewing files that changed from the base of the PR and between 390e7dd and 3438451.

📒 Files selected for processing (1)
  • pkg/scheduler/scheduler.go
💤 Files with no reviewable changes (1)
  • pkg/scheduler/scheduler.go

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The scheduler removes the unused private nodeNamesLen helper from pkg/scheduler/scheduler.go. No exported entities or runtime behavior change.

Changes

Cohort / File(s) Summary
Scheduler cleanup
pkg/scheduler/scheduler.go
Removes the unused private nodeNamesLen helper.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 34384

This change removes unused scheduler code without altering behavior, so no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

Suggested reviewers: chaunceyjiang

Poem

A rabbit found dead code asleep,
In the scheduler’s tidy heap.
The unused helper hopped away,
While runtime paths remained the same.
Clean code now rests in the sun.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the removal of the unused nodeNamesLen function from the scheduler.
Linked Issues check ✅ Passed The change removes the unused nodeNamesLen helper as requested and does not alter scheduler functionality.
Out of Scope Changes check ✅ Passed The pull request contains only the scoped removal of the unused nodeNamesLen helper.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Signed-off-by: KunwarSidhu47 <kunwarsidhu1947@gmail.com>
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
unittests 63.10% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/scheduler/scheduler.go 68.65% <ø> (+0.36%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mesutoezdil

Copy link
Copy Markdown
Contributor

closing: #2687 needs this helper for its nil guard, removing it now just conflicts with that fix.

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.

Cleanup: Remove unused nodeNamesLen function from scheduler

2 participants