Skip to content

review: comment budget and named func types in pkg/scale and controllers - #12

Merged
CMGS merged 2 commits into
masterfrom
review/hygiene-2026-09-03
Sep 3, 2026
Merged

review: comment budget and named func types in pkg/scale and controllers#12
CMGS merged 2 commits into
masterfrom
review/hygiene-2026-09-03

Conversation

@CMGS

@CMGS CMGS commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Two review-only commits. Behavior is unchanged; the claim path is untouched (no allocation, lock, or control-flow change).

review: comment budget — godoc on interface-implementing methods

Drops godoc that paraphrases the interface the method implements, and condenses the blocks that had grown into justification narrative.

Deleted (the interface documents the contract, and a compile-time check pins the implementation):

  • pkg/scale/sandboxstore_lifecycle.go — all seven scatterGatherStore lifecycle methods; SandboxStore/SandboxLifecycle in sandboxstore.go already document them.
  • pkg/scale/sandboxstore_impl.goStaticInventorySource.Apply/ListNodes/NodeInventory/NodeCapacity and ClientInventorySource.ListNodes/NodeInventory/NodeCapacity.
  • pkg/scale/claimgateway_impl.goReviewAuthorizer.Authorize.
  • pkg/scale/warmpool/driver.goDriver.Reconcile; the requeue-keeps-status-fresh fact is already stated where the predicate is wired in SetupWithManager.
  • pkg/scale/apiserver/lifecycle_storage.goGroupVersionKind and Create.
  • pkg/scale/apiserver/storage.goCreate and Delete.

Condensed:

  • nodeClaimGateway.Release — the eleven-line contract block becomes three lines stating the invariant.
  • sandboxREST.Delete — the delete-authorization invariant survives as one line inside the method body.
  • CacheByObject, checkOwnership, v1alpha1State — one line each.

Comment lines: 61 removed, 6 added.

review: named func types

  • controllers/sandbox_controller.go spelled func(string) bool four times and func(string) three times across filterSystemKeys, propagateKeys, and prunePropagated. Both are now keyPredicate and keyCallback.
  • pkg/scale/sandboxstore_impl.go spelled func(inv *NodeInventory, i int) bool in findEntry and matchOnNode. Both now take inventoryMatch.

No comment lines added or removed.

Gates

Run from the worktree root with GOWORK=off.

make lint            0 issues. (GOOS=linux), 0 issues. (GOOS=darwin)
make fmt-check       clean on GOOS=darwin and GOOS=linux
asl ./...            clean on GOOS=darwin and GOOS=linux
go test -race -count=1 ./...   all packages ok

@CMGS
CMGS merged commit 1f70187 into master Sep 3, 2026
2 checks passed
@CMGS
CMGS deleted the review/hygiene-2026-09-03 branch September 3, 2026 06:10
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.

1 participant