cleanup: remove stale dead code (>1 mo old)#2707
cleanup: remove stale dead code (>1 mo old)#2707LukeAVanDrie wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LukeAVanDrie The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Some of these funcs may be useful down the road, I'm not strongly advocating for removing all of them. We can evaluate these on a case-by-case basis. |
Removes unreachable functions identified by a time-bounded dead code audit to minimize the codebase delta before migration. Methods from runners, metrics, and testing wrappers were removed after verifying they were not modified in the last 30 days.
8144e92 to
63e1533
Compare
ahg-g
left a comment
There was a problem hiding this comment.
Thanks, a couple of functions should be kept for now
| } | ||
|
|
||
| // PluginByType retrieves the specified plugin by name and verifies its type | ||
| func PluginByType[P Plugin](handlePlugins HandlePlugins, name string) (P, error) { |
|
|
||
| // ReadCycleStateKey retrieves data with the given key from CycleState and asserts it to type T. | ||
| // Returns an error if the key is not found or the type assertion fails. | ||
| func ReadCycleStateKey[T plugin.StateData](c *CycleState, key plugin.StateKey) (T, error) { |
| func (r *Runner) WithExecutableName(exeName string) *Runner { | ||
| r.bbrExecutableName = exeName | ||
| return r | ||
| } | ||
|
|
There was a problem hiding this comment.
this is used as well.
pls revert
| func (r *Runner) WithExecutableName(exeName string) *Runner { | ||
| r.eppExecutableName = exeName | ||
| return r | ||
| } | ||
|
|
There was a problem hiding this comment.
this is used in llm-d.pls revert
| func (r *Runner) WithCustomCollectors(collectors ...prometheus.Collector) *Runner { | ||
| r.customCollectors = collectors | ||
| return r | ||
| } |
|
|
||
| // Compare returns the comparison of a and b where less than, equal, and greater than return -1, 0, | ||
| // and 1 respectively. | ||
| func Compare(a, b GKNN) int { |
There was a problem hiding this comment.
isn't this used in tests for old GKNN?
|
@nirrozenbaum Looks like this methodology doesn't work at the moment given x-repo dependencies. Do you want me to revert on a case-by-case basis or simply close this and repeat if/when EPP is moved into llmd-inference-scheduler? |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This PR removes stale, unreachable code to minimize the codebase delta before a repository migration.
To ensure I didn't remove in-flight or newly added work (e.g., interfaces added but not yet implemented), I used a time-bounded audit to focus on dead code older than 1 month, using the following methodology.
deadcodetool with the-testflag to locate uncalled functions across the workspace module:audit_dead_code.sh) to evaluate the exactgit blametimestamp of those specific lines.STALEfor removal; functions newer were marked asRECENTand left untouched.Here is the single pipeline used to run the time-bounded evaluator:
Audit Script Used (
audit_dead_code.sh):Click to expand
Audit Script Results:
Click to expand
**Removals Made:
cmd/bbr,cmd/epp):WithExecutableName,WithRequestControlConfig, etc.)pkg/epp/metrics/metrics.go):SetTTFTSLOThreshold,SetTPOTSLOThreshold)pkg/common/kubemeta.go):CompareandLesstest/utils/utils.go,pool.go, wrappers):DeleteObjects,EndpointPoolToInferencePool,ToGKNN,NewManagerWithOptions, etc.Which issue(s) this PR fixes:
N/A
Does this PR introduce a user-facing change?: