Skip to content

use lodash func#618

Merged
oleg-kushniriov merged 2 commits into
ai-dynamo:mainfrom
oleg-kushniriov:fix/use-existing-lib-func
May 19, 2026
Merged

use lodash func#618
oleg-kushniriov merged 2 commits into
ai-dynamo:mainfrom
oleg-kushniriov:fix/use-existing-lib-func

Conversation

@oleg-kushniriov

@oleg-kushniriov oleg-kushniriov commented May 17, 2026

Copy link
Copy Markdown
Contributor

/kind cleanup

What this PR does / why we need it:

Replaces two custom helpers in operator/internal/controller/common/component/utils with their direct samber/lo equivalents:

  • Deletes MapBy (and its tests) in favor of lo.SliceToMap. MapBy was a one-to-one re-implementation; callers in lookups.go and podgang/syncflow.go now use lo.SliceToMap
    directly.
  • Replaces the lo.Reduce(..., agg || …, false) fold in isStandalonePCLQ with lo.SomeBy. Same semantics, but SomeBy short-circuits on the first match instead of walking the full
    slice, and the intent ("does any config contain this clique?") is expressed directly.

No behavior change. Pure refactor to lean on the upstream library and shrink the local utils surface.

Which issue(s) this PR fixes:

Fixes #567

Special notes for your reviewer:

  • NewSet / NewSetBy were left in place: they return the package's Set[T] = map[T]struct{} typedef with a Has method, and lo has no equivalent set type — swapping them in would
    lose the named type and method.
  • groupPCLQsByLabel / groupPCSGsByLabel were also left alone: they filter items missing the label and group, so a one-to-one swap to lo.GroupBy isn't possible (would require
    lo.GroupBy(lo.Filter(…), …), a composite rather than a direct replacement).

Does this PR introduce a API change?

NONE

Additional documentation e.g., enhancement proposals, usage docs, etc.:

@copy-pr-bot

copy-pr-bot Bot commented May 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@oleg-kushniriov oleg-kushniriov force-pushed the fix/use-existing-lib-func branch from a9fb562 to 5c66505 Compare May 19, 2026 09:49
@oleg-kushniriov oleg-kushniriov merged commit f238e29 into ai-dynamo:main May 19, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Status field UpdatedPodCliques []string in PCS/PCSG does not scale — unbounded status payload at thousands of PodCliques and O(N²) reconciler CPU

3 participants