Skip to content

Commit f51a594

Browse files
authored
Merge pull request #913 from doringeman/fix/false-lint
chore: pin golangci-lint version in .versions and read it in CI
2 parents 8671464 + de36e12 commit f51a594

5 files changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ jobs:
2626
go-version: ${{ steps.versions.outputs.go-version }}
2727
cache: true
2828

29+
- name: Load golangci-lint version
30+
id: golangci-lint-version
31+
run: echo "version=$(grep '^GOLANGCI_LINT_VERSION=' .versions | cut -d= -f2)" >> "$GITHUB_OUTPUT"
32+
2933
- name: Install golangci-lint
3034
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20
3135
with:
32-
version: v2.10.1
36+
version: ${{ steps.golangci-lint-version.outputs.version }}
3337
install-only: true
3438

3539
- name: Run linting for ${{ matrix.goos }}

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ linters:
149149
- G306 # G306: Expect WriteFile permissions to be 0600 or less (too restrictive; also flags "0o644" permissions)
150150
- G307 # G307: Deferring unsafe method "*os.File" on type "Close" (also EXC0008); (TODO: evaluate these and fix where needed: G307: Deferring unsafe method "*os.File" on type "Close")
151151
- G504 # G504: Blocklisted import net/http/cgi: Go versions < 1.6.3 are vulnerable to Httpoxy attack: (CVE-2016-5386); (only affects go < 1.6.3)
152+
- G122 # G122: Filesystem operation in Walk/WalkDir callback; fixing requires os.Root refactor.
152153
- G703 # G703: Path traversal via taint analysis; too many false positives.
153154
- G704 # G704: SSRF via taint analysis; too many false positives on internal HTTP clients.
154155
- G705 # G705: XSS via taint analysis; too many false positives.

.versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
GO_VERSION=1.25
2+
GOLANGCI_LINT_VERSION=v2.12.2
23
VLLM_VERSION=0.19.1
34
VLLM_UPSTREAM_VERSION=0.19.0
45
VLLM_METAL_RELEASE=v0.2.0-20260420-142150

pkg/distribution/oci/remote/range_redirect_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ func TestRangeTransport_MaxRedirectsExceeded(t *testing.T) {
459459

460460
// Server that always redirects to itself (infinite redirect loop).
461461
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
462-
http.Redirect(w, r, r.URL.String(), http.StatusFound)
462+
http.Redirect(w, r, r.URL.String(), http.StatusFound) //nolint:gosec // G710: intentional self-redirect to test redirect-limit logic
463463
}))
464464
defer srv.Close()
465465

pkg/inference/scheduling/http_handler.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,8 @@ func (h *HTTPHandler) Configure(w http.ResponseWriter, r *http.Request) {
483483

484484
// Preload the model in the background by calling handleOpenAIInference with preload-only context.
485485
// This makes Compose preload the model as well as it calls `configure` by default.
486-
go func() {
486+
userAgent := r.UserAgent()
487+
go func() { //nolint:gosec // G118: context.Background intentional — preload must outlive the request context
487488
preloadBody, err := json.Marshal(OpenAIInferenceRequest{Model: configureRequest.Model})
488489
if err != nil {
489490
h.scheduler.log.Warn("failed to marshal preload request body", "error", err)
@@ -501,7 +502,7 @@ func (h *HTTPHandler) Configure(w http.ResponseWriter, r *http.Request) {
501502
h.scheduler.log.Warn("failed to create preload request", "error", err)
502503
return
503504
}
504-
preloadReq.Header.Set("User-Agent", r.UserAgent())
505+
preloadReq.Header.Set("User-Agent", userAgent)
505506
if backend != nil {
506507
preloadReq.SetPathValue("backend", backend.Name())
507508
}

0 commit comments

Comments
 (0)