Skip to content

chore(gitops): index the inventory units instead of copying each one - #1300

Merged
antoinetoussaint-byte merged 1 commit into
mainfrom
chore/lint-range-value-copy
Nov 4, 2026
Merged

antoinetoussaint-byte merged 1 commit into
mainfrom
chore/lint-range-value-copy

Conversation

@antoinetoussaint-byte

Copy link
Copy Markdown
Contributor

Problem

main carries one golangci-lint finding since #1290: gocritic rangeValCopy in pkg/gitops/environment_declaration.go:36 (serviceUnitNames copies a 128-byte InventoryUnit per iteration). lint is not a required check, so the merge queue admitted it, but codefly publish judges every check-run on the release head (cmd/publish/landing.go inspectChecks), so the red lint context aborts every release pull request: v0.1.235 failed twice today (#1297, #1298) with this context red beside a docker-generate shard flake.

Change

Index the slice and take a pointer; the function returns the same names. No behaviour change.

Classification

Fix at the place that owns the behaviour (the loop itself). Reused: nothing new; the repo's lint configuration is the rule.

Tests

golangci-lint run ./pkg/gitops/...: 1 issue before, 0 after. go test ./pkg/gitops/ -run 'Declaration|ServiceUnit' passes. The govet shadow the coordinator noted at cell.go:159 does not exist on main any more (the region moved with #1295).

Not verified

Nothing beyond lint and the package tests; the change has no runtime path of its own.

🤖 Generated with Claude Code

golangci-lint's gocritic rangeValCopy flags serviceUnitNames copying a
128-byte InventoryUnit per iteration (pkg/gitops/environment_declaration.go,
since #1290). Lint is not a required check, so main carried it; this clears it
without changing what the function returns.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@antoinetoussaint-byte
antoinetoussaint-byte added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit 4af7cb8 Nov 4, 2026
19 checks passed
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