Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
container:
# Whenever the Go version is updated here, .promu.yml
# should also be updated.
image: quay.io/prometheus/golang-builder:1.24-base
image: quay.io/prometheus/golang-builder:1.25-base
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand All @@ -32,7 +32,7 @@ jobs:
name: More Go tests
runs-on: ubuntu-latest
container:
image: quay.io/prometheus/golang-builder:1.24-base
image: quay.io/prometheus/golang-builder:1.25-base
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand All @@ -55,7 +55,7 @@ jobs:
GOTOOLCHAIN: local
container:
# The go version in this image should be N-1 wrt test_go.
image: quay.io/prometheus/golang-builder:1.23-base
image: quay.io/prometheus/golang-builder:1.25-base
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand All @@ -70,7 +70,7 @@ jobs:
# Whenever the Go version is updated here, .promu.yml
# should also be updated.
container:
image: quay.io/prometheus/golang-builder:1.24-base
image: quay.io/prometheus/golang-builder:1.25-base

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -97,7 +97,7 @@ jobs:
persist-credentials: false
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version: 1.24.x
go-version: 1.25.x
- run: |
$TestTargets = go list ./... | Where-Object { $_ -NotMatch "(github.com/prometheus/prometheus/config|github.com/prometheus/prometheus/web)"}
go test $TestTargets -vet=off -v
Expand All @@ -109,7 +109,7 @@ jobs:
# Whenever the Go version is updated here, .promu.yml
# should also be updated.
container:
image: quay.io/prometheus/golang-builder:1.24-base
image: quay.io/prometheus/golang-builder:1.25-base
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down Expand Up @@ -208,7 +208,7 @@ jobs:
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
cache: false
go-version: 1.24.x
go-version: 1.25.x
- name: Run goyacc and check for diff
run: make install-goyacc check-generated-parser
golangci:
Expand All @@ -222,7 +222,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version: 1.24.x
go-version: 1.25.x
- name: Install snmp_exporter/generator dependencies
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
if: github.repository == 'prometheus/snmp_exporter'
Expand All @@ -231,7 +231,7 @@ jobs:
with:
args: --verbose
# Make sure to sync this with Makefile.common and scripts/golangci-lint.yml.
version: v2.1.5
version: v2.4.0
fuzzing:
uses: ./.github/workflows/fuzzing.yml
if: github.event_name == 'pull_request'
Expand Down
12 changes: 6 additions & 6 deletions .tekton/prometheus-acm-216-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ spec:
pipelineRef:
resolver: git
params:
- name: url
value: "https://github.com/stolostron/konflux-build-catalog.git"
- name: revision
value: main
- name: pathInRepo
value: pipelines/common.yaml
- name: url
value: "https://github.com/stolostron/konflux-build-catalog.git"
- name: revision
value: main
- name: pathInRepo
value: pipelines/common.yaml
taskRunTemplate:
serviceAccountName: build-pipeline-prometheus-acm-216
workspaces:
Expand Down
12 changes: 6 additions & 6 deletions .tekton/prometheus-acm-216-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ spec:
pipelineRef:
resolver: git
params:
- name: url
value: "https://github.com/stolostron/konflux-build-catalog.git"
- name: revision
value: main
- name: pathInRepo
value: pipelines/common.yaml
- name: url
value: "https://github.com/stolostron/konflux-build-catalog.git"
- name: revision
value: main
- name: pathInRepo
value: pipelines/common.yaml
taskRunTemplate:
serviceAccountName: build-pipeline-prometheus-acm-216
workspaces:
Expand Down
2 changes: 1 addition & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
SKIP_GOLANGCI_LINT :=
GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?=
GOLANGCI_LINT_VERSION ?= v2.1.5
GOLANGCI_LINT_VERSION ?= v2.4.0
GOLANGCI_FMT_OPTS ?=
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
# windows isn't included here because of the path separator being different.
Expand Down
4 changes: 2 additions & 2 deletions scripts/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
- name: Install Go
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version: 1.24.x
go-version: 1.25.x
- name: Install snmp_exporter/generator dependencies
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
if: github.repository == 'prometheus/snmp_exporter'
- name: Lint
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
with:
args: --verbose
version: v2.1.5
version: v2.4.0
8 changes: 8 additions & 0 deletions storage/remote/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ func DecodeReadRequest(r *http.Request) (*prompb.ReadRequest, error) {
return nil, err
}

decodedLen, err := snappy.DecodedLen(compressed)
if err != nil {
return nil, err
}
if decodedLen > decodeReadLimit {
return nil, fmt.Errorf("snappy: decoded length %d exceeds limit %d", decodedLen, decodeReadLimit)
}

reqBuf, err := snappy.Decode(nil, compressed)
if err != nil {
return nil, err
Expand Down
12 changes: 12 additions & 0 deletions storage/remote/codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"bytes"
"fmt"
"io"
"net/http"
"sync"
"testing"

Expand Down Expand Up @@ -616,6 +617,17 @@ func TestMergeLabels(t *testing.T) {
}
}

func TestDecodeReadRequestTooLarge(t *testing.T) {
// 5-byte snappy stream whose header claims 256 MiB decoded length,
// well above decodeReadLimit (32 MiB).
bomb := []byte{0x80, 0x80, 0x80, 0x80, 0x01}
req, err := http.NewRequest(http.MethodPost, "/", bytes.NewReader(bomb))
require.NoError(t, err)

_, err = DecodeReadRequest(req)
require.ErrorContains(t, err, "exceeds limit")
}

func TestDecodeWriteRequest(t *testing.T) {
buf, _, _, err := buildWriteRequest(nil, writeRequestFixture.Timeseries, nil, nil, nil, nil, "snappy")
require.NoError(t, err)
Expand Down
Loading