mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-14 17:44:06 -08:00
Necessary changes to make the merge work
This commit disables some unused workflows on our CI. Also uses grafana/regexp instead of regexp which is blackisted. Also updates head_test TestHeadReadWriterRepair increasing ChunkWriteQueueSize to 1 so that the chunk disk mapper uses the async queue. This seems to be default behaviour in upstream prometheus and without this option our test fails.
This commit is contained in:
parent
48aa5cd096
commit
51f26e0cba
20
.github/workflows/buf-lint.yml
vendored
20
.github/workflows/buf-lint.yml
vendored
|
@ -1,20 +0,0 @@
|
||||||
name: buf.build
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- ".github/workflows/buf-lint.yml"
|
|
||||||
- "**.proto"
|
|
||||||
jobs:
|
|
||||||
buf:
|
|
||||||
name: lint
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: bufbuild/buf-setup-action@v1.3.1
|
|
||||||
- uses: bufbuild/buf-lint-action@v1
|
|
||||||
with:
|
|
||||||
input: 'prompb'
|
|
||||||
- uses: bufbuild/buf-breaking-action@v1
|
|
||||||
with:
|
|
||||||
input: 'prompb'
|
|
||||||
against: 'https://github.com/prometheus/prometheus.git#branch=main,ref=HEAD,subdir=prompb'
|
|
23
.github/workflows/buf.yml
vendored
23
.github/workflows/buf.yml
vendored
|
@ -1,23 +0,0 @@
|
||||||
name: buf.build
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
jobs:
|
|
||||||
buf:
|
|
||||||
name: lint and publish
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: bufbuild/buf-setup-action@v1.3.1
|
|
||||||
- uses: bufbuild/buf-lint-action@v1
|
|
||||||
with:
|
|
||||||
input: 'prompb'
|
|
||||||
- uses: bufbuild/buf-breaking-action@v1
|
|
||||||
with:
|
|
||||||
input: 'prompb'
|
|
||||||
against: 'https://github.com/prometheus/prometheus.git#branch=main,ref=HEAD~1,subdir=prompb'
|
|
||||||
- uses: bufbuild/buf-push-action@v1
|
|
||||||
with:
|
|
||||||
input: 'prompb'
|
|
||||||
buf_token: ${{ secrets.BUF_TOKEN }}
|
|
67
.github/workflows/codeql-analysis.yml
vendored
67
.github/workflows/codeql-analysis.yml
vendored
|
@ -1,67 +0,0 @@
|
||||||
# For most projects, this workflow file will not need changing; you simply need
|
|
||||||
# to commit it to your repository.
|
|
||||||
#
|
|
||||||
# You may wish to alter this file to override the set of languages analyzed,
|
|
||||||
# or to provide custom queries or build logic.
|
|
||||||
#
|
|
||||||
# ******** NOTE ********
|
|
||||||
# We have attempted to detect the languages in your repository. Please check
|
|
||||||
# the `language` matrix defined below to confirm you have the correct set of
|
|
||||||
# supported CodeQL languages.
|
|
||||||
#
|
|
||||||
name: "CodeQL"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main, release-*]
|
|
||||||
pull_request:
|
|
||||||
# The branches below must be a subset of the branches above
|
|
||||||
branches: [main]
|
|
||||||
schedule:
|
|
||||||
- cron: "26 14 * * 1"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
analyze:
|
|
||||||
name: Analyze
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
language: ["go", "javascript"]
|
|
||||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
|
||||||
# Learn more:
|
|
||||||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: github/codeql-action/init@v1
|
|
||||||
with:
|
|
||||||
languages: ${{ matrix.language }}
|
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
||||||
# By default, queries listed here will override any specified in a config file.
|
|
||||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
||||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
|
||||||
|
|
||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
|
||||||
- name: Autobuild
|
|
||||||
uses: github/codeql-action/autobuild@v1
|
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
|
||||||
# 📚 https://git.io/JvXDl
|
|
||||||
|
|
||||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
|
||||||
# and modify them (or add more) to build your code if your project
|
|
||||||
# uses a compiled language
|
|
||||||
|
|
||||||
#- run: |
|
|
||||||
# make bootstrap
|
|
||||||
# make release
|
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: github/codeql-action/analyze@v1
|
|
25
.github/workflows/fuzzing.yml
vendored
25
.github/workflows/fuzzing.yml
vendored
|
@ -1,25 +0,0 @@
|
||||||
name: CIFuzz
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
jobs:
|
|
||||||
Fuzzing:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Build Fuzzers
|
|
||||||
id: build
|
|
||||||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
|
|
||||||
with:
|
|
||||||
oss-fuzz-project-name: "prometheus"
|
|
||||||
dry-run: false
|
|
||||||
- name: Run Fuzzers
|
|
||||||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
|
|
||||||
with:
|
|
||||||
oss-fuzz-project-name: "prometheus"
|
|
||||||
fuzz-seconds: 600
|
|
||||||
dry-run: false
|
|
||||||
- name: Upload Crash
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
if: failure() && steps.build.outcome == 'success'
|
|
||||||
with:
|
|
||||||
name: artifacts
|
|
||||||
path: ./out/artifacts
|
|
|
@ -15,11 +15,11 @@ package labels
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"regexp"
|
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/grafana/regexp"
|
||||||
"github.com/grafana/regexp/syntax"
|
"github.com/grafana/regexp/syntax"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
@ -201,7 +201,6 @@ func TestFindSetMatches(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
matches := findSetMatches(parsed, "")
|
matches := findSetMatches(parsed, "")
|
||||||
require.Equal(t, c.exp, matches)
|
require.Equal(t, c.exp, matches)
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io/ioutil"
|
||||||
"math"
|
"math"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
|
|
@ -1618,6 +1618,7 @@ func TestHeadReadWriterRepair(t *testing.T) {
|
||||||
opts := DefaultHeadOptions()
|
opts := DefaultHeadOptions()
|
||||||
opts.ChunkRange = chunkRange
|
opts.ChunkRange = chunkRange
|
||||||
opts.ChunkDirRoot = dir
|
opts.ChunkDirRoot = dir
|
||||||
|
opts.ChunkWriteQueueSize = 1 // We need to set this option so that we use the async queue. Upstream prometheus uses the queue directly.
|
||||||
h, err := NewHead(nil, nil, w, opts, nil)
|
h, err := NewHead(nil, nil, w, opts, nil)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, 0.0, prom_testutil.ToFloat64(h.metrics.mmapChunkCorruptionTotal))
|
require.Equal(t, 0.0, prom_testutil.ToFloat64(h.metrics.mmapChunkCorruptionTotal))
|
||||||
|
|
|
@ -247,7 +247,7 @@ func TestPostingsForMatchersCache(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.EqualError(t, p.Err(), "result from call 1")
|
require.EqualError(t, p.Err(), "result from call 1")
|
||||||
|
|
||||||
// make first call agian, it's calculated again
|
// make first call again, it's calculated again
|
||||||
p, err = c.PostingsForMatchers(indexForPostingsMock{}, true, calls[0]...)
|
p, err = c.PostingsForMatchers(indexForPostingsMock{}, true, calls[0]...)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.EqualError(t, p.Err(), "result from call 2")
|
require.EqualError(t, p.Err(), "result from call 2")
|
||||||
|
|
Loading…
Reference in a new issue